netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@oss.sgi.com, netem@osdl.org
Subject: Re: [PATCH] (3/3) netem: adjust parent qlen when duplicating
Date: Wed, 04 May 2005 01:35:29 +0200	[thread overview]
Message-ID: <42780AC1.8040409@trash.net> (raw)
In-Reply-To: <20050503162550.30acf31a@dxpl.pdx.osdl.net>

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.

Regards
Patrick

  parent reply	other threads:[~2005-05-03 23:35 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 [this message]
2005-05-03 23:30   ` David S. Miller
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=42780AC1.8040409@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.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).