netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Thomas Graf <tgraf@suug.ch>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [RFC] make qdisc_restart more readable
Date: Fri, 11 May 2007 14:11:44 -0400	[thread overview]
Message-ID: <1178907104.4126.10.camel@localhost> (raw)
In-Reply-To: <20070511170126.GH521@postel.suug.ch>

On Fri, 2007-11-05 at 19:01 +0200, Thomas Graf wrote:
> * jamal <j.hadi123@gmail.com> 2007-05-10 20:13

> >   *	Compute the worst case header length according to the protocols
> > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
> > index f28bb2d..b821040 100644
> > --- a/net/sched/sch_generic.c
> > +++ b/net/sched/sch_generic.c
> > @@ -59,7 +59,79 @@ void qdisc_unlock_tree(struct net_device *dev)
> >  	spin_unlock_bh(&dev->queue_lock);
> >  }
> >  
> > -/*
> > +static inline int qqlen(struct Qdisc *q)
> > +{
> > +	BUG_ON((int) q->q.qlen < 0);
> > +	return q->q.qlen;
> > +}
> 
> Nitpicking but qdisc_qlen() sounds a lot better to me.
> 

I thought nitpicking was my department ;->
qdisc_qlen is more descriptive; i will change it.


> > +static inline int
> > +handle_dev_requeue(struct sk_buff *skb, struct net_device *dev, struct Qdisc *q)
> > +{
> > +
> > +	if (unlikely(q == &noop_qdisc))
> > +		kfree_skb(skb);
> > +
> > +	if (skb->next)
> 
> Oops, missing else here, this will crash.
> 

tabarnaq. I will fix - thanks.

> Seems simpler to just return the skb or NULL instead
> 

sure.

> > +	/* churn baby churn .. */
> > +	ret = dev_hard_start_xmit(skb, dev);
> 
> Check whether queue is stopped got lost here
> 

Also caught by Peter - will fix.




> > +	q = dev->qdisc;
> 
> Maybe comment why q needs to be refreshed so nobody removes
> it by accident.

Makes sense ..

> > +	/* most likely result, packet went ok */
> > +	if (ret == NETDEV_TX_OK)
> > +		return qqlen(q);
> > +	/* only for lockless drivers .. */
> > +	if (ret == NETDEV_TX_LOCKED && lockless) {
> > +		return handle_tx_locked(skb, dev, q);
> > +	}
> 
> Your style of placing parentheses seems to vary randomly :-)

There may have been a debug in there that i removed. Frankly
i dont mind having braces even for a one liner, but i know that is not
popular with many folks.
Any other spot you noticed?

Thanks a lot Thomas.

cheers,
jamal


      reply	other threads:[~2007-05-11 18:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-11  0:13 [RFC] make qdisc_restart more readable jamal
2007-05-11 15:56 ` Waskiewicz Jr, Peter P
2007-05-11 18:04   ` jamal
2007-05-11 18:13     ` Waskiewicz Jr, Peter P
2007-05-11 18:35       ` jamal
2007-05-11 18:46         ` Waskiewicz Jr, Peter P
2007-05-11 19:29           ` take 2 WAS (RE: " jamal
2007-05-11 22:01             ` Waskiewicz Jr, Peter P
2007-05-11 22:43               ` jamal
2007-05-12  9:46             ` Thomas Graf
2007-05-12 11:58               ` jamal
2007-05-12 12:18             ` take 3 " jamal
2007-05-12 17:02               ` Patrick McHardy
2007-05-12 19:56                 ` jamal
2007-05-13 14:28                   ` [LAST CALL] [PATCH] [NET_SCHED]make " jamal
2007-05-14 10:40                     ` Patrick McHardy
2007-05-14 12:41                       ` jamal
2007-05-14 12:43                         ` Patrick McHardy
2007-05-14 13:30                     ` jamal
2007-05-14 20:09                       ` Waskiewicz Jr, Peter P
2007-05-16 22:55                       ` jamal
2007-05-16 23:00                         ` David Miller
2007-05-16 23:15                         ` Sridhar Samudrala
2007-05-17  2:12                           ` jamal
2007-05-11 17:01 ` [RFC] make " Thomas Graf
2007-05-11 18:11   ` jamal [this message]

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=1178907104.4126.10.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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).