freebsd-dev/sys
Matt Macy 81be655266 iflib: ensure that tx interrupts enabled and cleanups
Doing a 'dd' over iscsi will reliably cause stalls. Tx
cleaning _should_ reliably happen as data is sent.
However, currently if the transmit queue fills it will
wait until the iflib timer (hz/2) runs.

This change causes the the tx taskq thread to be run
if there are completed descriptors.

While here:

- make timer interrupt delay a sysctl

- simplify txd_db_check handling

- comment on INTR types

Background on the change:

Initially doorbell updates were minimized by only writing to the register
on every fourth packet. If txq_drain would return without writing to the
doorbell it scheduled a callout on the next tick to do the doorbell write
to ensure that the write otherwise happened "soon". At that time a sysctl
was added for users to avoid the potential added latency by simply writing
to the doorbell register on every packet. This worked perfectly well for
e1000 and ixgbe ... and appeared to work well on ixl. However, as it
turned out there was a race to this approach that would lockup the ixl MAC.
It was possible for a lower producer index to be written after a higher one.
On e1000 and ixgbe this was harmless - on ixl it was fatal. My initial
response was to add a lock around doorbell writes - fixing the problem but
adding an unacceptable amount of lock contention.

The next iteration was to use transmit interrupts to drive delayed doorbell
writes. If there were no packets in the queue all doorbell writes would be
immediate as the queue started to fill up we could delay doorbell writes
further and further. At the start of drain if we've cleaned any packets we
know we've moved the state machine along and we write the doorbell (an
obvious missing optimization was to skip that doorbell write if db_pending
is zero). This change required that tx interrupts be scheduled periodically
as opposed to just when the hardware txq was full. However, that just leads
to our next problem.

Initially dedicated msix vectors were used for both tx and rx. However, it
was often possible to use up all available vectors before we set up all the
queues we wanted. By having rx and tx share a vector for a given queue we
could halve the number of vectors used by a given configuration. The problem
here is that with this change only e1000 passed the necessary value to have
the fast interrupt drive tx when appropriate.

Reported by: mav@
Tested by: mav@
Reviewed by:    gallatin@
MFC after:      1 month
Sponsored by:   iXsystems
Differential Revision:  https://reviews.freebsd.org/D27683
2021-01-07 14:07:35 -08:00
..
amd64 amd64 nmi handler: fix comment about %ebx 2020-12-27 12:59:33 +02:00
arm Honor the vm page's PG_NODUMP flag on arm and i386. 2021-01-04 16:15:42 -06:00
arm64 arm64 GENERIC: sort to match amd64, to ease comparison 2021-01-07 10:01:48 -05:00
bsm Add aio_writev and aio_readv 2021-01-02 19:57:58 -07:00
cam cam: Remove Giant handling from cam_sim_alloc() 2021-01-03 11:50:31 -05:00
cddl Install dtrace.h and dependencies 2021-01-07 09:26:21 +00:00
compat Regenerate syscall files after addition of aio_writev/aio_readv 2021-01-02 19:57:58 -07:00
conf arm64: enable build of the ipmi module 2021-01-07 15:45:25 -04:00
contrib libprivatezstd: Restrict symbol visibility similar to upstream 2021-01-03 11:26:46 -08:00
crypto armv8crypto: add AES-XTS support 2021-01-07 15:35:20 -04:00
ddb ddb: Display process flags (p_flag and p_flag2) in 'show proc'. 2020-12-31 16:01:52 -08:00
dev iflib: ensure that tx interrupts enabled and cleanups 2021-01-07 14:07:35 -08:00
dts Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
fs Fix vnode locking bug in fuse_vnop_copy_file_range 2021-01-03 11:16:20 -07:00
gdb gdb(4): allow bulk write of registers 2020-12-23 14:37:05 -04:00
geom geom(4): make g_newprovider_event() return if G_P_WITHER is set 2020-12-29 14:29:59 +00:00
gnu ARM64: Port FreeBSD to Nvidia Jetson TX1 and Nano. 2020-12-28 14:12:41 +01:00
i386 Honor the vm page's PG_NODUMP flag on arm and i386. 2021-01-04 16:15:42 -06:00
isa
kern vfs: fix rangelock range in vn_rdwr() for IO_APPEND 2021-01-07 13:37:35 -08:00
kgssapi State kgssapi dependency on xdr. 2020-09-17 22:29:38 +00:00
libkern arc4random(9): Integrate with RANDOM_FENESTRASX push-reseed 2020-10-10 21:48:06 +00:00
mips Handle KDB_WHY_TRAP return on arm and mips 2021-01-02 19:07:04 -04:00
modules arm64: enable build of the ipmi module 2021-01-07 15:45:25 -04:00
net iflib: ensure that tx interrupts enabled and cleanups 2021-01-07 14:07:35 -08:00
net80211 net80211: fix a typo 2020-11-04 12:07:33 +00:00
netgraph Use light-weight versions of routing lookup functions in ng_netflow. 2020-12-26 11:27:38 +00:00
netinet Refactor rt_addrmsg() and rt_routemsg(). 2021-01-07 19:38:19 +00:00
netinet6 Refactor rt_addrmsg() and rt_routemsg(). 2021-01-07 19:38:19 +00:00
netipsec Trigger soft lifetime expiration on sequence number 2020-10-16 11:27:01 +00:00
netpfil pfctl: Stop sharing pf_ruleset.c with the kernel 2021-01-05 23:35:37 +01:00
netsmb net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
nfs nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsclient nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsserver nfs: Mark unused statistics variable as reserved 2020-11-18 04:35:49 +00:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed Fix for referencing file via its vnode in ibore. 2020-11-02 10:44:29 +00:00
opencrypto Remove the cloned file descriptors for /dev/crypto. 2020-11-25 00:10:54 +00:00
powerpc powerpc: Fix copyin/copyout race condition 2020-12-30 23:45:44 +01:00
riscv Skip the vm.pmap.kernel_maps sysctl by default. 2020-12-18 20:41:23 +00:00
rpc Add a new "tlscertname" NFS mount option. 2020-12-23 13:42:55 -08:00
security cache: combine fast path enabled status into one flag 2021-01-06 07:28:06 +00:00
sys vfs: add vn_seqc_read_notmodify 2021-01-06 07:28:07 +00:00
teken loader: implement framebuffer console 2021-01-02 21:41:36 +02:00
tests Add small tool to invoke kernel test framework tests. 2020-09-02 09:20:40 +00:00
tools sys/tools: Add a tool for generating arm and arm64 kernel images. 2020-12-30 13:22:04 +01:00
ufs vfs: add v_irflag accessors 2021-01-03 06:50:06 +00:00
vm uma: Avoid unmapping direct-mapped slabs 2021-01-03 11:50:31 -05:00
x86 x86: stop punishing VMs with low priority for TSC timecounter 2020-12-23 12:45:15 +02:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen xen: allow limiting the amount of duplicated pending xenstore watches 2020-12-30 11:18:26 +01:00
Makefile