net: atheros: use new helper tcp_v6_gso_csum_prep
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 18 Feb 2020 19:59:55 +0000 (20:59 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Feb 2020 19:20:59 +0000 (11:20 -0800)
Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/atheros/alx/main.c
drivers/net/ethernet/atheros/atl1c/atl1c_main.c

index 1dcbc486eca90deb14967fc8606e0cfac67d01df..b9b4edb913c1317ddeca47354786f85964bab979 100644 (file)
@@ -1416,10 +1416,7 @@ static int alx_tso(struct sk_buff *skb, struct alx_txd *first)
                                                         0, IPPROTO_TCP, 0);
                first->word1 |= 1 << TPD_IPV4_SHIFT;
        } else if (skb_is_gso_v6(skb)) {
-               ipv6_hdr(skb)->payload_len = 0;
-               tcp_hdr(skb)->check = ~csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
-                                                      &ipv6_hdr(skb)->daddr,
-                                                      0, IPPROTO_TCP, 0);
+               tcp_v6_gso_csum_prep(skb);
                /* LSOv2: the first TPD only provides the packet length */
                first->adrl.l.pkt_len = skb->len;
                first->word1 |= 1 << TPD_LSO_V2_SHIFT;
index 4c0b1f8551dd89acc12c6958eb867a9a83579ad5..0d67b951c0b2dd7d9c1c0238f1090b7dff716247 100644 (file)
@@ -2025,10 +2025,8 @@ static int atl1c_tso_csum(struct atl1c_adapter *adapter,
                                                "IPV6 tso with zero data??\n");
                                goto check_sum;
                        } else
-                               tcp_hdr(skb)->check = ~csum_ipv6_magic(
-                                               &ipv6_hdr(skb)->saddr,
-                                               &ipv6_hdr(skb)->daddr,
-                                               0, IPPROTO_TCP, 0);
+                               tcp_v6_gso_csum_prep(skb);
+
                        etpd->word1 |= 1 << TPD_LSO_EN_SHIFT;
                        etpd->word1 |= 1 << TPD_LSO_VER_SHIFT;
                        etpd->pkt_len = cpu_to_le32(skb->len);