From: Thomas Graf <tgraf@suug.ch>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Tommy Christensen <tommy.christensen@tpack.net>,
"David S. Miller" <davem@davemloft.net>,
netdev@oss.sgi.com
Subject: Re: [PATCH] net: Disable queueing when carrier is lost (take 2)
Date: Tue, 3 May 2005 13:18:44 +0200 [thread overview]
Message-ID: <20050503111844.GP577@postel.suug.ch> (raw)
In-Reply-To: <20050503100306.GB29788@gondor.apana.org.au>
* Herbert Xu <20050503100306.GB29788@gondor.apana.org.au> 2005-05-03 20:03
> On Tue, May 03, 2005 at 01:01:19AM +0200, Tommy Christensen wrote:
> > Some network drivers call netif_stop_queue() when detecting loss of
> > carrier. This leads to packets being queued up at the qdisc level for
> > an unbound period of time. In order to prevent this effect, the core
> > networking stack will now seize to queue packets for any device, that
> > is operationally down (i.e. the queue is flushed and disabled).
>
> This looks great.
>
> > @@ -552,15 +560,18 @@
> > {
> > struct Qdisc *qdisc;
> >
> > - spin_lock_bh(&dev->queue_lock);
> > - qdisc = dev->qdisc;
> > - dev->qdisc = &noop_qdisc;
> > + if (dev->flags & IFF_RUNNING) {
> > + spin_lock_bh(&dev->queue_lock);
> > + qdisc = dev->qdisc;
> > + dev->qdisc = &noop_qdisc;
> >
> > - qdisc_reset(qdisc);
> > + qdisc_reset(qdisc);
> >
> > - spin_unlock_bh(&dev->queue_lock);
> > + spin_unlock_bh(&dev->queue_lock);
> >
> > - dev_watchdog_down(dev);
> > + dev_watchdog_down(dev);
> > + }
> > + dev->flags &= ~IFF_RUNNING;
> >
> > while (test_bit(__LINK_STATE_SCHED, &dev->state))
> > yield();
>
> Doing the wait when IFF_RUNNING is off isn't necessary though. If
> IFF_RUNNING isn't set, then either the device has never been activated
> or we've already carried out those waits the last time we were in
> dev_deactivate.
I do like the patch, no question but IFF_RUNNING is still abused
by drivers and some subsystems. So I'm not sure how reliable the
above code will be without those cases fixed. I submitted a
patchset once to fix some of them, not sure about the status. Also,
what about those drivers that do not support or do not use
netif_carrier_(on|off)?
next prev parent reply other threads:[~2005-05-03 11:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-02 23:01 [PATCH] net: Disable queueing when carrier is lost (take 2) Tommy Christensen
2005-05-03 10:03 ` Herbert Xu
2005-05-03 11:18 ` Thomas Graf [this message]
2005-05-03 11:23 ` Herbert Xu
2005-05-03 22:32 ` Tommy Christensen
2005-05-03 23:10 ` Herbert Xu
2005-05-03 23:10 ` David S. Miller
2005-05-03 23:28 ` Tommy Christensen
2005-05-03 23:18 ` David S. 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=20050503111844.GP577@postel.suug.ch \
--to=tgraf@suug.ch \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@oss.sgi.com \
--cc=tommy.christensen@tpack.net \
/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).