Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/altq altq: fix CBQ with RED and/or pf
details: https://anonhg.NetBSD.org/src/rev/529fcb141175
branches: trunk
changeset: 1022482:529fcb141175
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Wed Jul 21 07:34:44 2021 +0000
description:
altq: fix CBQ with RED and/or pf
diffstat:
sys/altq/altq_cbq.c | 9 +++++----
sys/altq/altq_rmclass.c | 6 +++---
2 files changed, 8 insertions(+), 7 deletions(-)
diffs (71 lines):
diff -r b87c72d62d8c -r 529fcb141175 sys/altq/altq_cbq.c
--- a/sys/altq/altq_cbq.c Wed Jul 21 06:49:25 2021 +0000
+++ b/sys/altq/altq_cbq.c Wed Jul 21 07:34:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_cbq.c,v 1.35 2021/07/21 06:33:30 ozaki-r Exp $ */
+/* $NetBSD: altq_cbq.c,v 1.36 2021/07/21 07:34:44 ozaki-r Exp $ */
/* $KAME: altq_cbq.c,v 1.21 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.35 2021/07/21 06:33:30 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.36 2021/07/21 07:34:44 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -306,6 +306,7 @@
return (0);
}
+#define NSEC_TO_PSEC(s) ((uint64_t)(s) * 1000 * 1000)
int
cbq_add_queue(struct pf_altq *a)
{
@@ -384,7 +385,7 @@
*/
if ((opts->flags & CBQCLF_ROOTCLASS) != 0) {
error = rmc_init(cbqp->ifnp.ifq_, &cbqp->ifnp,
- opts->ps_per_byte, cbqrestart, a->qlimit, RM_MAXQUEUED,
+ NSEC_TO_PSEC(opts->ns_per_byte), cbqrestart, a->qlimit, RM_MAXQUEUED,
opts->maxidle, opts->minidle, opts->offtime,
opts->flags);
if (error != 0)
@@ -392,7 +393,7 @@
cl = cbqp->ifnp.root_;
} else {
cl = rmc_newclass(a->priority,
- &cbqp->ifnp, opts->ps_per_byte,
+ &cbqp->ifnp, NSEC_TO_PSEC(opts->ns_per_byte),
rmc_delay_action, a->qlimit, parent, borrow,
opts->maxidle, opts->minidle, opts->offtime,
opts->pktsize, opts->flags);
diff -r b87c72d62d8c -r 529fcb141175 sys/altq/altq_rmclass.c
--- a/sys/altq/altq_rmclass.c Wed Jul 21 06:49:25 2021 +0000
+++ b/sys/altq/altq_rmclass.c Wed Jul 21 07:34:44 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_rmclass.c,v 1.28 2021/07/21 06:49:25 ozaki-r Exp $ */
+/* $NetBSD: altq_rmclass.c,v 1.29 2021/07/21 07:34:44 ozaki-r Exp $ */
/* $KAME: altq_rmclass.c,v 1.19 2005/04/13 03:44:25 suz Exp $ */
/*
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_rmclass.c,v 1.28 2021/07/21 06:49:25 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_rmclass.c,v 1.29 2021/07/21 07:34:44 ozaki-r Exp $");
/* #ident "@(#)rm_class.c 1.48 97/12/05 SMI" */
@@ -287,7 +287,7 @@
if (flags & RMCF_CLEARDSCP)
red_flags |= RIOF_CLEARDSCP;
#endif
- red_pkttime = nsecPerByte * pktsize / 1000;
+ red_pkttime = PSEC_TO_NSEC(psecPerByte) * pktsize / 1000;
if (flags & RMCF_RED) {
cl->red_ = red_alloc(0, 0,
Home |
Main Index |
Thread Index |
Old Index