Skip to contentSkip to conversation

rtnetlink: make SR-IOV VF interface symmetric

PATCH In review Chris Wright 5 participants 8 messages May 15, 2010 – May 17, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index c9bf92c..d94963b 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw
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.

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

#2 lore raw
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_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.

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.

Quoted 8 lines

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?

Yes, that's a great idea Arnd. I'll tighten that up.

thanks,
-chris

maintainer
#3 lore raw
In reply to Chris Wright

From: 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.

Agreed, applied to net-2.6, thanks Chris!

#4 lore raw
In reply to Chris Wright
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.

---

iproute2 update please?

Also I would really like documentation on this.

#5 lore raw
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 symmetric

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.

---

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

#6 lore raw
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 symmetric

Quoted 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_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.

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

---

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

#7 lore raw
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 symmetric

Quoted 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_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.

---

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.