Page MenuHomeFreeBSD

dummynet: don't use per-vnet locks to protect global data.
ClosedPublic

Authored by kp on Jan 27 2022, 10:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 29, 3:36 PM
Unknown Object (File)
Wed, Apr 29, 3:32 PM
Unknown Object (File)
Mon, Apr 27, 3:01 PM
Unknown Object (File)
Fri, Apr 24, 9:22 PM
Unknown Object (File)
Mar 28 2026, 3:14 PM
Unknown Object (File)
Mar 28 2026, 3:10 PM
Unknown Object (File)
Mar 16 2026, 1:35 AM
Unknown Object (File)
Feb 9 2026, 4:32 AM

Details

Summary

The ref_count counter is global (i.e. not per-vnet) so we can't use a
per-vnet lock to protect it. Moreover, in callouts curvnet is not set,
so we'd end up panicing when trying to use DN_BH_WLOCK().

Instead we use the global sched_lock, which is already used when
evaluating ref_count (in unload_dn_aqm()).

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable