Subject: Re: [net-next-2.6 V6 PATCH 1/2] Add netlink support for virtual port management (was iovnl)

From: Patrick McHardy <[email-masked]>
Date: Thu, 13 May 2010 23:11:53 +0200

Chris Wright wrote:
> * Patrick McHardy ([email-masked]) wrote:
>> Chris Wright wrote:
>>> * Patrick McHardy ([email-masked]) wrote:
>>>>> +	} else  {
>>>>> +		err = rtnl_vf_port_fill_nest(skb, dev, -1);
>>>> What does -1 mean?
>>> It means no VFs.  Could be made a macro/enum constant
>> Why call rtnl_vg_port_fill_nest at all in that case? It even
>> calls the ndo_get_vf_port() callback.
> 
> For the case where port profile is set on net dev that does not
> have VFs (e.g. the enic case in 2/2).

Thanks for the explanation. I guess a enum constant would be nice
to have. But the bigger problem is the asymetrical message
parsing/construction.

BTW:

> +enum {
> +	VF_PORT_REQUEST_PREASSOCIATE = 0,
> +	VF_PORT_REQUEST_PREASSOCIATE_RR,
> +	VF_PORT_REQUEST_ASSOCIATE,
> +	VF_PORT_REQUEST_DISASSOCIATE,
> +};

Do multiple of these commands have to be issued in order to
reach "associated" state? That also wouldn't fit into the
rtnetlink design, which contains state, not commands.