HomeFreeBSD

dummynet: Fix schedlist and aqmlist locking

Description

dummynet: Fix schedlist and aqmlist locking

These are global (i.e. shared across vnets) structures, so we need
global lock to protect them. However, we look up entries in these lists
(find_aqm_type(), find_sched_type()) and return them. We must ensure
that the returned structures cannot go away while we are using them.

Resolve this by using NET_EPOCH(). The structures can be safely accessed
under it, and we postpone their cleanup until we're sure they're no
longer used.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30381

(cherry picked from commit 51d73df18e4d120f6f062062c18efae3ed5193a6)

Details

Provenance
kpAuthored on May 21 2021, 12:26 PM
Differential Revision
D30381: dummynet: Fix schedlist and aqmlist locking
Parents
rGc011422b2d77: VNETify dummynet
Branches
Unknown
Tags
Unknown