netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@redhat.com>
Cc: jamal <hadi@cyberus.ca>, netdev@oss.sgi.com
Subject: [UPDATED PATCH]: Adjust qlen when grafting in multiple qdiscs
Date: Tue, 18 Nov 2003 01:34:56 +0100	[thread overview]
Message-ID: <3FB96930.9020300@trash.net> (raw)
In-Reply-To: <20031117163834.V1330@almesberger.net>

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

Hi Dave,

this patch fixes multiple qdiscs to adjust sch->q.qlen when
replacing a non-empty inner qdisc. The only change to the
first patch is in dsmark_graft: this patch directly sets
sch->q.qlen to 0 instead of subtracting the length of the
inner qdisc.

Best regards,
Patrick



[-- Attachment #2: graft-adjust-qlen.diff --]
[-- Type: text/plain, Size: 1974 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1441  -> 1.1442 
#	 net/sched/sch_tbf.c	1.10    -> 1.11   
#	 net/sched/sch_cbq.c	1.13    -> 1.14   
#	net/sched/sch_dsmark.c	1.10    -> 1.11   
#	net/sched/sch_prio.c	1.9     -> 1.10   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/18	kaber@trash.net	1.1442
# Adjust qlen when grafting in multiple qdiscs
# --------------------------------------------
#
diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
--- a/net/sched/sch_cbq.c	Tue Nov 18 01:18:14 2003
+++ b/net/sched/sch_cbq.c	Tue Nov 18 01:18:14 2003
@@ -1670,6 +1670,7 @@
 		sch_tree_lock(sch);
 		*old = cl->q;
 		cl->q = new;
+		sch->q.qlen -= (*old)->q.qlen;
 		qdisc_reset(*old);
 		sch_tree_unlock(sch);
 
diff -Nru a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
--- a/net/sched/sch_dsmark.c	Tue Nov 18 01:18:14 2003
+++ b/net/sched/sch_dsmark.c	Tue Nov 18 01:18:14 2003
@@ -77,6 +77,7 @@
 	*old = xchg(&p->q,new);
 	if (*old)
 		qdisc_reset(*old);
+	sch->q.qlen = 0;
 	sch_tree_unlock(sch); /* @@@ move up ? */
         return 0;
 }
diff -Nru a/net/sched/sch_prio.c b/net/sched/sch_prio.c
--- a/net/sched/sch_prio.c	Tue Nov 18 01:18:14 2003
+++ b/net/sched/sch_prio.c	Tue Nov 18 01:18:14 2003
@@ -266,6 +266,7 @@
 	sch_tree_lock(sch);
 	*old = q->queues[band];
 	q->queues[band] = new;
+	sch->q.qlen -= (*old)->q.qlen;
 	qdisc_reset(*old);
 	sch_tree_unlock(sch);
 
diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
--- a/net/sched/sch_tbf.c	Tue Nov 18 01:18:14 2003
+++ b/net/sched/sch_tbf.c	Tue Nov 18 01:18:14 2003
@@ -455,6 +455,8 @@
 	sch_tree_lock(sch);	
 	*old = xchg(&q->qdisc, new);
 	qdisc_reset(*old);
+	sch->q.qlen = 0;
+	sch->stats.backlog = 0;
 	sch_tree_unlock(sch);
 	
 	return 0;

  parent reply	other threads:[~2003-11-18  0:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-13 14:47 [PATCH]: Adjust qlen when grafting in multiple qdiscs Patrick McHardy
2003-11-17 14:22 ` jamal
2003-11-17 14:40   ` Patrick McHardy
2003-11-17 14:59     ` jamal
2003-11-17 16:13       ` Patrick McHardy
2003-11-17 17:30         ` jamal
2003-11-17 18:15           ` Patrick McHardy
2003-11-17 19:25             ` jamal
2003-11-17 19:38           ` Werner Almesberger
2003-11-17 21:10             ` Patrick McHardy
2003-11-18  0:34             ` Patrick McHardy [this message]
2003-11-19  1:19               ` [UPDATED PATCH]: " David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FB96930.9020300@trash.net \
    --to=kaber@trash.net \
    --cc=davem@redhat.com \
    --cc=hadi@cyberus.ca \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).