freebsd-nq/sys
Eric Joyner 45818bf1a0 iflib: Stop interface before (un)registering VLAN
This patch is intended to solve a specific problem that iavf(4)
encounters, but what it does can be extended to solve other issues.

To summarize the iavf(4) issue, if the PF driver configures VLAN
anti-spoof, then the VF driver needs to make sure no untagged traffic is
sent if a VLAN is configured, and vice-versa. This can be an issue when
a VLAN is being registered or unregistered, e.g. when a packet may be on
the ring with a VLAN in it, but the VLANs are being unregistered. This
can cause that tagged packet to go out and cause an MDD event.

To fix this, include a new interface-dependent function that drivers can
implement named IFDI_NEEDS_RESTART(). Right now, this function is called
in iflib_vlan_unregister/register() to determine whether the interface
needs to be stopped and started when a VLAN is registered or
unregistered. The default return value of IFDI_NEEDS_RESTART() is true,
so this fixes the MDD problem that iavf(4) encounters, since the
interface rings are flushed during a stop/init.

A future change to iavf(4) will implement that function just in case the
default value changes, and to make it explicit that this interface reset
is required when a VLAN is added or removed.

Reviewed by:	gallatin@
MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D22086
2020-04-27 22:02:44 +00:00
..
amd64 Remove an obsolete TODO comment from several minidump implementations. 2020-04-24 18:47:42 +00:00
arm Convert arm's physmem interface to MI code 2020-04-19 00:12:30 +00:00
arm64 arm64: rockchip: rk805: Use a tailq for the attached regulator 2020-04-25 15:34:48 +00:00
bsm bsm: add AUE_CLOSERANGE 2020-04-24 01:27:25 +00:00
cam Don't pass a user buffer pointer as the data pointer in a CCB. 2020-04-21 23:38:54 +00:00
cddl Avoid the GEOM topology lock recursion when we automatically expand a pool. 2020-04-25 21:45:31 +00:00
compat sysent: re-roll after 360236 (AUE_CLOSERANGE used) 2020-04-24 01:30:33 +00:00
conf Retire the GENERICSF kernel config. 2020-04-27 21:51:22 +00:00
contrib Convert ipfilter to the new routing KPI. 2020-04-19 17:01:17 +00:00
crypto ccp: add a new hardware ID, found on AMD Ryzen 3 3200U 2020-04-24 10:20:54 +00:00
ddb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
dev Don't run strcmp() against strings stored in user memory. 2020-04-27 18:04:42 +00:00
dts allwinner: aw_thermal: Cope with DTS changes 2020-04-14 19:05:17 +00:00
fs Call pipeselwakeup() after toggling PIPE_EOF. 2020-04-27 15:59:07 +00:00
gdb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
geom Add g_topology_locked() macro that returns true if we already hold the GEOM 2020-04-25 21:41:09 +00:00
gnu dts: Import DTS from Linux 5.6 2020-04-14 18:57:00 +00:00
i386 Remove an obsolete TODO comment from several minidump implementations. 2020-04-24 18:47:42 +00:00
isa sc(4) md bits: stop setting sc->kbd entirely 2019-12-30 02:07:55 +00:00
kern Improve MACHINE_ARCH handling for hard vs soft-float on RISC-V. 2020-04-27 17:55:40 +00:00
kgssapi Remove support for Kernel GSS algorithms deprecated in r348875. 2020-04-10 23:08:41 +00:00
libkern Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
mips Fix a race in pmap_emulate_modified(). 2020-04-24 21:21:49 +00:00
modules More fixes to build the kernel with a compiler that defaults to -fno-common 2020-04-18 12:54:40 +00:00
net iflib: Stop interface before (un)registering VLAN 2020-04-27 22:02:44 +00:00
net80211 Don't indirect user pointers directly in two 802.11s ioctls. 2020-04-24 22:10:02 +00:00
netgraph ng_eiface: fix kernel panic due to the racecondition in ng_eiface shutdown. 2020-04-27 10:00:46 +00:00
netinet This change does a small prepratory step in getting the 2020-04-27 16:30:29 +00:00
netinet6 Convert debugnet to the new routing KPI. 2020-04-26 18:42:38 +00:00
netipsec Fix name of 3DES cipher in deprecation warning. 2020-04-22 21:03:24 +00:00
netpfil pf: Virtualise pf_frag_mtx 2020-04-26 16:30:00 +00:00
netsmb Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs Re-organize the NFS file handle affinity code for the NFS server. 2020-04-14 00:01:26 +00:00
nfsclient
nfsserver
nlm Make nfslockd depend on xdr. 2020-04-23 09:37:22 +00:00
ofed Convert OFED rtable interactions to the new routing KPI. 2020-04-15 13:06:55 +00:00
opencrypto Retire the CRYPTO_F_IV_GENERATE flag. 2020-04-20 22:24:49 +00:00
powerpc Remove an obsolete TODO comment from several minidump implementations. 2020-04-24 18:47:42 +00:00
riscv Retire the GENERICSF kernel config. 2020-04-27 21:51:22 +00:00
rpc Split XDR into separate kernel module. Make krpc depend on xdr. 2020-04-17 06:04:20 +00:00
security audit_canon_path_vp: don't panic if cdir == NULL 2020-04-17 02:09:31 +00:00
sys Extend support in sysctls for supporting multiple native ABIs. 2020-04-27 17:53:38 +00:00
teken
tests Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
tools vfs: stop null checking routines in vop wrappers 2020-01-26 00:41:38 +00:00
ufs Retire two unused background fsck sysctls. 2020-04-21 17:42:32 +00:00
vm Use a single VM object for kernel stacks. 2020-04-26 20:08:57 +00:00
x86 Fix handling of NMIs from unknown sources (BMC, hypervisor) 2020-04-26 00:41:29 +00:00
xdr Split XDR into separate kernel module. Make krpc depend on xdr. 2020-04-17 06:04:20 +00:00
xen Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (16 of many) 2020-02-25 19:04:39 +00:00
Makefile Remove sparc64 kernel support 2020-02-03 17:35:11 +00:00