From: Jarek Poplawski <jarkao2@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: jussi.kivilinna@mbnet.fi, kaber@trash.net, netdev@vger.kernel.org
Subject: Re: [PATCH v2 2/3] net_sched: Add accessor function for packet length for qdiscs
Date: Fri, 25 Jul 2008 11:37:57 +0000 [thread overview]
Message-ID: <20080725113757.GC10399@ff.dom.local> (raw)
In-Reply-To: <20080725.035712.33516738.davem@davemloft.net>
On Fri, Jul 25, 2008 at 03:57:12AM -0700, David Miller wrote:
> From: Jarek Poplawski <jarkao2@gmail.com>
> Date: Fri, 25 Jul 2008 10:57:48 +0000
>
> > On 20-07-2008 01:35, Jussi Kivilinna wrote:
> > > Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
> > ...
> > > diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
> > > index 1afe3ee..f1d2f8e 100644
> > > --- a/net/sched/sch_cbq.c
> > > +++ b/net/sched/sch_cbq.c
> > > @@ -370,7 +370,6 @@ static int
> > > cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> > > {
> > > struct cbq_sched_data *q = qdisc_priv(sch);
> > > - int len = skb->len;
> > > int uninitialized_var(ret);
> > > struct cbq_class *cl = cbq_classify(skb, sch, &ret);
> > >
> > > @@ -391,7 +390,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
> > > if (ret == NET_XMIT_SUCCESS) {
> > > sch->q.qlen++;
> > > sch->bstats.packets++;
> > > - sch->bstats.bytes+=len;
> > > + sch->bstats.bytes += qdisc_pkt_len(skb);
> >
> > Alas I didn't manage to read this earlier, but this type of changes
> > here and elsewhere in this patch looks wrong to me: we shouldn't
> > use skb pointer after ->enqueue().
>
> It should be OK here, we have the root qdisc locked, so nobody
> can remove it from the queue and if we got NET_XMIT_SUCCESS that
> thing must not have been freed.
>
> And anyways, we can't know the qdisc_pkt_len() until the enqueue
> fucntion has been called.
OK, I see htb did this earlier with ".packets", so it looks like I'm
wrong with this - sorry! (Anyway, it seems to unnecessarily restrict
the way qdisc are working.)
> Even TCP depends upon that NET_XMIT_* return value having some real
> meaning, remember the HTB bug we tracked down last week? :-)
Do you mean this bug you've forgotten to fix yet?
Thanks,
Jarek P.
next prev parent reply other threads:[~2008-07-25 11:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-19 23:34 [PATCH v2 0/3] Add size table feature for qdiscs Jussi Kivilinna
2008-07-19 23:35 ` [PATCH v2 1/3] net_sched: Add qdisc_enqueue wrapper Jussi Kivilinna
2008-07-19 23:35 ` [PATCH v2 2/3] net_sched: Add accessor function for packet length for qdiscs Jussi Kivilinna
2008-07-25 10:57 ` Jarek Poplawski
2008-07-25 10:57 ` David Miller
2008-07-25 11:37 ` Jarek Poplawski [this message]
2008-07-25 11:49 ` David Miller
2008-07-26 13:21 ` Patrick McHardy
2008-07-26 14:18 ` Jarek Poplawski
2008-07-30 10:47 ` Patrick McHardy
2008-07-30 11:19 ` Jarek Poplawski
2008-07-30 11:21 ` Patrick McHardy
2008-07-30 11:37 ` Jarek Poplawski
2008-07-30 11:40 ` Patrick McHardy
2008-07-30 11:48 ` David Miller
2008-07-30 11:52 ` Patrick McHardy
2008-07-30 12:19 ` Jarek Poplawski
2008-07-30 20:50 ` Jarek Poplawski
2008-07-25 11:53 ` Jarek Poplawski
2008-07-25 11:52 ` David Miller
2008-07-25 12:08 ` Jarek Poplawski
2008-07-25 12:16 ` David Miller
2008-07-25 12:29 ` Jussi Kivilinna
2008-07-25 12:54 ` Jarek Poplawski
2008-07-25 13:15 ` Jussi Kivilinna
2008-07-25 17:46 ` Jarek Poplawski
2008-07-25 18:02 ` Jarek Poplawski
2008-07-19 23:35 ` [PATCH v2 3/3] net_sched: Add size table " Jussi Kivilinna
2008-07-20 7:09 ` [PATCH v2 0/3] Add size table feature " 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=20080725113757.GC10399@ff.dom.local \
--to=jarkao2@gmail.com \
--cc=davem@davemloft.net \
--cc=jussi.kivilinna@mbnet.fi \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.