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

Details

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