Skip to contentSkip to conversation

vlan: Calling vlan_hwaccel_do_receive() is always valid.

PATCH Applied Jesse Gross 3 participants 5 messages Oct 21, 2010 – Oct 22, 2010

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

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.

---
 include/linux/if_vlan.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/if_vlan.h +2 -1
index e607256..cbd3dcd 100644
@@ -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
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/2 bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.

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

---
 drivers/net/bnx2.c                |    2 +-
 drivers/net/bnx2x/bnx2x_ethtool.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/bnx2.c +1 -1
index bf3c830..062600b 100644
@@ -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);
drivers/net/bnx2x/bnx2x_ethtool.c +1 -1
index daefef6..d02ffbd 100644
@@ -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;
Signature · 1 line
1.7.1
Tested-by on v1 1/2
#3 lore raw
In reply to Jesse Gross

Thanks, this solves the problem.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jesse Gross
Sent: Thursday, October 21, 2010 11:31 PM
To: David Miller
Cc: [email protected]
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.

---
 include/linux/if_vlan.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
include/linux/if_vlan.h +2 -1
index e607256..cbd3dcd 100644
@@ -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
Signature · 6 lines
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer Applied
#4 lore raw
In reply to Jesse Gross

From: Jesse Gross <[email protected]>
Date: Thu, 21 Oct 2010 14:30:42 -0700

Quoted 7 lines

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.

Applied.