netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid.
@ 2010-10-21 21:30 Jesse Gross
  2010-10-21 21:30 ` [PATCH 2/2] bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL Jesse Gross
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jesse Gross @ 2010-10-21 21:30 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

It is now acceptable to receive vlan tagged packets at any time,
even if CONFIG_VLAN_8021Q is not set.  This means that calling
vlan_hwaccel_do_receive() should not result in BUG() but rather just
behave as if there were no vlan devices configured.

Reported-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
 include/linux/if_vlan.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index e607256..cbd3dcd 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -153,7 +153,8 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
 
 static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb)
 {
-	BUG();
+	if ((*skb)->vlan_tci & VLAN_VID_MASK)
+		(*skb)->pkt_type = PACKET_OTHERHOST;
 	return false;
 }
 #endif
-- 
1.7.1


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

* [PATCH 2/2] bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.
  2010-10-21 21:30 [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid Jesse Gross
@ 2010-10-21 21:30 ` Jesse Gross
  2010-10-22  3:00   ` David Miller
  2010-10-22  0:46 ` [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid Dmitry Kravkov
  2010-10-22  3:00 ` David Miller
  2 siblings, 1 reply; 5+ messages in thread
From: Jesse Gross @ 2010-10-21 21:30 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Some cards don't support changing vlan offloading settings.  Make
Ethtool set_flags return -EINVAL in those cases.

Reported-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
 drivers/net/bnx2.c                |    2 +-
 drivers/net/bnx2x/bnx2x_ethtool.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index bf3c830..062600b 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -7528,7 +7528,7 @@ bnx2_set_flags(struct net_device *dev, u32 data)
 
 	if (!(bp->flags & BNX2_FLAG_CAN_KEEP_VLAN) &&
 	    !(data & ETH_FLAG_RXVLAN))
-		return -EOPNOTSUPP;
+		return -EINVAL;
 
 	rc = ethtool_op_set_flags(dev, data, ETH_FLAG_RXHASH | ETH_FLAG_RXVLAN |
 				  ETH_FLAG_TXVLAN);
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index daefef6..d02ffbd 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -1123,7 +1123,7 @@ static int bnx2x_set_flags(struct net_device *dev, u32 data)
 	}
 
 	if (!(data & ETH_FLAG_RXVLAN))
-		return -EOPNOTSUPP;
+		return -EINVAL;
 
 	if ((data & ETH_FLAG_LRO) && bp->rx_csum && bp->disable_tpa)
 		return -EINVAL;
-- 
1.7.1


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

* RE: [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid.
  2010-10-21 21:30 [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid Jesse Gross
  2010-10-21 21:30 ` [PATCH 2/2] bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL Jesse Gross
@ 2010-10-22  0:46 ` Dmitry Kravkov
  2010-10-22  3:00 ` David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Kravkov @ 2010-10-22  0:46 UTC (permalink / raw)
  To: Jesse Gross, David Miller; +Cc: netdev@vger.kernel.org, Vladislav Zolotarov

Thanks, this solves the problem. 

Tested-by: Dmitry Kravkov <dmitry@broadcom.com>   

-----Original Message-----
From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On Behalf Of Jesse Gross
Sent: Thursday, October 21, 2010 11:31 PM
To: David Miller
Cc: netdev@vger.kernel.org
Subject: [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid.

It is now acceptable to receive vlan tagged packets at any time,
even if CONFIG_VLAN_8021Q is not set.  This means that calling
vlan_hwaccel_do_receive() should not result in BUG() but rather just
behave as if there were no vlan devices configured.

Reported-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
---
 include/linux/if_vlan.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index e607256..cbd3dcd 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -153,7 +153,8 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
 
 static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb)
 {
-	BUG();
+	if ((*skb)->vlan_tci & VLAN_VID_MASK)
+		(*skb)->pkt_type = PACKET_OTHERHOST;
 	return false;
 }
 #endif
-- 
1.7.1

--
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 related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid.
  2010-10-21 21:30 [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid Jesse Gross
  2010-10-21 21:30 ` [PATCH 2/2] bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL Jesse Gross
  2010-10-22  0:46 ` [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid Dmitry Kravkov
@ 2010-10-22  3:00 ` David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-10-22  3:00 UTC (permalink / raw)
  To: jesse; +Cc: netdev

From: Jesse Gross <jesse@nicira.com>
Date: Thu, 21 Oct 2010 14:30:42 -0700

> It is now acceptable to receive vlan tagged packets at any time,
> even if CONFIG_VLAN_8021Q is not set.  This means that calling
> vlan_hwaccel_do_receive() should not result in BUG() but rather just
> behave as if there were no vlan devices configured.
> 
> Reported-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Jesse Gross <jesse@nicira.com>

Applied.

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

* Re: [PATCH 2/2] bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.
  2010-10-21 21:30 ` [PATCH 2/2] bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL Jesse Gross
@ 2010-10-22  3:00   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-10-22  3:00 UTC (permalink / raw)
  To: jesse; +Cc: netdev

From: Jesse Gross <jesse@nicira.com>
Date: Thu, 21 Oct 2010 14:30:43 -0700

> Some cards don't support changing vlan offloading settings.  Make
> Ethtool set_flags return -EINVAL in those cases.
> 
> Reported-by: Ben Hutchings <bhutchings@solarflare.com>
> Signed-off-by: Jesse Gross <jesse@nicira.com>

Applied.

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

end of thread, other threads:[~2010-10-22  3:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-21 21:30 [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid Jesse Gross
2010-10-21 21:30 ` [PATCH 2/2] bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL Jesse Gross
2010-10-22  3:00   ` David Miller
2010-10-22  0:46 ` [PATCH 1/2] vlan: Calling vlan_hwaccel_do_receive() is always valid Dmitry Kravkov
2010-10-22  3:00 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).