public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jarek Poplawski <jarkao2@gmail•com>
To: Eric Dumazet <eric.dumazet@gmail•com>
Cc: David Miller <davem@davemloft•net>,
	netdev <netdev@vger•kernel.org>,
	Patrick McHardy <kaber@trash•net>
Subject: Re: [PATCH net-next-2.6] net_sched: sch_sfq: add backlog info in sfq_dump_class_stats()
Date: Thu, 16 Dec 2010 13:09:34 +0000	[thread overview]
Message-ID: <20101216130934.GA7766@ff.dom.local> (raw)
In-Reply-To: <1292497384.2883.89.camel@edumazet-laptop>

On Thu, Dec 16, 2010 at 12:03:04PM +0100, Eric Dumazet wrote:
> Le jeudi 16 décembre 2010 ?? 08:16 +0000, Jarek Poplawski a écrit :
> > On 2010-12-15 19:18, Eric Dumazet wrote:
> > > We currently return for each active SFQ slot the number of packets in
> > > queue. We can also give number of bytes accounted for these packets.
...
> > > Signed-off-by: Eric Dumazet <eric.dumazet@gmail•com>
> > > ---
> > >  net/sched/sch_sfq.c |    7 ++++++-
> > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
> > > index 3cf478d..cb331de 100644
> > > --- a/net/sched/sch_sfq.c
> > > +++ b/net/sched/sch_sfq.c
> > > @@ -548,8 +548,13 @@ static int sfq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
> > >  {
> > >  	struct sfq_sched_data *q = qdisc_priv(sch);
> > >  	sfq_index idx = q->ht[cl-1];
> > > -	struct gnet_stats_queue qs = { .qlen = q->qs[idx].qlen };
> > > +	struct sk_buff_head *list = &q->qs[idx];
> > > +	struct gnet_stats_queue qs = { .qlen = list->qlen };
> > >  	struct tc_sfq_xstats xstats = { .allot = q->allot[idx] };
> > > +	struct sk_buff *skb;
> > > +
> > > +	skb_queue_walk(list, skb)
> > > +		qs.backlog += qdisc_pkt_len(skb);
> > 
> > I don't think you can walk this list without the qdisc lock.
> 
> So after checks, I confirm qdisc lock is held at this point, patch is
> valid.
> 
> tc_fill_tclass() calls gnet_stats_start_copy_compat() (and locks
> qdisc_root_sleeping_lock()), before calling 
>  cl_ops->dump_stats(q, cl, &d)
> 
> Thanks !

You are right. Sorry for misleading.

Jarek P.

  reply	other threads:[~2010-12-16 13:09 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 14:03 [PATCH] net_sched: sch_sfq: fix allot handling Eric Dumazet
2010-12-15 16:03 ` Patrick McHardy
2010-12-15 16:27   ` Eric Dumazet
2010-12-15 16:40     ` [PATCH v2] " Eric Dumazet
2010-12-15 16:43       ` Patrick McHardy
2010-12-15 16:55         ` Eric Dumazet
2010-12-15 17:03           ` Patrick McHardy
2010-12-15 17:09             ` Eric Dumazet
2010-12-15 17:21               ` Patrick McHardy
2010-12-15 17:30                 ` [PATCH v3] " Eric Dumazet
2010-12-15 18:18                   ` [PATCH net-next-2.6] net_sched: sch_sfq: add backlog info in sfq_dump_class_stats() Eric Dumazet
2010-12-15 19:10                     ` Eric Dumazet
2010-12-16  8:16                     ` Jarek Poplawski
2010-12-16 10:18                       ` [PATCH v2 " Eric Dumazet
2010-12-16 11:03                       ` [PATCH " Eric Dumazet
2010-12-16 13:09                         ` Jarek Poplawski [this message]
2010-12-20 21:14                     ` David Miller
2010-12-20 21:18                   ` [PATCH v3] net_sched: sch_sfq: fix allot handling David Miller
2010-12-16 13:08             ` [PATCH v2] " Eric Dumazet
2010-12-17 16:52               ` [RFC PATCH] net_sched: sch_sfq: better struct layouts Eric Dumazet
2010-12-19 21:22                 ` Jarek Poplawski
2010-12-20 17:02                   ` [PATCH v2] " Eric Dumazet
2010-12-20 21:33                     ` David Miller
2010-12-20 21:42                       ` Eric Dumazet
2010-12-20 22:54                         ` [PATCH v3 net-next-2.6] " Eric Dumazet
2010-12-21  5:33                           ` David Miller
2010-12-20 22:55                     ` [PATCH v2] " Jarek Poplawski
2010-12-20 23:16                     ` [PATCH net-next-2.6] sch_sfq: allow big packets and be fair Eric Dumazet
2010-12-21 10:15                       ` Jarek Poplawski
2010-12-21 10:30                         ` Jarek Poplawski
2010-12-21 10:44                           ` Eric Dumazet
2010-12-21 10:56                             ` Jarek Poplawski
2010-12-21 10:57                         ` Eric Dumazet
2010-12-21 11:39                           ` Jarek Poplawski
2010-12-21 12:17                             ` Jarek Poplawski
2010-12-21 13:04                               ` [PATCH v2 " Eric Dumazet
2010-12-21 13:47                                 ` Jarek Poplawski
2010-12-28 21:46                                 ` David Miller
2010-12-29  7:53                                   ` [PATCH v3 " Eric Dumazet
2010-12-31 20:48                                     ` David 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=20101216130934.GA7766@ff.dom.local \
    --to=jarkao2@gmail$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=kaber@trash$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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