2020-02-18 19:56:47

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 0/13] net: core: add helper tcp_v6_gso_csum_prep

Several network drivers for chips that support TSO6 share the same code
for preparing the TCP header, so let's factor it out to a helper.
A difference is that some drivers reset the payload_len whilst others
don't do this. This value is overwritten by TSO anyway, therefore
the new helper resets it in general.

Heiner Kallweit (13):
net: core: add helper tcp_v6_gso_csum_prep
r8169: use new helper tcp_v6_gso_csum_prep
net: atheros: use new helper tcp_v6_gso_csum_prep
bna: use new helper tcp_v6_gso_csum_prep
enic: use new helper tcp_v6_gso_csum_prep
e1000(e): use new helper tcp_v6_gso_csum_prep
jme: use new helper tcp_v6_gso_csum_prep
ionic: use new helper tcp_v6_gso_csum_prep
net: qcom/emac: use new helper tcp_v6_gso_csum_prep
net: socionext: use new helper tcp_v6_gso_csum_prep
hv_netvsc: use new helper tcp_v6_gso_csum_prep
r8152: use new helper tcp_v6_gso_csum_prep
vmxnet3: use new helper tcp_v6_gso_csum_prep

drivers/net/ethernet/atheros/alx/main.c | 5 +---
.../net/ethernet/atheros/atl1c/atl1c_main.c | 6 ++---
drivers/net/ethernet/brocade/bna/bnad.c | 7 +----
drivers/net/ethernet/cisco/enic/enic_main.c | 3 +--
drivers/net/ethernet/intel/e1000/e1000_main.c | 6 +----
drivers/net/ethernet/intel/e1000e/netdev.c | 5 +---
drivers/net/ethernet/jme.c | 7 +----
.../net/ethernet/pensando/ionic/ionic_txrx.c | 5 +---
drivers/net/ethernet/qualcomm/emac/emac-mac.c | 7 ++---
drivers/net/ethernet/realtek/r8169_main.c | 26 ++-----------------
drivers/net/ethernet/socionext/netsec.c | 6 +----
drivers/net/hyperv/netvsc_drv.c | 5 +---
drivers/net/usb/r8152.c | 26 ++-----------------
drivers/net/vmxnet3/vmxnet3_drv.c | 5 +---
include/net/ip6_checksum.h | 9 +++++++
15 files changed, 27 insertions(+), 101 deletions(-)

--
2.25.1


2020-02-18 20:16:38

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 02/13] r8169: use new helper tcp_v6_gso_csum_prep

Simplify the code by using the new helper tcp_v6_gso_csum_prep.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/ethernet/realtek/r8169_main.c | 26 ++---------------------
1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 5a9143b50..8442b8767 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4108,29 +4108,6 @@ static bool rtl_test_hw_pad_bug(struct rtl8169_private *tp, struct sk_buff *skb)
return skb->len < ETH_ZLEN && tp->mac_version == RTL_GIGA_MAC_VER_34;
}

-/* msdn_giant_send_check()
- * According to the document of microsoft, the TCP Pseudo Header excludes the
- * packet length for IPv6 TCP large packets.
- */
-static int msdn_giant_send_check(struct sk_buff *skb)
-{
- const struct ipv6hdr *ipv6h;
- struct tcphdr *th;
- int ret;
-
- ret = skb_cow_head(skb, 0);
- if (ret)
- return ret;
-
- ipv6h = ipv6_hdr(skb);
- th = tcp_hdr(skb);
-
- th->check = 0;
- th->check = ~tcp_v6_check(0, &ipv6h->saddr, &ipv6h->daddr, 0);
-
- return ret;
-}
-
static void rtl8169_tso_csum_v1(struct sk_buff *skb, u32 *opts)
{
u32 mss = skb_shinfo(skb)->gso_size;
@@ -4163,9 +4140,10 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
break;

case htons(ETH_P_IPV6):
- if (msdn_giant_send_check(skb))
+ if (skb_cow_head(skb, 0))
return false;

+ tcp_v6_gso_csum_prep(skb);
opts[0] |= TD1_GTSENV6;
break;

--
2.25.1


2020-02-18 20:16:43

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 04/13] bna: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/ethernet/brocade/bna/bnad.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index 01a50a4b2..d6588502a 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -2504,12 +2504,7 @@ bnad_tso_prepare(struct bnad *bnad, struct sk_buff *skb)
IPPROTO_TCP, 0);
BNAD_UPDATE_CTR(bnad, tso4);
} else {
- struct ipv6hdr *ipv6h = ipv6_hdr(skb);
-
- ipv6h->payload_len = 0;
- tcp_hdr(skb)->check =
- ~csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, 0,
- IPPROTO_TCP, 0);
+ tcp_v6_gso_csum_prep(skb);
BNAD_UPDATE_CTR(bnad, tso6);
}

--
2.25.1


2020-02-18 20:16:49

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 05/13] enic: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/ethernet/cisco/enic/enic_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index ddf60dc9a..3fc858b2c 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -696,8 +696,7 @@ static void enic_preload_tcp_csum(struct sk_buff *skb)
tcp_hdr(skb)->check = ~csum_tcpudp_magic(ip_hdr(skb)->saddr,
ip_hdr(skb)->daddr, 0, IPPROTO_TCP, 0);
} else if (skb->protocol == cpu_to_be16(ETH_P_IPV6)) {
- 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);
}
}

--
2.25.1


2020-02-18 20:17:06

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 11/13] hv_netvsc: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/hyperv/netvsc_drv.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 65e12cb07..5ee282b20 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -638,10 +638,7 @@ static int netvsc_xmit(struct sk_buff *skb, struct net_device *net, bool xdp_tx)
} else {
lso_info->lso_v2_transmit.ip_version =
NDIS_TCP_LARGE_SEND_OFFLOAD_IPV6;
- 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);
}
lso_info->lso_v2_transmit.tcp_header_offset = skb_transport_offset(skb);
lso_info->lso_v2_transmit.mss = skb_shinfo(skb)->gso_size;
--
2.25.1


2020-02-18 20:17:12

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 13/13] vmxnet3: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/vmxnet3/vmxnet3_drv.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 18f152fa0..722cb054a 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -942,10 +942,7 @@ vmxnet3_prepare_tso(struct sk_buff *skb,
tcph->check = ~csum_tcpudp_magic(iph->saddr, iph->daddr, 0,
IPPROTO_TCP, 0);
} else if (ctx->ipv6) {
- struct ipv6hdr *iph = ipv6_hdr(skb);
-
- tcph->check = ~csum_ipv6_magic(&iph->saddr, &iph->daddr, 0,
- IPPROTO_TCP, 0);
+ tcp_v6_gso_csum_prep(skb);
}
}

--
2.25.1


2020-02-18 20:17:18

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 12/13] r8152: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/usb/r8152.c | 26 ++------------------------
1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 78ddbaf64..709578f4d 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1948,29 +1948,6 @@ static void r8152_csum_workaround(struct r8152 *tp, struct sk_buff *skb,
}
}

-/* msdn_giant_send_check()
- * According to the document of microsoft, the TCP Pseudo Header excludes the
- * packet length for IPv6 TCP large packets.
- */
-static int msdn_giant_send_check(struct sk_buff *skb)
-{
- const struct ipv6hdr *ipv6h;
- struct tcphdr *th;
- int ret;
-
- ret = skb_cow_head(skb, 0);
- if (ret)
- return ret;
-
- ipv6h = ipv6_hdr(skb);
- th = tcp_hdr(skb);
-
- th->check = 0;
- th->check = ~tcp_v6_check(0, &ipv6h->saddr, &ipv6h->daddr, 0);
-
- return ret;
-}
-
static inline void rtl_tx_vlan_tag(struct tx_desc *desc, struct sk_buff *skb)
{
if (skb_vlan_tag_present(skb)) {
@@ -2016,10 +1993,11 @@ static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
break;

case htons(ETH_P_IPV6):
- if (msdn_giant_send_check(skb)) {
+ if (skb_cow_head(skb, 0)) {
ret = TX_CSUM_TSO;
goto unavailable;
}
+ tcp_v6_gso_csum_prep(skb);
opts1 |= GTSENDV6;
break;

--
2.25.1


2020-02-18 20:17:20

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 09/13] net: qcom/emac: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/ethernet/qualcomm/emac/emac-mac.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.c b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
index bebe38d74..251d4ac4a 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-mac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
@@ -1288,11 +1288,8 @@ static int emac_tso_csum(struct emac_adapter *adpt,
memset(tpd, 0, sizeof(*tpd));
memset(&extra_tpd, 0, sizeof(extra_tpd));

- 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);
+
TPD_PKT_LEN_SET(&extra_tpd, skb->len);
TPD_LSO_SET(&extra_tpd, 1);
TPD_LSOV_SET(&extra_tpd, 1);
--
2.25.1


2020-02-18 20:17:25

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 07/13] jme: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/ethernet/jme.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
index 2e4975572..de3c7ce93 100644
--- a/drivers/net/ethernet/jme.c
+++ b/drivers/net/ethernet/jme.c
@@ -2077,12 +2077,7 @@ jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags)
IPPROTO_TCP,
0);
} else {
- struct ipv6hdr *ip6h = ipv6_hdr(skb);
-
- tcp_hdr(skb)->check = ~csum_ipv6_magic(&ip6h->saddr,
- &ip6h->daddr, 0,
- IPPROTO_TCP,
- 0);
+ tcp_v6_gso_csum_prep(skb);
}

return 0;
--
2.25.1


2020-02-18 20:17:44

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 10/13] net: socionext: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/ethernet/socionext/netsec.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index e8224b543..6266926fe 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -1148,11 +1148,7 @@ static netdev_tx_t netsec_netdev_start_xmit(struct sk_buff *skb,
~tcp_v4_check(0, ip_hdr(skb)->saddr,
ip_hdr(skb)->daddr, 0);
} else {
- 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);
}

tx_ctrl.tcp_seg_offload_flag = true;
--
2.25.1


2020-02-18 20:17:58

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 03/13] net: atheros: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/ethernet/atheros/alx/main.c | 5 +----
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 6 ++----
2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index 1dcbc486e..b9b4edb91 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -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;
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 4c0b1f855..0d67b951c 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -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);
--
2.25.1


2020-02-18 20:18:18

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 01/13] net: core: add helper tcp_v6_gso_csum_prep

Several network drivers for chips that support TSO6 share the same code
for preparing the TCP header, so let's factor it out to a helper.
A difference is that some drivers reset the payload_len whilst others
don't do this. This value is overwritten by TSO anyway, therefore
the new helper resets it in general.

Signed-off-by: Heiner Kallweit <[email protected]>
Reviewed-by: Alexander Duyck <[email protected]>
---
include/net/ip6_checksum.h | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
index 7bec95df4..27ec612cd 100644
--- a/include/net/ip6_checksum.h
+++ b/include/net/ip6_checksum.h
@@ -76,6 +76,15 @@ static inline void __tcp_v6_send_check(struct sk_buff *skb,
}
}

+static inline void tcp_v6_gso_csum_prep(struct sk_buff *skb)
+{
+ struct ipv6hdr *ipv6h = ipv6_hdr(skb);
+ struct tcphdr *th = tcp_hdr(skb);
+
+ ipv6h->payload_len = 0;
+ th->check = ~tcp_v6_check(0, &ipv6h->saddr, &ipv6h->daddr, 0);
+}
+
#if IS_ENABLED(CONFIG_IPV6)
static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
{
--
2.25.1


2020-02-18 20:18:20

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 06/13] e1000(e): use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
Reviewed-by: Alexander Duyck <[email protected]>
---
drivers/net/ethernet/intel/e1000/e1000_main.c | 6 +-----
drivers/net/ethernet/intel/e1000e/netdev.c | 5 +----
2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 2bced34c1..f7103356e 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -2715,11 +2715,7 @@ static int e1000_tso(struct e1000_adapter *adapter,
cmd_length = E1000_TXD_CMD_IP;
ipcse = skb_transport_offset(skb) - 1;
} 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);
ipcse = 0;
}
ipcss = skb_network_offset(skb);
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 0f02c7a5e..74379d2e9 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -5461,10 +5461,7 @@ static int e1000_tso(struct e1000_ring *tx_ring, struct sk_buff *skb,
cmd_length = E1000_TXD_CMD_IP;
ipcse = skb_transport_offset(skb) - 1;
} 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);
ipcse = 0;
}
ipcss = skb_network_offset(skb);
--
2.25.1


2020-02-18 20:18:48

by Heiner Kallweit

[permalink] [raw]
Subject: [PATCH net-next v2 08/13] ionic: use new helper tcp_v6_gso_csum_prep

Use new helper tcp_v6_gso_csum_prep in additional network drivers.

Signed-off-by: Heiner Kallweit <[email protected]>
---
drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
index e452f4242..020acc300 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
@@ -632,10 +632,7 @@ static int ionic_tx_tcp_pseudo_csum(struct sk_buff *skb)
ip_hdr(skb)->daddr,
0, IPPROTO_TCP, 0);
} else if (skb->protocol == cpu_to_be16(ETH_P_IPV6)) {
- 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);
}

return 0;
--
2.25.1


2020-02-18 21:51:52

by Jeff Kirsher

[permalink] [raw]
Subject: Re: [PATCH net-next v2 06/13] e1000(e): use new helper tcp_v6_gso_csum_prep

On Tue, 2020-02-18 at 21:05 +0100, Heiner Kallweit wrote:
> Use new helper tcp_v6_gso_csum_prep in additional network drivers.
>
> Signed-off-by: Heiner Kallweit <[email protected]>
> Reviewed-by: Alexander Duyck <[email protected]>

Acked-by: Jeff Kirsher <[email protected]>

> ---
> drivers/net/ethernet/intel/e1000/e1000_main.c | 6 +-----
> drivers/net/ethernet/intel/e1000e/netdev.c | 5 +----
> 2 files changed, 2 insertions(+), 9 deletions(-)


Attachments:
signature.asc (849.00 B)
This is a digitally signed message part

2020-02-18 22:58:00

by Shannon Nelson

[permalink] [raw]
Subject: Re: [PATCH net-next v2 08/13] ionic: use new helper tcp_v6_gso_csum_prep

On 2/18/20 12:07 PM, Heiner Kallweit wrote:
> Use new helper tcp_v6_gso_csum_prep in additional network drivers.
>
> Signed-off-by: Heiner Kallweit <[email protected]>

Acked-by: Shannon Nelson <[email protected]>

> ---
> drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
> index e452f4242..020acc300 100644
> --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
> +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
> @@ -632,10 +632,7 @@ static int ionic_tx_tcp_pseudo_csum(struct sk_buff *skb)
> ip_hdr(skb)->daddr,
> 0, IPPROTO_TCP, 0);
> } else if (skb->protocol == cpu_to_be16(ETH_P_IPV6)) {
> - 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);
> }
>
> return 0;

2020-02-19 04:03:08

by Guo-Fu Tseng

[permalink] [raw]
Subject: Re: [PATCH net-next v2 07/13] jme: use new helper tcp_v6_gso_csum_prep

On Tue, 18 Feb 2020 21:06:11 +0100, Heiner Kallweit wrote
> Use new helper tcp_v6_gso_csum_prep in additional network drivers.
>
> Signed-off-by: Heiner Kallweit <[email protected]>
> ---
> drivers/net/ethernet/jme.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
> index 2e4975572..de3c7ce93 100644
> --- a/drivers/net/ethernet/jme.c
> +++ b/drivers/net/ethernet/jme.c
> @@ -2077,12 +2077,7 @@ jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags)
> IPPROTO_TCP,
> 0);
> } else {
> - struct ipv6hdr *ip6h = ipv6_hdr(skb);
> -
> - tcp_hdr(skb)->check = ~csum_ipv6_magic(&ip6h->saddr,
> - &ip6h->daddr, 0,
> - IPPROTO_TCP,
> - 0);
> + tcp_v6_gso_csum_prep(skb);
> }
>
> return 0;
> --
> 2.25.1
Kallweit:

Looks good to me. Thank you.

Guo-Fu Tseng

2020-02-19 09:49:19

by Hayes Wang

[permalink] [raw]
Subject: RE: [PATCH net-next v2 12/13] r8152: use new helper tcp_v6_gso_csum_prep

Heiner Kallweit [mailto:[email protected]]
> Sent: Wednesday, February 19, 2020 4:13 AM
> Subject: [PATCH net-next v2 12/13] r8152: use new helper
> tcp_v6_gso_csum_prep
>
> Use new helper tcp_v6_gso_csum_prep in additional network drivers.
>
> Signed-off-by: Heiner Kallweit <[email protected]>

Acked-by: Hayes Wang <[email protected]>

Best Regards,
Hayes

2020-02-19 12:38:31

by Ilias Apalodimas

[permalink] [raw]
Subject: Re: [PATCH net-next v2 10/13] net: socionext: use new helper tcp_v6_gso_csum_prep

On Tue, Feb 18, 2020 at 09:09:17PM +0100, Heiner Kallweit wrote:
> Use new helper tcp_v6_gso_csum_prep in additional network drivers.
>
> Signed-off-by: Heiner Kallweit <[email protected]>
> ---
> drivers/net/ethernet/socionext/netsec.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
> index e8224b543..6266926fe 100644
> --- a/drivers/net/ethernet/socionext/netsec.c
> +++ b/drivers/net/ethernet/socionext/netsec.c
> @@ -1148,11 +1148,7 @@ static netdev_tx_t netsec_netdev_start_xmit(struct sk_buff *skb,
> ~tcp_v4_check(0, ip_hdr(skb)->saddr,
> ip_hdr(skb)->daddr, 0);
> } else {
> - 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);
> }
>
> tx_ctrl.tcp_seg_offload_flag = true;
> --
> 2.25.1
>
>

Acked-by: Ilias Apalodimas <[email protected]>

2020-02-19 19:22:24

by David Miller

[permalink] [raw]
Subject: Re: [PATCH net-next v2 0/13] net: core: add helper tcp_v6_gso_csum_prep

From: Heiner Kallweit <[email protected]>
Date: Tue, 18 Feb 2020 20:55:18 +0100

> Several network drivers for chips that support TSO6 share the same code
> for preparing the TCP header, so let's factor it out to a helper.
> A difference is that some drivers reset the payload_len whilst others
> don't do this. This value is overwritten by TSO anyway, therefore
> the new helper resets it in general.

Series applied, thanks Heiner.