Implement TCP send offloading, for now in software only. This is
authorbluhm <bluhm@openbsd.org>
Wed, 10 May 2023 12:07:16 +0000 (12:07 +0000)
committerbluhm <bluhm@openbsd.org>
Wed, 10 May 2023 12:07:16 +0000 (12:07 +0000)
commitc06845b1c3ca93e4e363133d3ad803fb7ba7a70b
treeff8f188dd535281efac7c853dc4265a301659868
parent1445c776537003da3af50dcb553d6875d54c5bab
Implement TCP send offloading, for now in software only.  This is
meant as a fallback if network hardware does not support TSO.  Driver
support is still work in progress.  TCP output generates large
packets.  In IP output the packet is chopped to TCP maximum segment
size.  This reduces the CPU cycles used by pf.  The regular output
could be assisted by hardware later, but pf route-to and IPsec needs
the software fallback in general.
For performance comparison or to workaround possible bugs, sysctl
net.inet.tcp.tso=0 disables the feature.  netstat -s -p tcp shows
TSO counter with chopped and generated packets.
based on work from jan@
tested by jmc@ jan@ Hrvoje Popovski
OK jan@ claudio@
sys/net/pf.c
sys/netinet/in.h
sys/netinet/ip_output.c
sys/netinet/tcp_output.c
sys/netinet/tcp_subr.c
sys/netinet/tcp_usrreq.c
sys/netinet/tcp_var.h
sys/netinet6/ip6_output.c
sys/sys/mbuf.h
usr.bin/netstat/inet.c