diff options
author | Patrick Kelsey <pkelsey@FreeBSD.org> | 2019-02-11 05:17:31 +0000 |
---|---|---|
committer | Patrick Kelsey <pkelsey@FreeBSD.org> | 2019-02-11 05:17:31 +0000 |
commit | 8f2ac656906a7d498bd6784a09ceeed9f953e2ff (patch) | |
tree | 8a08d0989a34b08be16c5324462c0ec5d9820638 /sys/net/altq/altq_hfsc.c | |
parent | 6286a6438e32951be6d5f05291332e14ecefd5c2 (diff) | |
download | src-8f2ac656906a7d498bd6784a09ceeed9f953e2ff.tar.gz src-8f2ac656906a7d498bd6784a09ceeed9f953e2ff.zip |
Reduce the time it takes the kernel to install a new PF config containing a large number of queues
In general, the time savings come from separating the active and
inactive queues lists into separate interface and non-interface queue
lists, and changing the rule and queue tag management from list-based
to hash-bashed.
In HFSC, a linear scan of the class table during each queue destroy
was also eliminated.
There are now two new tunables to control the hash size used for each
tag set (default for each is 128):
net.pf.queue_tag_hashsize
net.pf.rule_tag_hashsize
Reviewed by: kp
MFC after: 1 week
Sponsored by: RG Nets
Differential Revision: https://reviews.freebsd.org/D19131
Notes
Notes:
svn path=/head/; revision=343995
Diffstat (limited to 'sys/net/altq/altq_hfsc.c')
-rw-r--r-- | sys/net/altq/altq_hfsc.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/net/altq/altq_hfsc.c b/sys/net/altq/altq_hfsc.c index 1405849c0fab..5a5f56fcd2fe 100644 --- a/sys/net/altq/altq_hfsc.c +++ b/sys/net/altq/altq_hfsc.c @@ -159,12 +159,11 @@ hfsc_pfattach(struct pf_altq *a) } int -hfsc_add_altq(struct pf_altq *a) +hfsc_add_altq(struct ifnet *ifp, struct pf_altq *a) { struct hfsc_if *hif; - struct ifnet *ifp; - if ((ifp = ifunit(a->ifname)) == NULL) + if (ifp == NULL) return (EINVAL); if (!ALTQ_IS_READY(&ifp->if_snd)) return (ENODEV); @@ -506,6 +505,7 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc, goto err_ret; } } + cl->cl_slot = i; if (flags & HFCF_DEFAULTCLASS) hif->hif_defaultclass = cl; @@ -558,7 +558,7 @@ hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc, static int hfsc_class_destroy(struct hfsc_class *cl) { - int i, s; + int s; if (cl == NULL) return (0); @@ -589,12 +589,7 @@ hfsc_class_destroy(struct hfsc_class *cl) ASSERT(p != NULL); } - for (i = 0; i < HFSC_MAX_CLASSES; i++) - if (cl->cl_hif->hif_class_tbl[i] == cl) { - cl->cl_hif->hif_class_tbl[i] = NULL; - break; - } - + cl->cl_hif->hif_class_tbl[cl->cl_slot] = NULL; cl->cl_hif->hif_classes--; IFQ_UNLOCK(cl->cl_hif->hif_ifq); splx(s); |