]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
UBUNTU: SAUCE: {topost} net: hns3: add l4_type check for both ipv4 and ipv6
authorPeng Li <lipeng321@huawei.com>
Fri, 13 Apr 2018 02:05:29 +0000 (10:05 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Jun 2018 18:41:38 +0000 (14:41 -0400)
BugLink: https://bugs.launchpad.net/bugs/1768670
HW supports UDP, TCP and SCTP packets checksum for both ipv4 and
ipv6,  but do not support other type packets checksum for ipv4 or
ipv6.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index 50750adad193b6fdf3a96556b09c7f61fb192334..0ce0d0e4d07a2788ba9831031eacf19e6f647de1 100644 (file)
@@ -2103,11 +2103,11 @@ static void hns3_rx_checksum(struct hns3_enet_ring *ring, struct sk_buff *skb,
                skb->csum_level = 1;
        case HNS3_OL4_TYPE_NO_TUN:
                /* Can checksum ipv4 or ipv6 + UDP/TCP/SCTP packets */
-               if (l3_type == HNS3_L3_TYPE_IPV4 ||
-                   (l3_type == HNS3_L3_TYPE_IPV6 &&
-                    (l4_type == HNS3_L4_TYPE_UDP ||
-                     l4_type == HNS3_L4_TYPE_TCP ||
-                     l4_type == HNS3_L4_TYPE_SCTP)))
+               if ((l3_type == HNS3_L3_TYPE_IPV4 ||
+                    l3_type == HNS3_L3_TYPE_IPV6) &&
+                   (l4_type == HNS3_L4_TYPE_UDP ||
+                    l4_type == HNS3_L4_TYPE_TCP ||
+                    l4_type == HNS3_L4_TYPE_SCTP))
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
                break;
        }