freebsd-dev/sys
Hans Petter Selasky 9ca874cf74 Add TCP LRO support for VLAN and VxLAN.
This change makes the TCP LRO code more generic and flexible with regards
to supporting multiple different TCP encapsulation protocols and in general
lays the ground for broader TCP LRO support. The main job of the TCP LRO code is
to merge TCP packets for the same flow, to reduce the number of calls to upper
layers. This reduces CPU and increases performance, due to being able to send
larger TSO offloaded data chunks at a time. Basically the TCP LRO makes it
possible to avoid per-packet interaction by the host CPU.

Because the current TCP LRO code was tightly bound and optimized for TCP/IP
over ethernet only, several larger changes were needed. Also a minor bug was
fixed in the flushing mechanism for inactive entries, where the expire time,
"le->mtime" was not always properly set.

To avoid having to re-run time consuming regression tests for every change,
it was chosen to squash the following list of changes into a single commit:
- Refactor parsing of all address information into the "lro_parser" structure.
  This easily allows to reuse parsing code for inner headers.
- Speedup header data comparison. Don't compare field by field, but
  instead use an unsigned long array, where the fields get packed.
- Refactor the IPv4/TCP/UDP checksum computations, so that they may be computed
  recursivly, only applying deltas as the result of updating payload data.
- Make smaller inline functions doing one operation at a time instead of
  big functions having repeated code.
- Refactor the TCP ACK compression code to only execute once
  per TCP LRO flush. This gives a minor performance improvement and
  keeps the code simple.
- Use sbintime() for all time-keeping. This change also fixes flushing
  of inactive entries.
- Try to shrink the size of the LRO entry, because it is frequently zeroed.
- Removed unused TCP LRO macros.
- Cleanup unused TCP LRO statistics counters while at it.
- Try to use __predict_true() and predict_false() to optimise CPU branch
  predictions.

Bump the __FreeBSD_version due to changing the "lro_ctrl" structure.

Tested by:	Netflix
Reviewed by:	rrs (transport)
Differential Revision:	https://reviews.freebsd.org/D29564
MFC after:	2 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-04-20 13:36:22 +02:00
..
amd64 AMD-vi: Fortify IVHD device_identify process 2021-04-19 16:08:13 +08:00
arm arm: Add no-cftconvert for sdma-imx6 files 2021-04-14 15:43:37 +02:00
arm64 arm64: adjust comments in dbg_monitor_exit() 2021-04-13 14:41:31 -03:00
bsm Add aio_writev and aio_readv 2021-01-02 19:57:58 -07:00
cam cam: make sure to clear even more CCBs allocated on the stack 2021-04-11 15:24:22 +01:00
cddl fbt: Remove some handling for multiple CTF containers 2021-04-02 17:49:13 -04:00
compat linuxkpi: reduce number of stray mm_struct allocations 2021-04-19 21:34:08 +03:00
conf Add the KASAN runtime 2021-04-13 17:42:20 -04:00
contrib [ath_hal] Add get/set NAV functions 2021-04-18 22:52:31 -07:00
crypto ossl: Don't encryt/decrypt too much data for chacha20. 2021-04-01 15:49:07 -07:00
ddb ddb: replace watchpoint set/clear functions 2021-03-29 12:05:44 -03:00
dev e1000: Add support for [Tiger, Alder, Meteor] Lake 2021-04-19 14:32:59 -07:00
dts dts: Bump the freebsd branding version to 5.10 2021-03-23 15:02:21 +01:00
fs nfscommon: fix function name in comment 2021-04-19 20:09:46 -07:00
gdb gdb: report specific stop reason for watchpoints 2021-03-30 11:36:41 -03:00
geom gmirror: Pre-allocate the timeout event structure 2021-03-11 15:45:15 -05:00
gnu Remove the old dts imported tree. 2021-01-15 20:09:55 +01:00
i386 Create VM_MEMATTR_DEVICE on all architectures 2021-04-12 06:15:31 +00:00
isa Remove more remnants of sio(4) 2021-04-07 14:33:02 -04:00
kern sysctl vm.objects: report backing object and swap use 2021-04-19 21:32:01 +03:00
kgssapi opencrypto: Introduce crypto_dispatch_async() 2021-02-08 09:19:19 -05:00
libkern x86: remove gcov kernel support 2021-04-02 15:41:51 +03:00
mips OCF: Remove support for asymmetric cryptographic operations. 2021-04-12 14:28:43 -07:00
modules modules: remove stale if_wg reference 2021-04-15 19:59:13 -05:00
net Improve error reporting in rtsock.c 2021-04-19 20:36:41 +00:00
net80211 net80211: prefix get_random_bytes() with net80211_ 2021-03-24 22:16:09 +00:00
netgraph ng_ubt: Block attachment of uninitialized Intel Wireless 7265 2021-04-15 17:26:32 +03:00
netinet Add TCP LRO support for VLAN and VxLAN. 2021-04-20 13:36:22 +02:00
netinet6 tcp: add support for TCP over UDP 2021-04-18 16:16:42 +02:00
netipsec Revert "SO_RERROR indicates that receive buffer overflows should be handled as errors." 2021-02-08 22:32:32 +00:00
netpfil pf: Refactor state killing 2021-04-20 09:30:23 +02:00
netsmb
nfs Fix panic when using BOOTP to resolve root path. 2021-03-28 14:02:40 -05:00
nfsclient nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nfsserver nfs: Cleanup dead files 2021-03-17 06:16:31 +11:00
nlm
ofed LinuxKPI/OFED: (re)move inetdevice.h implementation 2021-03-30 14:40:46 +00:00
opencrypto OCF: Remove support for asymmetric cryptographic operations. 2021-04-12 14:28:43 -07:00
powerpc opal_console: fix serial console output corruption on powerpc64 2021-04-16 20:10:09 -03:00
riscv ddb: replace watchpoint set/clear functions 2021-03-29 12:05:44 -03:00
rpc nfsv4 client: do the BindConnectionToSession as required 2021-04-11 14:34:57 -07:00
security tcp_input/syncache: acquire only read lock on PCB for SYN,!ACK packets 2021-04-12 08:25:31 -07:00
sys Add TCP LRO support for VLAN and VxLAN. 2021-04-20 13:36:22 +02:00
teken loader: implement framebuffer console 2021-01-02 21:41:36 +02:00
tests Add IPv4 fib lookup performance tests with uniform keys. 2021-03-30 14:32:28 +01:00
tools syscalls.master: Add a new syscall type: RESERVED 2021-01-26 18:27:44 +00:00
ufs b_vflags update requries bufobj lock 2021-04-15 15:47:42 +03:00
vm sysctl vm.objects: report backing object and swap use 2021-04-19 21:32:01 +03:00
x86 amd64: Add MD bits for KASAN 2021-04-13 17:42:20 -04:00
xdr
xen xen: move x86-specific xen_vector_callback_enabled to sys/x86 2021-03-15 14:20:21 +01:00
Makefile