Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/altq altq, cbq: calculate a delay period based on a borr...



details:   https://anonhg.NetBSD.org/src/rev/15d1d7007f0d
branches:  trunk
changeset: 984602:15d1d7007f0d
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Jul 13 08:23:39 2021 +0000

description:
altq, cbq: calculate a delay period based on a borrowed class

A delay period was calculated based on a suspended class even if the
class can borrow bandwidth from another class.  In that case a delay
period should be calculated based on a borrowed class.  Otherwise
a borrowing class can't borrow bandwidth correctly.

diffstat:

 sys/altq/altq_rmclass.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 3c2aa974e307 -r 15d1d7007f0d sys/altq/altq_rmclass.c
--- a/sys/altq/altq_rmclass.c   Tue Jul 13 08:04:31 2021 +0000
+++ b/sys/altq/altq_rmclass.c   Tue Jul 13 08:23:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: altq_rmclass.c,v 1.23 2021/07/13 07:59:48 ozaki-r Exp $        */
+/*     $NetBSD: altq_rmclass.c,v 1.24 2021/07/13 08:23:39 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.23 2021/07/13 07:59:48 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_rmclass.c,v 1.24 2021/07/13 08:23:39 ozaki-r Exp $");
 
 /* #ident "@(#)rm_class.c  1.48     97/12/05 SMI" */
 
@@ -1482,7 +1482,10 @@
        int     ndelay, t, extradelay;
 
        cl->stats_.overactions++;
-       TV_DELTA(&cl->undertime_, &cl->overtime_, ndelay);
+       if (borrow != NULL)
+               TV_DELTA(&borrow->undertime_, &cl->overtime_, ndelay);
+       else
+               TV_DELTA(&cl->undertime_, &cl->overtime_, ndelay);
 #ifndef BORROW_OFFTIME
        ndelay += cl->offtime_;
 #endif



Home | Main Index | Thread Index | Old Index