All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
@ 2011-09-25  8:23 Jeff Kirsher
  2011-09-25 17:23 ` Stephen Hemminger
  2011-11-17 23:39 ` Greg Rose
  0 siblings, 2 replies; 15+ messages in thread
From: Jeff Kirsher @ 2011-09-25  8:23 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Greg Rose, davem, netdev, gospo, Jeff Kirsher

From: Greg Rose <gregory.v.rose@intel.com>

Add IP link command parsing for VF spoof checking enable/disable

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 include/linux/if_link.h |    7 +++++++
 ip/ipaddress.c          |    6 ++++++
 ip/iplink.c             |   15 +++++++++++++++
 man/man8/ip.8           |    4 +++-
 4 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 304c44f..e421f60 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -277,6 +277,7 @@ enum {
 	IFLA_VF_MAC,		/* Hardware queue specific attributes */
 	IFLA_VF_VLAN,
 	IFLA_VF_TX_RATE,	/* TX Bandwidth Allocation */
+	IFLA_VF_SPOOFCHK,	/* Spoof Checking on/off switch */
 	__IFLA_VF_MAX,
 };
 
@@ -298,12 +299,18 @@ struct ifla_vf_tx_rate {
 	__u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
 };
 
+struct ifla_vf_spoofchk {
+	__u32 vf;
+	__u32 setting;
+};
+
 struct ifla_vf_info {
 	__u32 vf;
 	__u8 mac[32];
 	__u32 vlan;
 	__u32 qos;
 	__u32 tx_rate;
+	__u32 spoofchk;
 };
 
 /* VF ports management section
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 85f05a2..7e6ac50 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -197,6 +197,7 @@ static void print_vfinfo(FILE *fp, struct rtattr *vfinfo)
 	struct ifla_vf_mac *vf_mac;
 	struct ifla_vf_vlan *vf_vlan;
 	struct ifla_vf_tx_rate *vf_tx_rate;
+	struct ifla_vf_spoofchk *vf_spoofchk;
 	struct rtattr *vf[IFLA_VF_MAX+1];
 	SPRINT_BUF(b1);
 
@@ -210,6 +211,7 @@ static void print_vfinfo(FILE *fp, struct rtattr *vfinfo)
 	vf_mac = RTA_DATA(vf[IFLA_VF_MAC]);
 	vf_vlan = RTA_DATA(vf[IFLA_VF_VLAN]);
 	vf_tx_rate = RTA_DATA(vf[IFLA_VF_TX_RATE]);
+	vf_spoofchk = RTA_DATA(vf[IFLA_VF_SPOOFCHK]);
 
 	fprintf(fp, "\n    vf %d MAC %s", vf_mac->vf,
 		ll_addr_n2a((unsigned char *)&vf_mac->mac,
@@ -220,6 +222,10 @@ static void print_vfinfo(FILE *fp, struct rtattr *vfinfo)
 		fprintf(fp, ", qos %d", vf_vlan->qos);
 	if (vf_tx_rate->rate)
 		fprintf(fp, ", tx rate %d (Mbps)", vf_tx_rate->rate);
+	if (vf_spoofchk->setting)
+		fprintf(fp, ", spoof checking on");
+	else
+		fprintf(fp, ", spoof checking off");
 }
 
 int print_linkinfo(const struct sockaddr_nl *who,
diff --git a/ip/iplink.c b/ip/iplink.c
index e5325a6..f4a5243 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -71,7 +71,10 @@ void iplink_usage(void)
 	fprintf(stderr, "			  [ alias NAME ]\n");
 	fprintf(stderr, "	                  [ vf NUM [ mac LLADDR ]\n");
 	fprintf(stderr, "				   [ vlan VLANID [ qos VLAN-QOS ] ]\n");
+
 	fprintf(stderr, "				   [ rate TXRATE ] ] \n");
+
+	fprintf(stderr, "				   [ spoofchk { on | off} ] ] \n");
 	fprintf(stderr, "			  [ master DEVICE ]\n");
 	fprintf(stderr, "			  [ nomaster ]\n");
 	fprintf(stderr, "       ip link show [ DEVICE | group GROUP ]\n");
@@ -228,6 +231,18 @@ int iplink_parse_vf(int vf, int *argcp, char ***argvp,
 			ivt.vf = vf;
 			addattr_l(&req->n, sizeof(*req), IFLA_VF_TX_RATE, &ivt, sizeof(ivt));
 		
+		} else if (matches(*argv, "spoofchk") == 0) {
+			struct ifla_vf_spoofchk ivs;
+			NEXT_ARG();
+			if (matches(*argv, "on") == 0)
+				ivs.setting = 1;
+			else if (matches(*argv, "off") == 0)
+				ivs.setting = 0;
+			else
+				invarg("Invalid \"spoofchk\" value\n", *argv);
+			ivs.vf = vf;
+			addattr_l(&req->n, sizeof(*req), IFLA_VF_SPOOFCHK, &ivs, sizeof(ivs));
+
 		} else {
 			/* rewind arg */
 			PREV_ARG();
diff --git a/man/man8/ip.8 b/man/man8/ip.8
index 27993a4..cd7b97a 100644
--- a/man/man8/ip.8
+++ b/man/man8/ip.8
@@ -100,7 +100,9 @@ ip \- show / manipulate routing, devices, policy routing and tunnels
 .B qos
 .IR VLAN-QOS " ] ] ["
 .B rate
-.IR TXRATE " ] |"
+.IR TXRATE " ] ["
+.B spoofchk { on | off }
+] |
 .br
 .B master
 .IR DEVICE
-- 
1.7.6.2

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-25  8:23 [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check Jeff Kirsher
@ 2011-09-25 17:23 ` Stephen Hemminger
  2011-09-26 16:21   ` Rose, Gregory V
  2011-11-17 23:39 ` Greg Rose
  1 sibling, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2011-09-25 17:23 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Greg Rose, davem, netdev, gospo

On Sun, 25 Sep 2011 01:23:18 -0700
Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:

> From: Greg Rose <gregory.v.rose@intel.com>
> 
> Add IP link command parsing for VF spoof checking enable/disable
> 
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

See my comments about ABI compatibility. Can't just grow size of structure.
Need to have new version of iproute work with older kernels.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-25 17:23 ` Stephen Hemminger
@ 2011-09-26 16:21   ` Rose, Gregory V
  2011-09-26 16:41     ` Ben Hutchings
  0 siblings, 1 reply; 15+ messages in thread
From: Rose, Gregory V @ 2011-09-26 16:21 UTC (permalink / raw)
  To: Stephen Hemminger, Kirsher, Jeffrey T; +Cc: davem, netdev, gospo

> -----Original Message-----
> From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> Sent: Sunday, September 25, 2011 10:24 AM
> To: Kirsher, Jeffrey T
> Cc: Rose, Gregory V; davem@davemloft.net; netdev@vger.kernel.org;
> gospo@redhat.com
> Subject: Re: [net-next] iproute2: Add new command to IP link to
> enable/disable VF spoof check
> 
> On Sun, 25 Sep 2011 01:23:18 -0700
> Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> 
> > From: Greg Rose <gregory.v.rose@intel.com>
> >
> > Add IP link command parsing for VF spoof checking enable/disable
> >
> > Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> 
> See my comments about ABI compatibility. Can't just grow size of
> structure.
> Need to have new version of iproute work with older kernels.

In this case I have no idea how to proceed.  I'll go back and stare at it some more.

- Greg

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-26 16:21   ` Rose, Gregory V
@ 2011-09-26 16:41     ` Ben Hutchings
  2011-09-26 16:47       ` Stephen Hemminger
  0 siblings, 1 reply; 15+ messages in thread
From: Ben Hutchings @ 2011-09-26 16:41 UTC (permalink / raw)
  To: Rose, Gregory V
  Cc: Stephen Hemminger, Kirsher, Jeffrey T, davem, netdev, gospo

On Mon, 2011-09-26 at 09:21 -0700, Rose, Gregory V wrote:
> > -----Original Message-----
> > From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> > Sent: Sunday, September 25, 2011 10:24 AM
> > To: Kirsher, Jeffrey T
> > Cc: Rose, Gregory V; davem@davemloft.net; netdev@vger.kernel.org;
> > gospo@redhat.com
> > Subject: Re: [net-next] iproute2: Add new command to IP link to
> > enable/disable VF spoof check
> > 
> > On Sun, 25 Sep 2011 01:23:18 -0700
> > Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> > 
> > > From: Greg Rose <gregory.v.rose@intel.com>
> > >
> > > Add IP link command parsing for VF spoof checking enable/disable
> > >
> > > Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> > > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > 
> > See my comments about ABI compatibility. Can't just grow size of
> > structure.
> > Need to have new version of iproute work with older kernels.
> 
> In this case I have no idea how to proceed.  I'll go back and stare at it some more.

Where is this structure used on the wire?  I just don't see it.

If the modified iproute2 crashes on older kernels, that's presumably
because it's not correctly handling the case where IFLA_VF_SPOOFCHK is
missing.  Nothing to do with the size of this structure.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-26 16:41     ` Ben Hutchings
@ 2011-09-26 16:47       ` Stephen Hemminger
  2011-09-26 16:58         ` Rose, Gregory V
  2011-09-26 20:54         ` Christian Benvenuti (benve)
  0 siblings, 2 replies; 15+ messages in thread
From: Stephen Hemminger @ 2011-09-26 16:47 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Rose, Gregory V, Kirsher, Jeffrey T, davem, netdev, gospo

On Mon, 26 Sep 2011 17:41:59 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:

> On Mon, 2011-09-26 at 09:21 -0700, Rose, Gregory V wrote:
> > > -----Original Message-----
> > > From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> > > Sent: Sunday, September 25, 2011 10:24 AM
> > > To: Kirsher, Jeffrey T
> > > Cc: Rose, Gregory V; davem@davemloft.net; netdev@vger.kernel.org;
> > > gospo@redhat.com
> > > Subject: Re: [net-next] iproute2: Add new command to IP link to
> > > enable/disable VF spoof check
> > > 
> > > On Sun, 25 Sep 2011 01:23:18 -0700
> > > Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> > > 
> > > > From: Greg Rose <gregory.v.rose@intel.com>
> > > >
> > > > Add IP link command parsing for VF spoof checking enable/disable
> > > >
> > > > Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> > > > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > > 
> > > See my comments about ABI compatibility. Can't just grow size of
> > > structure.
> > > Need to have new version of iproute work with older kernels.
> > 
> > In this case I have no idea how to proceed.  I'll go back and stare at it some more.
> 
> Where is this structure used on the wire?  I just don't see it.
> 
> If the modified iproute2 crashes on older kernels, that's presumably
> because it's not correctly handling the case where IFLA_VF_SPOOFCHK is
> missing.  Nothing to do with the size of this structure.

The proposed code is fine because the vf_info is not used by any code
in iproute right now and I doubt that any other tools are using it either.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-26 16:47       ` Stephen Hemminger
@ 2011-09-26 16:58         ` Rose, Gregory V
  2011-09-26 20:54         ` Christian Benvenuti (benve)
  1 sibling, 0 replies; 15+ messages in thread
From: Rose, Gregory V @ 2011-09-26 16:58 UTC (permalink / raw)
  To: Stephen Hemminger, Ben Hutchings; +Cc: Kirsher, Jeffrey T, davem, netdev, gospo

> -----Original Message-----
> From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> Sent: Monday, September 26, 2011 9:47 AM
> To: Ben Hutchings
> Cc: Rose, Gregory V; Kirsher, Jeffrey T; davem@davemloft.net;
> netdev@vger.kernel.org; gospo@redhat.com
> Subject: Re: [net-next] iproute2: Add new command to IP link to
> enable/disable VF spoof check
> 
> On Mon, 26 Sep 2011 17:41:59 +0100
> Ben Hutchings <bhutchings@solarflare.com> wrote:
> 
> > On Mon, 2011-09-26 at 09:21 -0700, Rose, Gregory V wrote:
> > > > -----Original Message-----
> > > > From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> > > > Sent: Sunday, September 25, 2011 10:24 AM
> > > > To: Kirsher, Jeffrey T
> > > > Cc: Rose, Gregory V; davem@davemloft.net; netdev@vger.kernel.org;
> > > > gospo@redhat.com
> > > > Subject: Re: [net-next] iproute2: Add new command to IP link to
> > > > enable/disable VF spoof check
> > > >
> > > > On Sun, 25 Sep 2011 01:23:18 -0700
> > > > Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> > > >
> > > > > From: Greg Rose <gregory.v.rose@intel.com>
> > > > >
> > > > > Add IP link command parsing for VF spoof checking enable/disable
> > > > >
> > > > > Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> > > > > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > > >
> > > > See my comments about ABI compatibility. Can't just grow size of
> > > > structure.
> > > > Need to have new version of iproute work with older kernels.
> > >
> > > In this case I have no idea how to proceed.  I'll go back and stare at
> it some more.
> >
> > Where is this structure used on the wire?  I just don't see it.
> >
> > If the modified iproute2 crashes on older kernels, that's presumably
> > because it's not correctly handling the case where IFLA_VF_SPOOFCHK is
> > missing.  Nothing to do with the size of this structure.
> 
> The proposed code is fine because the vf_info is not used by any code
> in iproute right now and I doubt that any other tools are using it either.

As I mentioned in another post to this thread the ip tool works fine on older kernels when you do the set operation.  It's when you run the ip link show command that you can get a seg fault because the ip tool is looking for a spoof check value set by the kernel that doesn't exist.  I'll see what I can do to fix that up and respin the patch.

- Greg

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-26 16:47       ` Stephen Hemminger
  2011-09-26 16:58         ` Rose, Gregory V
@ 2011-09-26 20:54         ` Christian Benvenuti (benve)
  2011-09-26 21:00           ` David Miller
  1 sibling, 1 reply; 15+ messages in thread
From: Christian Benvenuti (benve) @ 2011-09-26 20:54 UTC (permalink / raw)
  To: Stephen Hemminger, Ben Hutchings
  Cc: Rose, Gregory V, Kirsher, Jeffrey T, davem, netdev, gospo

> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Stephen Hemminger
> Sent: Monday, September 26, 2011 9:47 AM
> To: Ben Hutchings
> Cc: Rose, Gregory V; Kirsher, Jeffrey T; davem@davemloft.net;
> netdev@vger.kernel.org; gospo@redhat.com
> Subject: Re: [net-next] iproute2: Add new command to IP link to
> enable/disable VF spoof check
> 
> On Mon, 26 Sep 2011 17:41:59 +0100
> Ben Hutchings <bhutchings@solarflare.com> wrote:
> 
> > On Mon, 2011-09-26 at 09:21 -0700, Rose, Gregory V wrote:
> > > > -----Original Message-----
> > > > From: Stephen Hemminger [mailto:shemminger@vyatta.com]
> > > > Sent: Sunday, September 25, 2011 10:24 AM
> > > > To: Kirsher, Jeffrey T
> > > > Cc: Rose, Gregory V; davem@davemloft.net;
netdev@vger.kernel.org;
> > > > gospo@redhat.com
> > > > Subject: Re: [net-next] iproute2: Add new command to IP link to
> > > > enable/disable VF spoof check
> > > >
> > > > On Sun, 25 Sep 2011 01:23:18 -0700
> > > > Jeff Kirsher <jeffrey.t.kirsher@intel.com> wrote:
> > > >
> > > > > From: Greg Rose <gregory.v.rose@intel.com>
> > > > >
> > > > > Add IP link command parsing for VF spoof checking
> enable/disable
> > > > >
> > > > > Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> > > > > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> > > >
> > > > See my comments about ABI compatibility. Can't just grow size of
> > > > structure.
> > > > Need to have new version of iproute work with older kernels.
> > >
> > > In this case I have no idea how to proceed.  I'll go back and
stare
> at it some more.
> >
> > Where is this structure used on the wire?  I just don't see it.
> >
> > If the modified iproute2 crashes on older kernels, that's presumably
> > because it's not correctly handling the case where IFLA_VF_SPOOFCHK
> is
> > missing.  Nothing to do with the size of this structure.
> 
> The proposed code is fine because the vf_info is not used by any code
> in iproute right now and I doubt that any other tools are using it
> either.

Does it mean that a Netlink interface becomes official (and backward
compatibility
should not be broken) only once iproute2 starts supporting it?

/Chris

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-26 20:54         ` Christian Benvenuti (benve)
@ 2011-09-26 21:00           ` David Miller
  2011-09-26 21:19             ` Stephen Hemminger
  0 siblings, 1 reply; 15+ messages in thread
From: David Miller @ 2011-09-26 21:00 UTC (permalink / raw)
  To: benve
  Cc: shemminger, bhutchings, gregory.v.rose, jeffrey.t.kirsher, netdev, gospo

From: "Christian Benvenuti (benve)" <benve@cisco.com>
Date: Mon, 26 Sep 2011 15:54:53 -0500

> Does it mean that a Netlink interface becomes official (and backward
> compatibility should not be broken) only once iproute2 starts
> supporting it?

It needs to be analyzed on a case-by-case basis.  Sometimes we can quickly
fix a poorly designed netlink interface is no major tool takes on use of
the feature.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-26 21:00           ` David Miller
@ 2011-09-26 21:19             ` Stephen Hemminger
  2011-09-26 21:27               ` David Miller
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2011-09-26 21:19 UTC (permalink / raw)
  To: David Miller
  Cc: benve, bhutchings, gregory.v.rose, jeffrey.t.kirsher, netdev, gospo

On Mon, 26 Sep 2011 17:00:49 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:

> From: "Christian Benvenuti (benve)" <benve@cisco.com>
> Date: Mon, 26 Sep 2011 15:54:53 -0500
> 
> > Does it mean that a Netlink interface becomes official (and backward
> > compatibility should not be broken) only once iproute2 starts
> > supporting it?
> 
> It needs to be analyzed on a case-by-case basis.  Sometimes we can quickly
> fix a poorly designed netlink interface is no major tool takes on use of
> the feature.

If an interface changes before an official release, there is no
problem. I.e. if an interface goes through multiple versions while
in net-next (or a bug fix during 3.X-rc*) that's fine.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-26 21:19             ` Stephen Hemminger
@ 2011-09-26 21:27               ` David Miller
  0 siblings, 0 replies; 15+ messages in thread
From: David Miller @ 2011-09-26 21:27 UTC (permalink / raw)
  To: shemminger
  Cc: benve, bhutchings, gregory.v.rose, jeffrey.t.kirsher, netdev, gospo

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 26 Sep 2011 14:19:59 -0700

> If an interface changes before an official release, there is no
> problem. I.e. if an interface goes through multiple versions while
> in net-next (or a bug fix during 3.X-rc*) that's fine.

Right.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-09-25  8:23 [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check Jeff Kirsher
  2011-09-25 17:23 ` Stephen Hemminger
@ 2011-11-17 23:39 ` Greg Rose
  2011-11-18  0:40   ` Stephen Hemminger
  1 sibling, 1 reply; 15+ messages in thread
From: Greg Rose @ 2011-11-17 23:39 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: Stephen Hemminger, davem, netdev, gospo



On 9/25/2011 1:23 AM, Jeff Kirsher wrote:
> From: Greg Rose <gregory.v.rose@intel.com>
>
> Add IP link command parsing for VF spoof checking enable/disable
>
> Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

Stephen,

I don't see that this patch was ever applied to your tree.  Was there 
some problem with it that I missed?  Maybe I'm looking at the wrong tree?

Was just wondering...

Regards,

- Greg

> ---
> include/linux/if_link.h | 7 +++++++
> ip/ipaddress.c | 6 ++++++
> ip/iplink.c | 15 +++++++++++++++
> man/man8/ip.8 | 4 +++-
> 4 files changed, 31 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/if_link.h b/include/linux/if_link.h
> index 304c44f..e421f60 100644
> --- a/include/linux/if_link.h
> +++ b/include/linux/if_link.h
> @@ -277,6 +277,7 @@ enum {
> IFLA_VF_MAC, /* Hardware queue specific attributes */
> IFLA_VF_VLAN,
> IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
> + IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
> __IFLA_VF_MAX,
> };
>
> @@ -298,12 +299,18 @@ struct ifla_vf_tx_rate {
> __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
> };
>
> +struct ifla_vf_spoofchk {
> + __u32 vf;
> + __u32 setting;
> +};
> +
> struct ifla_vf_info {
> __u32 vf;
> __u8 mac[32];
> __u32 vlan;
> __u32 qos;
> __u32 tx_rate;
> + __u32 spoofchk;
> };
>
> /* VF ports management section
> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index 85f05a2..7e6ac50 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -197,6 +197,7 @@ static void print_vfinfo(FILE *fp, struct rtattr
> *vfinfo)
> struct ifla_vf_mac *vf_mac;
> struct ifla_vf_vlan *vf_vlan;
> struct ifla_vf_tx_rate *vf_tx_rate;
> + struct ifla_vf_spoofchk *vf_spoofchk;
> struct rtattr *vf[IFLA_VF_MAX+1];
> SPRINT_BUF(b1);
>
> @@ -210,6 +211,7 @@ static void print_vfinfo(FILE *fp, struct rtattr
> *vfinfo)
> vf_mac = RTA_DATA(vf[IFLA_VF_MAC]);
> vf_vlan = RTA_DATA(vf[IFLA_VF_VLAN]);
> vf_tx_rate = RTA_DATA(vf[IFLA_VF_TX_RATE]);
> + vf_spoofchk = RTA_DATA(vf[IFLA_VF_SPOOFCHK]);
>
> fprintf(fp, "\n vf %d MAC %s", vf_mac->vf,
> ll_addr_n2a((unsigned char *)&vf_mac->mac,
> @@ -220,6 +222,10 @@ static void print_vfinfo(FILE *fp, struct rtattr
> *vfinfo)
> fprintf(fp, ", qos %d", vf_vlan->qos);
> if (vf_tx_rate->rate)
> fprintf(fp, ", tx rate %d (Mbps)", vf_tx_rate->rate);
> + if (vf_spoofchk->setting)
> + fprintf(fp, ", spoof checking on");
> + else
> + fprintf(fp, ", spoof checking off");
> }
>
> int print_linkinfo(const struct sockaddr_nl *who,
> diff --git a/ip/iplink.c b/ip/iplink.c
> index e5325a6..f4a5243 100644
> --- a/ip/iplink.c
> +++ b/ip/iplink.c
> @@ -71,7 +71,10 @@ void iplink_usage(void)
> fprintf(stderr, " [ alias NAME ]\n");
> fprintf(stderr, " [ vf NUM [ mac LLADDR ]\n");
> fprintf(stderr, " [ vlan VLANID [ qos VLAN-QOS ] ]\n");
> +
> fprintf(stderr, " [ rate TXRATE ] ] \n");
> +
> + fprintf(stderr, " [ spoofchk { on | off} ] ] \n");
> fprintf(stderr, " [ master DEVICE ]\n");
> fprintf(stderr, " [ nomaster ]\n");
> fprintf(stderr, " ip link show [ DEVICE | group GROUP ]\n");
> @@ -228,6 +231,18 @@ int iplink_parse_vf(int vf, int *argcp, char ***argvp,
> ivt.vf = vf;
> addattr_l(&req->n, sizeof(*req), IFLA_VF_TX_RATE, &ivt, sizeof(ivt));
>
> + } else if (matches(*argv, "spoofchk") == 0) {
> + struct ifla_vf_spoofchk ivs;
> + NEXT_ARG();
> + if (matches(*argv, "on") == 0)
> + ivs.setting = 1;
> + else if (matches(*argv, "off") == 0)
> + ivs.setting = 0;
> + else
> + invarg("Invalid \"spoofchk\" value\n", *argv);
> + ivs.vf = vf;
> + addattr_l(&req->n, sizeof(*req), IFLA_VF_SPOOFCHK, &ivs, sizeof(ivs));
> +
> } else {
> /* rewind arg */
> PREV_ARG();
> diff --git a/man/man8/ip.8 b/man/man8/ip.8
> index 27993a4..cd7b97a 100644
> --- a/man/man8/ip.8
> +++ b/man/man8/ip.8
> @@ -100,7 +100,9 @@ ip \- show / manipulate routing, devices, policy
> routing and tunnels
> .B qos
> .IR VLAN-QOS " ] ] ["
> .B rate
> -.IR TXRATE " ] |"
> +.IR TXRATE " ] ["
> +.B spoofchk { on | off }
> +] |
> .br
> .B master
> .IR DEVICE

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-11-17 23:39 ` Greg Rose
@ 2011-11-18  0:40   ` Stephen Hemminger
  2011-11-18  0:43     ` Greg Rose
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2011-11-18  0:40 UTC (permalink / raw)
  To: Greg Rose; +Cc: Jeff Kirsher, davem, netdev, gospo

On Thu, 17 Nov 2011 15:39:32 -0800
Greg Rose <gregory.v.rose@intel.com> wrote:

> 
> 
> On 9/25/2011 1:23 AM, Jeff Kirsher wrote:
> > From: Greg Rose <gregory.v.rose@intel.com>
> >
> > Add IP link command parsing for VF spoof checking enable/disable
> >
> > Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

I am limiting patches at this point to those that will build against 3.0.
The 3.1 version of iproute2 has not been released because kernel.org tool
to do the release is still in beta (kup), and they are working on it.

After 3.1 version of iproute2 is released, any fixes that require stuff
from 3.2 will go in.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-11-18  0:40   ` Stephen Hemminger
@ 2011-11-18  0:43     ` Greg Rose
  2011-11-18  0:45       ` Stephen Hemminger
  0 siblings, 1 reply; 15+ messages in thread
From: Greg Rose @ 2011-11-18  0:43 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Kirsher, Jeffrey T, davem, netdev, gospo

On 11/17/2011 4:40 PM, Stephen Hemminger wrote:
> On Thu, 17 Nov 2011 15:39:32 -0800
> Greg Rose<gregory.v.rose@intel.com>  wrote:
>
>>
>>
>> On 9/25/2011 1:23 AM, Jeff Kirsher wrote:
>>> From: Greg Rose<gregory.v.rose@intel.com>
>>>
>>> Add IP link command parsing for VF spoof checking enable/disable
>>>
>>> Signed-off-by: Greg Rose<gregory.v.rose@intel.com>
>>> Signed-off-by: Jeff Kirsher<jeffrey.t.kirsher@intel.com>
>
> I am limiting patches at this point to those that will build against 3.0.
> The 3.1 version of iproute2 has not been released because kernel.org tool
> to do the release is still in beta (kup), and they are working on it.
>
> After 3.1 version of iproute2 is released, any fixes that require stuff
> from 3.2 will go in.

Great, sounds good.

Would you prefer that I Jeff (Kirsher) and I repost the patch at that time?

thanks,

- Greg

>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-11-18  0:43     ` Greg Rose
@ 2011-11-18  0:45       ` Stephen Hemminger
  2011-11-18 17:06         ` Greg Rose
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2011-11-18  0:45 UTC (permalink / raw)
  To: Greg Rose; +Cc: Kirsher, Jeffrey T, davem, netdev, gospo

On Thu, 17 Nov 2011 16:43:07 -0800
Greg Rose <gregory.v.rose@intel.com> wrote:

> On 11/17/2011 4:40 PM, Stephen Hemminger wrote:
> > On Thu, 17 Nov 2011 15:39:32 -0800
> > Greg Rose<gregory.v.rose@intel.com>  wrote:
> >
> >>
> >>
> >> On 9/25/2011 1:23 AM, Jeff Kirsher wrote:
> >>> From: Greg Rose<gregory.v.rose@intel.com>
> >>>
> >>> Add IP link command parsing for VF spoof checking enable/disable
> >>>
> >>> Signed-off-by: Greg Rose<gregory.v.rose@intel.com>
> >>> Signed-off-by: Jeff Kirsher<jeffrey.t.kirsher@intel.com>
> >
> > I am limiting patches at this point to those that will build against 3.0.
> > The 3.1 version of iproute2 has not been released because kernel.org tool
> > to do the release is still in beta (kup), and they are working on it.
> >
> > After 3.1 version of iproute2 is released, any fixes that require stuff
> > from 3.2 will go in.
> 
> Great, sounds good.
> 
> Would you prefer that I Jeff (Kirsher) and I repost the patch at that time?

not required, if they show up in patchwork

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check
  2011-11-18  0:45       ` Stephen Hemminger
@ 2011-11-18 17:06         ` Greg Rose
  0 siblings, 0 replies; 15+ messages in thread
From: Greg Rose @ 2011-11-18 17:06 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Kirsher, Jeffrey T, davem, netdev, gospo


On 11/17/2011 4:45 PM, Stephen Hemminger wrote:
> On Thu, 17 Nov 2011 16:43:07 -0800
> Greg Rose<gregory.v.rose@intel.com>  wrote:
>
>> On 11/17/2011 4:40 PM, Stephen Hemminger wrote:
>>> On Thu, 17 Nov 2011 15:39:32 -0800
>>> Greg Rose<gregory.v.rose@intel.com>   wrote:
>>>
>>
>> Would you prefer that I Jeff (Kirsher) and I repost the patch at that time?
>
> not required, if they show up in patchwork

I see it under review in patchwork.

Thanks,

- Greg

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-11-18 17:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-25  8:23 [net-next] iproute2: Add new command to IP link to enable/disable VF spoof check Jeff Kirsher
2011-09-25 17:23 ` Stephen Hemminger
2011-09-26 16:21   ` Rose, Gregory V
2011-09-26 16:41     ` Ben Hutchings
2011-09-26 16:47       ` Stephen Hemminger
2011-09-26 16:58         ` Rose, Gregory V
2011-09-26 20:54         ` Christian Benvenuti (benve)
2011-09-26 21:00           ` David Miller
2011-09-26 21:19             ` Stephen Hemminger
2011-09-26 21:27               ` David Miller
2011-11-17 23:39 ` Greg Rose
2011-11-18  0:40   ` Stephen Hemminger
2011-11-18  0:43     ` Greg Rose
2011-11-18  0:45       ` Stephen Hemminger
2011-11-18 17:06         ` Greg Rose

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.