diff options
author | Ajit Khaparde <ajit.khaparde@emulex.com> | 2013-04-24 07:53:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-24 19:37:22 -0400 |
commit | d2cb6ce7306997c753976b65bf81495e1efe7074 (patch) | |
tree | a0af739096883f67669024887bd02471f90e4cc4 /drivers/net/ethernet/emulex | |
parent | bc0c3405abbb7d7115df824c0e41422396923c1f (diff) |
be2net: Fix PVID tag offload for packets with inline VLAN tag.
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r-- | 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 21109b59fcfc..1232e9164bf1 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, | |||
834 | u32 start = txq->head, eth_hdr_len; | 834 | u32 start = txq->head, eth_hdr_len; |
835 | bool dummy_wrb, stopped = false; | 835 | bool dummy_wrb, stopped = false; |
836 | bool skip_hw_vlan = false; | 836 | bool skip_hw_vlan = false; |
837 | struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; | ||
837 | 838 | ||
838 | eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ? | 839 | eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ? |
839 | VLAN_ETH_HLEN : ETH_HLEN; | 840 | VLAN_ETH_HLEN : ETH_HLEN; |
@@ -846,6 +847,13 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, | |||
846 | pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len)); | 847 | pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len)); |
847 | } | 848 | } |
848 | 849 | ||
850 | /* If vlan tag is already inlined in the packet, skip HW VLAN | ||
851 | * tagging in UMC mode | ||
852 | */ | ||
853 | if ((adapter->function_mode & UMC_ENABLED) && | ||
854 | veh->h_vlan_proto == htons(ETH_P_8021Q)) | ||
855 | skip_hw_vlan = true; | ||
856 | |||
849 | /* HW has a bug wherein it will calculate CSUM for VLAN | 857 | /* HW has a bug wherein it will calculate CSUM for VLAN |
850 | * pkts even though it is disabled. | 858 | * pkts even though it is disabled. |
851 | * Manually insert VLAN in pkt. | 859 | * Manually insert VLAN in pkt. |