netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 3/3] be2net: Fix PVID tag offload for packets with inline VLAN tag.
@ 2013-04-24 21:53 Ajit Khaparde
  0 siblings, 0 replies; only message in thread
From: Ajit Khaparde @ 2013-04-24 21:53 UTC (permalink / raw)
  To: netdev

BE3 HW in UMC mode could wrongly double tag a packet with PVID
when the packet already has a inlined VLAN tag.
In UMC mode, When HW finds that a packet is already VLAN tagged
PVID should not be inserted into the packet.
To fix this use the FW hack to instruct the HW to skip PVID tagging.

Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 21109b5..1232e91 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -834,6 +834,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
 	u32 start = txq->head, eth_hdr_len;
 	bool dummy_wrb, stopped = false;
 	bool skip_hw_vlan = false;
+	struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
 
 	eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ?
 		VLAN_ETH_HLEN : ETH_HLEN;
@@ -846,6 +847,13 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
 		pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
 	}
 
+	/* If vlan tag is already inlined in the packet, skip HW VLAN
+	 * tagging in UMC mode
+	 */
+	if ((adapter->function_mode & UMC_ENABLED) &&
+	    veh->h_vlan_proto == htons(ETH_P_8021Q))
+			skip_hw_vlan = true;
+
 	/* HW has a bug wherein it will calculate CSUM for VLAN
 	 * pkts even though it is disabled.
 	 * Manually insert VLAN in pkt.
-- 
1.7.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-24 21:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 21:53 [PATCH net 3/3] be2net: Fix PVID tag offload for packets with inline VLAN tag Ajit Khaparde

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).