diff options
author | Somnath Kotur <somnath.kotur@emulex.com> | 2013-05-26 23:09:06 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-28 07:27:02 +0200 |
commit | 3904dcc4a7af8e28e45a8d123cef3f7653847a51 (patch) | |
tree | 83b4f8d75535503e9680e53ff5a7e6737111cad7 | |
parent | be2net: Pad skb to meet min Tx pkt size in lancer (diff) | |
download | linux-3904dcc4a7af8e28e45a8d123cef3f7653847a51.tar.xz linux-3904dcc4a7af8e28e45a8d123cef3f7653847a51.zip |
be2net: Trim padded packets for Lancer
For padded packets, Lancer computes incorrect checksum. The workaround is
to trim such packets. This workaround is mainly for IPv4 packets.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 26e222f81433..1140a86ff5ea 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -860,10 +860,12 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter, /* For padded packets, BE HW modifies tot_len field in IP header * incorrecly when VLAN tag is inserted by HW. + * For padded packets, Lancer computes incorrect checksum. */ eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ? VLAN_ETH_HLEN : ETH_HLEN; - if (skb->len <= 60 && vlan_tx_tag_present(skb) && + if (skb->len <= 60 && + (lancer_chip(adapter) || vlan_tx_tag_present(skb)) && is_ipv4_pkt(skb)) { ip = (struct iphdr *)ip_hdr(skb); pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len)); |