rtnetlink: make SR-IOV VF interface symmetric
Subsystems (2)
PATCH 1/1 rtnetlink: make SR-IOV VF interface symmetric
Now we have a set of nested attributes:
IFLA_VFINFO_LIST (NESTED)
IFLA_VF_INFO (NESTED)
IFLA_VF_MAC
IFLA_VF_VLAN
IFLA_VF_TX_RATE
This allows a single set to operate on multiple attributes if desired. Among other things, it means a dump can be replayed to set state.
The current interface has yet to be released, so this seems like something to consider for 2.6.34.
---
Stephen, I'll send the iproute2 update as well
include/linux/if_link.h | 23 ++++++- net/core/rtnetlink.c | 159 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 129 insertions(+), 53 deletions(-)
include/linux/if_link.h +19 -4
@@ -79,10 +79,7 @@ enum {IFLA_NET_NS_PID ,IFLA_IFALIAS ,IFLA_NUM_VF ,/* Number of VFs if device is SR-IOV PF */ -IFLA_VF_MAC ,/* Hardware queue specific attributes */ -IFLA_VF_VLAN , -IFLA_VF_TX_RATE ,/* TX Bandwidth Allocation */ -IFLA_VFINFO , +IFLA_VFINFO_LIST , __IFLA_MAX };
@@ -203,6 +200,24 @@ enum macvlan_mode {/* SR-IOV virtual function managment section */ +enum { +IFLA_VF_INFO_UNSPEC , +IFLA_VF_INFO , + __IFLA_VF_INFO_MAX, +}; + +#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1) + +enum { +IFLA_VF_UNSPEC , +IFLA_VF_MAC ,/* Hardware queue specific attributes */ +IFLA_VF_VLAN , +IFLA_VF_TX_RATE ,/* TX Bandwidth Allocation */ + __IFLA_VF_MAX, +}; + +#define IFLA_VF_MAX (__IFLA_VF_MAX - 1) +struct ifla_vf_mac {__u32 vf;__u8 mac[32 ];/* MAX_ADDR_LEN */
net/core/rtnetlink.c +110 -49
207 lines not on this page · raw message
Signature · 1 line
1.6.5.2
Quoted 8 lines · On Saturday 15 May 2010 05:14:16 Chris Wright wrote:
Now we have a set of nested attributes:
IFLA_VFINFO_LIST(NESTED)
IFLA_VF_INFO(NESTED)
IFLA_VF_MAC
IFLA_VF_VLAN
IFLA_VF_TX_RATE
Quoted 7 lines
This allows a single set to operate on multiple attributes if desired. Among other things, it means a dump can be replayed to set state.
The current interface has yet to be released, so this seems like something to consider for 2.6.34.
Signed-off-by Chris Wright <[email protected]
Very nice! This would be the minimum change to make the ABI conform to the general rules, so it would be really good to have that.
It does make the interface a bit strange (less than before), since the new IFLA_VF_INFO now contains three nested attributes that each contain their own vf number field, and we don't require that they are identical or that each of the nested attributes inside VF_INFO appears only once.
How about a second patch that splits out an IFLA_VF_NUMBER attribute and makes do_setvfinfo use nla_parse_nested instead of nla_for_each_nested in order to tighten the rules on this some more?
Arnd
Quoted 22 lines · * Arnd Bergmann ([email protected]) wrote:
Quoted 8 lines · On Saturday 15 May 2010 05:14:16 Chris Wright wrote:
Now we have a set of nested attributes:
IFLA_VFINFO_LIST(NESTED)
IFLA_VF_INFO(NESTED)
IFLA_VF_MAC
IFLA_VF_VLAN
IFLA_VF_TX_RATEQuoted 7 lines
This allows a single set to operate on multiple attributes if desired. Among other things, it means a dump can be replayed to set state.
The current interface has yet to be released, so this seems like something to consider for 2.6.34.
Signed-off-by Chris Wright <[email protected]Very nice! This would be the minimum change to make the ABI conform to the general rules, so it would be really good to have that.
Acked-by Arnd Bergmann <[email protected]>
Quoted 8 lines
It does make the interface a bit strange (less than before), since the new
IFLA_VF_INFOnow contains three nested attributes that each contain their own vf number field, and we don't require that they are identical or that each of the nested attributes insideVF_INFOappears only once.How about a second patch that splits out an
IFLA_VF_NUMBERattribute and makesdo_setvfinfousenla_parse_nestedinstead ofnla_for_each_nestedin order to tighten the rules on this some more?
Yes, that's a great idea Arnd. I'll tighten that up.
thanks,
-chris
David Miller
maintainerFrom: Chris Wright <[email protected]>
Date: Fri, 14 May 2010 20:14:16 -0700
Quoted 8 lines
Now we have a set of nested attributes:
IFLA_VFINFO_LIST(NESTED)
IFLA_VF_INFO(NESTED)
IFLA_VF_MAC
IFLA_VF_VLAN
IFLA_VF_TX_RATE
Quoted 7 lines
This allows a single set to operate on multiple attributes if desired. Among other things, it means a dump can be replayed to set state.
The current interface has yet to be released, so this seems like something to consider for 2.6.34.
Signed-off-by Chris Wright <[email protected]
Agreed, applied to net-2.6, thanks Chris!
Quoted 8 lines · On Fri, 14 May 2010 20:14:16 -0700 Chris Wright <[email protected]> wrote:
Now we have a set of nested attributes:
IFLA_VFINFO_LIST(NESTED)
IFLA_VF_INFO(NESTED)
IFLA_VF_MAC
IFLA_VF_VLAN
IFLA_VF_TX_RATE
Quoted 8 lines
This allows a single set to operate on multiple attributes if desired. Among other things, it means a dump can be replayed to set state.
The current interface has yet to be released, so this seems like something to consider for 2.6.34.
Signed-off-by Chris Wright <[email protected]---
iproute2 update please?
Also I would really like documentation on this.
Quoted 28 lines
-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Monday, May 17, 2010 9:00 AM
To: Chris Wright
Cc: [email protected]; [email protected]; Williams, Mitch A; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetricQuoted 8 lines · On Fri, 14 May 2010 20:14:16 -0700 Chris Wright <[email protected]> wrote:
Now we have a set of nested attributes:
IFLA_VFINFO_LIST(NESTED)
IFLA_VF_INFO(NESTED)
IFLA_VF_MAC
IFLA_VF_VLAN
IFLA_VF_TX_RATEQuoted 8 lines
This allows a single set to operate on multiple attributes if desired. Among other things, it means a dump can be replayed to set state.
The current interface has yet to be released, so this seems like something to consider for 2.6.34.
Signed-off-by Chris Wright <[email protected]---
Quoted 6 lines
iproute2 update please?
Also I would really like documentation on this.
--
Chris, have you got the iproute2 parts working, or do I need to pick it up?
Thanks again for your work on this.
-Mitch
Quoted 25 lines · * Williams, Mitch A ([email protected]) wrote:
Quoted 25 lines
-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Monday, May 17, 2010 9:00 AM
To: Chris Wright
Cc: [email protected]; [email protected]; Williams, Mitch A; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetricQuoted 14 lines · On Fri, 14 May 2010 20:14:16 -0700 Chris Wright <[email protected]> wrote:
Now we have a set of nested attributes:
IFLA_VFINFO_LIST(NESTED)
IFLA_VF_INFO(NESTED)
IFLA_VF_MAC
IFLA_VF_VLAN
IFLA_VF_TX_RATEThis allows a single set to operate on multiple attributes if desired. Among other things, it means a dump can be replayed to set state.
The current interface has yet to be released, so this seems like something to consider for 2.6.34.
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Signed-off-by Chris Wright <[email protected]---
iproute2 update please?
Also I would really like documentation on this.
And a pony? ;-)
Docs in what form?
Quoted 3 lines
Chris, have you got the iproute2 parts working, or do I need to pick it up?
Thanks again for your work on this.
I've got those bits, just was waiting until patches merged. Will send them out this afternoon.
thanks,
-chris
Quoted 29 lines · On Mon, 17 May 2010 09:07:32 -0700 Chris Wright <[email protected]> wrote:
Quoted 28 lines · * Williams, Mitch A ([email protected]) wrote:
Quoted 28 lines
-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Monday, May 17, 2010 9:00 AM
To: Chris Wright
Cc: [email protected]; [email protected]; Williams, Mitch A; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH] rtnetlink: make SR-IOV VF interface symmetricQuoted 16 lines · On Fri, 14 May 2010 20:14:16 -0700 Chris Wright <[email protected]> wrote:
Now we have a set of nested attributes:
IFLA_VFINFO_LIST(NESTED)
IFLA_VF_INFO(NESTED)
IFLA_VF_MAC
IFLA_VF_VLAN
IFLA_VF_TX_RATEThis allows a single set to operate on multiple attributes if desired. Among other things, it means a dump can be replayed to set state.
The current interface has yet to be released, so this seems like something to consider for 2.6.34.
Signed-off-by Chris Wright <[email protected]---
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
iproute2 update please?
Also I would really like documentation on this.
And a pony? ;-)
Docs in what form?
The man page for ip.8 already has some pieces from other version. Just fix them. I just pushed up a couple of changes.