HomeFreeBSD

pf: change pf_rules_lock and pf_ioctl_lock to per-vnet locks

Description

pf: change pf_rules_lock and pf_ioctl_lock to per-vnet locks

Both pf_rules_lock and pf_ioctl_lock only ever affect one vnet, so
there's no point in having these locks affect other vnets.
(In fact, the only lock in pf that can affect multiple vnets is
pf_end_lock.)

That's especially important for the rules lock, because taking the write
lock suspends all network traffic until it's released. This will reduce
the impact a vnet running pf can have on other vnets, and improve
concurrency on machines running multiple pf-enabled vnets.

Reviewed by: zlei
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D39658

Details

Provenance
kpAuthored on Apr 18 2023, 2:06 PM
Reviewer
zlei
Differential Revision
D39658: pf: change pf_rules_lock and pf_ioctl_lock to per-vnet locks
Parents
rG9c9dfbf25698: stress2: Added comment of fixed problem. Enable test
Branches
Unknown
Tags
Unknown