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)
Tue, Jun 16, 3:27 PM
Unknown Object (File)
Thu, Jun 11, 9:50 PM
Unknown Object (File)
Mon, May 25, 6:47 PM
Unknown Object (File)
Sun, May 24, 10:35 PM
Unknown Object (File)
Fri, May 22, 9:58 PM
Unknown Object (File)
Thu, May 21, 7:38 PM
Unknown Object (File)
Apr 29 2026, 3:36 PM
Unknown Object (File)
Apr 29 2026, 3:32 PM

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