]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
be2net: Trim padded packets for Lancer
authorSomnath Kotur <somnath.kotur@emulex.com>
Sun, 26 May 2013 21:09:06 +0000 (21:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 May 2013 05:27:02 +0000 (22:27 -0700)
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>
drivers/net/ethernet/emulex/benet/be_main.c

index 26e222f8143371ea7bb2f99e7197c81a071fc772..1140a86ff5eab656d5b1b313b8fe08927ed210e7 100644 (file)
@@ -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));