From: Tommy Christensen <tommy.christensen@tpack.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@oss.sgi.com
Subject: Re: [PATCH] net: Disable queueing when carrier is lost (take 2)
Date: Wed, 04 May 2005 01:28:24 +0200 [thread overview]
Message-ID: <42780918.10001@tpack.net> (raw)
In-Reply-To: <20050503231023.GA18323@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 262 bytes --]
Herbert Xu wrote:
> Thanks Tommy. This version looks good to me. BTW, you probably
> should add a Signed-off-by line.
Sigh. I remembered on all but the final patch ...
Thanks for helping out.
Signed-off-by: Tommy S. Christensen <tommy.christensen@tpack.net>
[-- Attachment #2: carrier-5.patch --]
[-- Type: text/plain, Size: 1293 bytes --]
diff -ru linux-2.6.12-rc3/net/core/link_watch.c linux-2.6.12-work/net/core/link_watch.c
--- linux-2.6.12-rc3/net/core/link_watch.c 2005-03-04 09:55:42.000000000 +0100
+++ linux-2.6.12-work/net/core/link_watch.c 2005-05-02 22:40:59.000000000 +0200
@@ -16,6 +16,7 @@
#include <linux/netdevice.h>
#include <linux/if.h>
#include <net/sock.h>
+#include <net/pkt_sched.h>
#include <linux/rtnetlink.h>
#include <linux/jiffies.h>
#include <linux/spinlock.h>
@@ -74,6 +75,12 @@
clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state);
if (dev->flags & IFF_UP) {
+ if (netif_carrier_ok(dev)) {
+ WARN_ON(dev->qdisc_sleeping == &noop_qdisc);
+ dev_activate(dev);
+ } else
+ dev_deactivate(dev);
+
netdev_state_change(dev);
}
diff -ru linux-2.6.12-rc3/net/sched/sch_generic.c linux-2.6.12-work/net/sched/sch_generic.c
--- linux-2.6.12-rc3/net/sched/sch_generic.c 2005-03-04 09:55:44.000000000 +0100
+++ linux-2.6.12-work/net/sched/sch_generic.c 2005-05-04 00:24:55.558105856 +0200
@@ -539,6 +539,10 @@
write_unlock_bh(&qdisc_tree_lock);
}
+ if (!netif_carrier_ok(dev))
+ /* Delay activation until next carrier-on event */
+ return;
+
spin_lock_bh(&dev->queue_lock);
rcu_assign_pointer(dev->qdisc, dev->qdisc_sleeping);
if (dev->qdisc != &noqueue_qdisc) {
next prev parent reply other threads:[~2005-05-03 23:28 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
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 [this message]
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=42780918.10001@tpack.net \
--to=tommy.christensen@tpack.net \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@oss.sgi.com \
/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.