]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
be2net: fix TSO6/GSO issue causing TX-stall on Lancer/BEx
authorSuresh Reddy <suresh.reddy@broadcom.com>
Wed, 13 Sep 2017 15:12:42 +0000 (11:12 -0400)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Tue, 17 Oct 2017 18:13:10 +0000 (11:13 -0700)
IPv6 TSO requests with extension hdrs are a problem to the
Lancer and BEx chips. Workaround is to disable TSO6 feature
for such packets.

Also in Lancer chips, MSS less than 256 was resulting in TX stall.
Fix this by disabling GSO when MSS less than 256.

Signed-off-by: Suresh Reddy <suresh.reddy@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 822f8565c93949fb2d31502d595c8bc45629c9b7)

Orabug: 26943365

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/ethernet/emulex/benet/be.h
drivers/net/ethernet/emulex/benet/be_main.c

index 2cd832cd8ed4f8cfb81c665690d5d269b34ff5fd..06217049033fedc4a9984e12fcc6ece4f90c09d8 100644 (file)
@@ -924,6 +924,14 @@ static inline bool is_ipv4_pkt(struct sk_buff *skb)
        return skb->protocol == htons(ETH_P_IP) && ip_hdr(skb)->version == 4;
 }
 
+static inline bool is_ipv6_ext_hdr(struct sk_buff *skb)
+{
+       if (ip_hdr(skb)->version == 6)
+               return ipv6_ext_hdr(ipv6_hdr(skb)->nexthdr);
+       else
+               return false;
+}
+
 #define be_error_recovering(adapter)   \
                (adapter->flags & BE_FLAGS_TRY_RECOVERY)
 
index 44e100a0e80b1090f16de5ba6a9896b83b7d2d31..eaadf80a757371486a5152c1a5d67a76a8835cf3 100644 (file)
@@ -5063,6 +5063,20 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
        struct be_adapter *adapter = netdev_priv(dev);
        u8 l4_hdr = 0;
 
+       if (skb_is_gso(skb)) {
+               /* IPv6 TSO requests with extension hdrs are a problem
+                * to Lancer and BE3 HW. Disable TSO6 feature.
+                */
+               if (!skyhawk_chip(adapter) && is_ipv6_ext_hdr(skb))
+                       features &= ~NETIF_F_TSO6;
+
+               /* Lancer cannot handle the packet with MSS less than 256.
+                * Disable the GSO support in such cases
+                */
+               if (lancer_chip(adapter) && skb_shinfo(skb)->gso_size < 256)
+                       features &= ~NETIF_F_GSO_MASK;
+       }
+
        /* The code below restricts offload features for some tunneled and
         * Q-in-Q packets.
         * Offload features for normal (non tunnel) packets are unchanged.