netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Patrick McHardy <kaber@trash.net>
Cc: shemminger@osdl.org, netdev@oss.sgi.com, netem@osdl.org
Subject: Re: [PATCH] (3/3) netem: adjust parent qlen when duplicating
Date: Tue, 3 May 2005 16:30:25 -0700	[thread overview]
Message-ID: <20050503163025.38bb9682.davem@davemloft.net> (raw)
In-Reply-To: <42780AC1.8040409@trash.net>

On Wed, 04 May 2005 01:35:29 +0200
Patrick McHardy <kaber@trash.net> wrote:

> Stephen Hemminger wrote:
> > Fix qlen underrun when doing duplication with netem. If netem is used as 
> > leaf discipline, then the parent needs to be tweaked when packets  are duplicated.
> 
> > +			/* Since one packet can generate two packets in the
> > +			 * queue, the parent's qlen accounting gets confused,
> > +			 * so fix it.
> > +			 */
> > +			qp = qdisc_lookup(sch->dev, TC_H_MAJ(sch->parent));
> > +			if (qp)
> > +				qp->q.qlen++;
> 
> This only works in a hierarchy with just one qdisc above netem, there
> could be up to seven (check_loop_fn prevents more than that). It's also
> not safe because it violates qdisc locking rules, when this code is
> executed dev->queue_lock is already taken and qdisc_lookup() grabs
> qdisc_tree_lock, but they can only be taken in the other order.

I see... I'm leaving Stephen's patch in there for now.

Perhaps we can create some kind of "propagate up" function
that will handle all of the parents in the qdisc hierarchy
above netem?

  reply	other threads:[~2005-05-03 23:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-03 23:25 [PATCH] (3/3) netem: adjust parent qlen when duplicating Stephen Hemminger
2005-05-03 23:24 ` David S. Miller
2005-05-03 23:35 ` Patrick McHardy
2005-05-03 23:30   ` David S. Miller [this message]
2005-05-03 23:48     ` Patrick McHardy
2005-05-03 23:59       ` David S. Miller
2005-05-04  1:54         ` Patrick McHardy
2005-05-04  1:57           ` Patrick McHardy
2005-05-04  5:01             ` Stephen Hemminger
2005-05-04 17:09           ` [RFC] alternate way of handling netem duplication Stephen Hemminger

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=20050503163025.38bb9682.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=netdev@oss.sgi.com \
    --cc=netem@osdl.org \
    --cc=shemminger@osdl.org \
    /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).