freebsd-dev/sys
Andriy Gapon 1bfdb812c7 iflib_stop: drain rx tasks to prevent any data races
iflib_stop modifies iflib data structures that are used by _task_fn_rx,
most prominently the free lists.  So, iflib_stop has to ensure that the
rx task threads are not active.

This should help to fix a crash seen when iflib_if_ioctl (e.g.,
SIOCSIFCAP) is called while there is already traffic flowing.

The crash has been seen on VMWare guests with vmxnet3 driver.

My guess is that on physical hardware the couple of 1ms delays that
iflib_stop has after disabling interrupts are enough for the queued work
to be completed before any iflib state is touched.

But on busy hypervisors the guests might not get enough CPU time to
complete the work, thus there can be a race between the taskqueue
threads and the work done to handle an ioctl, specifically in iflib_stop
and iflib_init_locked.

PR:		259458
Reviewed by:	markj
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D32926
2021-11-19 10:00:38 +02:00
..
amd64 freebsd32: remove redundant no-arg syscalls 2021-11-17 20:12:24 +00:00
arm Fix typo on "Celsius" 2021-11-18 23:05:32 -07:00
arm64 freebsd32: remove redundant no-arg syscalls 2021-11-17 20:12:24 +00:00
bsm
cam sddadone: 'error' gets assigned only errno codes, never MMC_ERR codes 2021-11-13 11:20:14 +02:00
cddl
compat LinuxKPI: make bcd.h use libkern 2021-11-18 23:10:34 +00:00
conf kmod_syms.awk: fix removal of the export list from the symbol table 2021-11-18 15:56:24 +02:00
contrib zfs: merge openzfs/zfs@269b5dadc (master) into main 2021-11-17 09:39:40 +01:00
crypto aesni: Avoid a potential out-of-bounds load in AES_GCM_encrypt() 2021-11-16 13:30:22 -05:00
ddb
dev Fix 'take effect' spelling in menus and comments. 2021-11-18 23:22:12 -07:00
dts add rk3328 overlay for enabling analog sound 2021-11-13 11:09:23 +02:00
fs ext2fs: check for eh_depth in ext4_ext_check_header() 2021-11-18 09:54:42 -08:00
gdb
geom geom: Remove g_class.config 2021-11-18 23:17:07 -07:00
gnu
i386 Add a COMPAT_FREEBSD13 kernel option 2021-11-17 03:08:40 +01:00
isa
kern Correct the name of the second parameter of biowait to wmesg 2021-11-18 23:26:33 -07:00
kgssapi
libkern
mips Add a COMPAT_FREEBSD13 kernel option 2021-11-17 03:08:40 +01:00
modules Fix some modules to export more used symbols 2021-11-18 15:56:23 +02:00
net iflib_stop: drain rx tasks to prevent any data races 2021-11-19 10:00:38 +02:00
net80211 net80211: radiotap add another define 2021-11-18 14:59:04 +00:00
netgraph Add ETHER_ALIGN support to ng_device(4). 2021-11-14 13:37:41 +01:00
netinet Add tcp_freecb() - single place to free tcpcb. 2021-11-18 20:27:45 -08:00
netinet6 in6_rmx: remove unnecessary TCP includes 2021-11-18 00:54:29 -08:00
netipsec sctp: Remove now-unneeded mb_unmapped_to_ext() calls 2021-11-16 13:38:09 -05:00
netpfil ipfw: remove unnecessary TCP related includes 2021-11-18 00:54:28 -08:00
netsmb
nfs kernel: partially revert e9efb1125a15, default inet mask 2021-11-14 14:12:25 -06:00
nfsclient
nfsserver
nlm
ofed
opencrypto ktls: Split encrypt vs decrypt OCF counters. 2021-11-16 09:58:52 -08:00
powerpc Add a COMPAT_FREEBSD13 kernel option 2021-11-17 03:08:40 +01:00
riscv Add a COMPAT_FREEBSD13 kernel option 2021-11-17 03:08:40 +01:00
rpc mbuf: Only allow extpg mbufs if the system has a direct map 2021-11-16 13:31:04 -05:00
security
sys Correct the name of the second parameter of biowait to wmesg 2021-11-18 23:26:33 -07:00
teken
tests
tools makesyscalls: make strip_abi_prefix more robust 2021-11-17 20:12:21 +00:00
ufs ffs: fix newly introduced LOR between mntfs vnode lock and topology lock 2021-11-16 20:01:31 +02:00
vm ommap: fix signed len and pos arguments 2021-11-15 18:34:28 +00:00
x86 x86: Implement deferred TSC calibration 2021-11-15 16:13:24 -05:00
xdr
xen xen/privcmd: fix MMAP_RESOURCE ioctl to copy out results 2021-11-18 09:46:44 +01:00
Makefile