]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
dummynet: don't use per-vnet locks to protect global data.
authorKristof Provost <kp@FreeBSD.org>
Thu, 27 Jan 2022 10:41:21 +0000 (11:41 +0100)
committerKristof Provost <kp@FreeBSD.org>
Mon, 7 Feb 2022 21:59:46 +0000 (22:59 +0100)
commit3f3e4f3c7472640aab998612a2253da95102345a
tree0df3f32bffe673a5a294a33dc2a3488e2ffb5185
parent5e8e3020872b759228581fecb07f1f52cf0449e1
dummynet: don't use per-vnet locks to protect global data.

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")
Differential Revision: https://reviews.freebsd.org/D34059
sys/netpfil/ipfw/dn_aqm_pie.c
sys/netpfil/ipfw/dn_sched_fq_pie.c
sys/netpfil/ipfw/ip_dn_private.h
sys/netpfil/ipfw/ip_dummynet.c