* [PATCH net-next v2 0/13] net: core: add helper tcp_v6_gso_csum_prep
@ 2020-02-18 19:55 Heiner Kallweit
2020-02-18 19:56 ` [PATCH net-next v2 01/13] " Heiner Kallweit
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Heiner Kallweit @ 2020-02-18 19:55 UTC (permalink / raw)
To: David Miller, Realtek linux nic maintainers, Jay Cliburn,
Chris Snook, Rasesh Mody, Sudarsana Kalluru, GR-Linux-NIC-Dev,
Christian Benvenuti, Govindarajulu Varadarajan, Parvi Kaustubhi,
Jeff Kirsher, Guo-Fu Tseng, Shannon Nelson, Pensando Drivers,
Timur Tabi, Jassi Brar, Ilias Apalodimas, K. Y. Srinivasan,
Haiyang Zhang, Stephen Hemminger, Sasha Levin, Ronak Doshi,
VMware, Inc.
Cc: netdev, Linux Kernel Mailing List, intel-wired-lan, linux-hyperv,
Linux USB Mailing List
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next v2 01/13] net: core: add helper tcp_v6_gso_csum_prep
2020-02-18 19:55 [PATCH net-next v2 0/13] net: core: add helper tcp_v6_gso_csum_prep Heiner Kallweit
@ 2020-02-18 19:56 ` Heiner Kallweit
2020-02-18 20:11 ` [PATCH net-next v2 11/13] hv_netvsc: use new " Heiner Kallweit
2020-02-19 19:22 ` [PATCH net-next v2 0/13] net: core: add " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2020-02-18 19:56 UTC (permalink / raw)
To: David Miller, Realtek linux nic maintainers, Jay Cliburn,
Chris Snook, Rasesh Mody, Sudarsana Kalluru, GR-Linux-NIC-Dev,
Christian Benvenuti, Govindarajulu Varadarajan, Parvi Kaustubhi,
Jeff Kirsher, Guo-Fu Tseng, Shannon Nelson, Pensando Drivers,
Timur Tabi, Jassi Brar, Ilias Apalodimas, K. Y. Srinivasan,
Haiyang Zhang, Stephen Hemminger, Sasha Levin, Ronak Doshi,
VMware, Inc.
Cc: netdev, Linux Kernel Mailing List, intel-wired-lan, linux-hyperv,
Linux USB Mailing List
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 <hkallweit1@gmail.com>
Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next v2 11/13] hv_netvsc: use new helper tcp_v6_gso_csum_prep
2020-02-18 19:55 [PATCH net-next v2 0/13] net: core: add helper tcp_v6_gso_csum_prep Heiner Kallweit
2020-02-18 19:56 ` [PATCH net-next v2 01/13] " Heiner Kallweit
@ 2020-02-18 20:11 ` Heiner Kallweit
2020-02-19 19:22 ` [PATCH net-next v2 0/13] net: core: add " David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Heiner Kallweit @ 2020-02-18 20:11 UTC (permalink / raw)
To: David Miller, K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger,
Sasha Levin
Cc: netdev, Linux Kernel Mailing List, linux-hyperv
Use new helper tcp_v6_gso_csum_prep in additional network drivers.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next v2 0/13] net: core: add helper tcp_v6_gso_csum_prep
2020-02-18 19:55 [PATCH net-next v2 0/13] net: core: add helper tcp_v6_gso_csum_prep Heiner Kallweit
2020-02-18 19:56 ` [PATCH net-next v2 01/13] " Heiner Kallweit
2020-02-18 20:11 ` [PATCH net-next v2 11/13] hv_netvsc: use new " Heiner Kallweit
@ 2020-02-19 19:22 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-02-19 19:22 UTC (permalink / raw)
To: hkallweit1
Cc: nic_swsd, jcliburn, chris.snook, rmody, skalluru,
GR-Linux-NIC-Dev, benve, _govind, pkaustub, jeffrey.t.kirsher,
cooldavid, snelson, drivers, timur, jaswinder.singh,
ilias.apalodimas, kys, haiyangz, sthemmin, sashal, doshir,
pv-drivers, netdev, linux-kernel, intel-wired-lan, linux-hyperv,
linux-usb
From: Heiner Kallweit <hkallweit1@gmail.com>
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-19 19:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 19:55 [PATCH net-next v2 0/13] net: core: add helper tcp_v6_gso_csum_prep Heiner Kallweit
2020-02-18 19:56 ` [PATCH net-next v2 01/13] " Heiner Kallweit
2020-02-18 20:11 ` [PATCH net-next v2 11/13] hv_netvsc: use new " Heiner Kallweit
2020-02-19 19:22 ` [PATCH net-next v2 0/13] net: core: add " David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).