Commit d2cb6ce7 authored by Ajit Khaparde's avatar Ajit Khaparde Committed by David S. Miller

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: default avatarAjit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc0c3405
...@@ -834,6 +834,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, ...@@ -834,6 +834,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
u32 start = txq->head, eth_hdr_len; u32 start = txq->head, eth_hdr_len;
bool dummy_wrb, stopped = false; bool dummy_wrb, stopped = false;
bool skip_hw_vlan = false; bool skip_hw_vlan = false;
struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ? eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ?
VLAN_ETH_HLEN : ETH_HLEN; VLAN_ETH_HLEN : ETH_HLEN;
...@@ -846,6 +847,13 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, ...@@ -846,6 +847,13 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len)); 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 /* HW has a bug wherein it will calculate CSUM for VLAN
* pkts even though it is disabled. * pkts even though it is disabled.
* Manually insert VLAN in pkt. * Manually insert VLAN in pkt.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment