From ff7b3f731a6a69b73dc0dda985a8f49fa5ecd90b Mon Sep 17 00:00:00 2001 From: Patrick Kelsey Date: Thu, 23 Aug 2018 16:10:28 +0000 Subject: [PATCH] Extend tbrsize heuristic in pfctl(8) to provide a sensible value for higher bandwidth interfaces. The new value is used above 2.5 Gbps, which is the highest standard rate that could be used prior to r338209, so the default behavior for all existing systems should remain the same. The value of 128 chosen is a balance between being big enough to reduce potential precision/quantization effects stemming from frequent bucket refills over small time intervals and being small enough to prevent a greedy driver from burst dequeuing more packets than it has available hardware ring slots for whenever altq transitions from idle to backlogged. Reviewed by: jmallett, kp MFC after: 2 weeks Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D16852 --- sbin/pfctl/pfctl_altq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_altq.c b/sbin/pfctl/pfctl_altq.c index 7e8a846a72b..86e7b15f6f8 100644 --- a/sbin/pfctl/pfctl_altq.c +++ b/sbin/pfctl/pfctl_altq.c @@ -299,8 +299,10 @@ eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw, size = 4; else if (rate <= 200 * 1000 * 1000) size = 8; - else + else if (rate <= 2500 * 1000 * 1000) size = 24; + else + size = 128; size = size * getifmtu(pa->ifname); pa->tbrsize = size; }