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)
Mon, Jul 13, 9:25 AM
Unknown Object (File)
Sat, Jul 4, 10:24 AM
Unknown Object (File)
Fri, Jul 3, 2:51 AM
Unknown Object (File)
Thu, Jul 2, 8:40 PM
Unknown Object (File)
Wed, Jul 1, 6:02 AM
Unknown Object (File)
Jun 16 2026, 3:27 PM
Unknown Object (File)
Jun 11 2026, 9:50 PM
Unknown Object (File)
May 25 2026, 6:47 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