opnsense-src/sys/net
Mark Johnston 010ca539cb pf: Stop using net_epoch to synchronize access to eth rules
Commit 20c4899a8e modified pf_test_eth_rule() to not acquire the
rules read lock, so pf_commit_eth() was changed to wait until the
now-inactive rules are no longer in use before freeing them.  In
particular, it uses the net_epoch to schedule callbacks once the
inactive rules are no longer visible to packet processing threads.

However, since commit 812839e5aa, pf_test_eth_rule() acquires the
rules read lock, so this deferred action is unneeded.  This patch
reverts a portion of 20c4899a8e such that we avoid using deferred
callbacks to free inactive rules.

The main motivation is performance: epoch_drain_callbacks() is quite
slow, especially on busy systems, and its use in the DIOCXBEGIN handler
in particular causes long stalls in relayd when reloading configuration.

Reviewed by:	kp
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D48822

(cherry picked from commit 7a66b3008693ce61957e8b2a3d99829063e1e4af)
2025-02-24 11:17:38 +01:00
..
altq altq: Stop checking for failures from malloc(M_WAITOK) 2024-09-30 11:51:38 +02:00
route routing: Use NULL for VNET_SYS[UN]INIT's last arg, which is a pointer type 2024-12-16 09:16:59 +01:00
bpf.c kern: Make fileops and filterops tables const where possible 2024-12-11 10:20:24 +01:00
bpf.h bpf: Some style and white space cleanup 2024-09-25 07:59:21 +02:00
bpf_buffer.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
bpf_buffer.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
bpf_filter.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
bpf_jitter.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
bpf_jitter.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
bpf_zerocopy.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
bpf_zerocopy.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
bpfdesc.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
bridgestp.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
bridgestp.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
debugnet.c debugnet: Use precise types when accessing mbuf contents 2024-10-24 10:18:59 +02:00
debugnet.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
debugnet_inet.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
debugnet_int.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
dlt.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ethernet.h Teach if_smsc to get MAC from bootargs. 2023-12-28 15:40:31 +01:00
firewire.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee8023ad_lacp.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
ieee8023ad_lacp.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ieee_oui.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if.c ifnet: Assert that we are assigning network stack correctly 2024-11-04 08:10:02 +01:00
if.h ifnet: Add handling for toggling IFF_ALLMULTI in ifhwioctl() 2024-09-23 12:25:52 +02:00
if_arp.h Support ARP for 802 networks 2024-04-27 10:45:22 -04:00
if_bridge.c if_bridge: Mask MEXTPG if some members don't support it 2024-11-11 15:17:09 +01:00
if_bridgevar.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if_clone.c if_clone: Allow maxunit to be zero 2024-08-09 08:31:52 +02:00
if_clone.h if_clone: Allow maxunit to be zero 2024-08-09 08:31:52 +02:00
if_dead.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
if_disc.c net: Remove unneeded NULL check for the allocated ifnet 2024-07-15 09:14:32 +02:00
if_dl.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
if_edsc.c net: Remove unneeded NULL check for the allocated ifnet 2024-07-15 09:14:32 +02:00
if_enc.c if_enc(4): Use new KPI to create enc interface 2024-10-24 10:22:48 +02:00
if_enc.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if_epair.c net: Remove unneeded NULL check for the allocated ifnet 2024-07-15 09:14:32 +02:00
if_ethersubr.c pfil: PFIL_PASS never frees the mbuf 2024-07-18 13:13:55 +02:00
if_fwsubr.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if_gif.c bpf: Make BPF interop consistent with if_loop 2024-06-03 11:06:56 +02:00
if_gif.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
if_gre.c bpf: Make BPF interop consistent with if_loop 2024-06-03 11:06:56 +02:00
if_gre.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
if_infiniband.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
if_ipsec.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
if_ipsec.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if_lagg.c lagg: Fix a teardown race 2024-07-15 09:14:42 +02:00
if_lagg.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if_llatbl.c if_llatbl: Fix a typo in a KASSERT message 2024-01-25 07:47:31 +01:00
if_llatbl.h sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
if_llc.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
if_loop.c net: Remove unneeded NULL check for the allocated ifnet 2024-07-15 09:14:32 +02:00
if_me.c bpf: Make BPF interop consistent with if_loop 2024-06-03 11:06:56 +02:00
if_media.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
if_media.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
if_mib.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if_mib.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if_ovpn.c if_ovpn: improve reconnect handling 2025-01-08 08:49:53 +01:00
if_ovpn.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
if_pflog.h pflog: pass the action to pflog directly 2024-09-30 10:23:55 +02:00
if_pfsync.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
if_private.h IfAPI: Hide the macros that touch ifnet members 2023-04-24 09:54:23 -04:00
if_stf.c net: Remove unneeded NULL check for the allocated ifnet 2024-07-15 09:14:32 +02:00
if_stf.h if_stf: make if_stf.h self-contained 2021-12-17 12:38:34 +01:00
if_strings.h ifnet: fix if_strings.h build check 2023-06-16 15:54:29 +00:00
if_tap.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
if_tun.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if_tuntap.c kern: Make fileops and filterops tables const where possible 2024-12-11 10:20:24 +01:00
if_types.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
if_var.h ifnet: Remove if_getamcount() 2024-09-23 12:24:05 +02:00
if_vlan.c if_vlan: handle VID conflicts 2024-10-18 09:38:57 +02:00
if_vlan_var.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
if_vxlan.c net: Remove unneeded NULL check for the allocated ifnet 2024-07-15 09:14:32 +02:00
if_vxlan.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
ifdi_if.m iflib: invert default restart on VLAN changes 2023-08-24 13:48:19 -07:00
iflib.c iflib: Set the NUMA domain in receive packet headers 2024-12-23 14:57:19 +01:00
iflib.h iflib: Add subinterface interrupt allocation function 2024-04-24 15:14:48 -07:00
ifq.c IfAPI: Explicitly include <net/if_private.h> in netstack 2023-01-31 15:02:16 -05:00
ifq.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
infiniband.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mp_ring.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
mp_ring.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mppc.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mppcc.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
mppcd.c sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
netisr.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
netisr.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
netisr_internal.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
netmap.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
netmap_legacy.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
netmap_user.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
netmap_virt.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
paravirt.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
pfil.c pfil: PFIL_PASS never frees the mbuf 2024-07-18 13:13:55 +02:00
pfil.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
pfkeyv2.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
pfvar.h pf: Stop using net_epoch to synchronize access to eth rules 2025-02-24 11:17:38 +01:00
ppp_defs.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
radix.c sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
radix.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
rndis.h sys: Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:24 -06:00
route.c sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
route.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
rss_config.c rss: add sysctl enable toggle 2024-06-03 11:06:55 +02:00
rss_config.h rss: add sysctl enable toggle 2024-06-03 11:06:55 +02:00
rtsock.c rtsock: Use NULL for VNET_SYS[UN]INIT's last arg, which is a pointer type 2024-12-16 09:18:13 +01:00
sff8436.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
sff8472.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
slcompress.c sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
slcompress.h sys: Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:18 -06:00
toeplitz.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
toeplitz.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00
vnet.c vnet: (read) lock the vnet list while iterating it 2023-12-14 12:20:25 +01:00
vnet.h sys: Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:11 -06:00