be2net: Remove an incorrect pvid check in Tx
To work-around a HW bug that corrupts certain packets while inserting a pvid, the driver needs to invoke a special hack in firmware to avoid the VLAN tagging in the HW. Since this logic is missing from the driver, removing the check for pvid. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
60d509fa6a
commit
1297f9db4f
@@ -626,11 +626,6 @@ static inline u16 be_get_tx_vlan_tag(struct be_adapter *adapter,
|
|||||||
return vlan_tag;
|
return vlan_tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int be_vlan_tag_chk(struct be_adapter *adapter, struct sk_buff *skb)
|
|
||||||
{
|
|
||||||
return vlan_tx_tag_present(skb) || adapter->pvid;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr,
|
static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr,
|
||||||
struct sk_buff *skb, u32 wrb_cnt, u32 len)
|
struct sk_buff *skb, u32 wrb_cnt, u32 len)
|
||||||
{
|
{
|
||||||
@@ -781,11 +776,10 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
|
|||||||
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;
|
||||||
|
|
||||||
/* HW has a bug which considers padding bytes as legal
|
/* For padded packets, BE HW modifies tot_len field in IP header
|
||||||
* and modifies the IPv4 hdr's 'tot_len' field
|
* incorrecly when VLAN tag is inserted by HW.
|
||||||
*/
|
*/
|
||||||
if (skb->len <= 60 && be_vlan_tag_chk(adapter, skb) &&
|
if (skb->len <= 60 && vlan_tx_tag_present(skb) && is_ipv4_pkt(skb)) {
|
||||||
is_ipv4_pkt(skb)) {
|
|
||||||
ip = (struct iphdr *)ip_hdr(skb);
|
ip = (struct iphdr *)ip_hdr(skb);
|
||||||
pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
|
pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
|
||||||
}
|
}
|
||||||
@@ -795,7 +789,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb,
|
|||||||
* Manually insert VLAN in pkt.
|
* Manually insert VLAN in pkt.
|
||||||
*/
|
*/
|
||||||
if (skb->ip_summed != CHECKSUM_PARTIAL &&
|
if (skb->ip_summed != CHECKSUM_PARTIAL &&
|
||||||
be_vlan_tag_chk(adapter, skb)) {
|
vlan_tx_tag_present(skb)) {
|
||||||
skb = be_insert_vlan_in_pkt(adapter, skb);
|
skb = be_insert_vlan_in_pkt(adapter, skb);
|
||||||
if (unlikely(!skb))
|
if (unlikely(!skb))
|
||||||
goto tx_drop;
|
goto tx_drop;
|
||||||
|
Reference in New Issue
Block a user