Subject: Re: [patch 4/10] s390: network driver.

From: Tommy Christensen <[email-masked]>
Date: Wed, 05 Jan 2005 16:35:13 +0100

jamal wrote:
> On Tue, 2005-01-04 at 18:28, Jeff Garzik wrote:
> 
>>jamal wrote:
>>
>>>The change is simple if theres consensus to go this path.
>>
>>Can you resend your patch?
> 
> 
> I didnt send any patch - but heres one that looks right - havent tried
> compiling it.

Thank you for diving into this, Jamal.

For the patch to have much effect, we need to check the carrier before
calling hard_start_xmit(). Like in the modified patch below.

>>My main objection was that any change should be made in the core, not in 
>>individual net drivers.
> 
> 
> Attached patch resolves that concern

Except for the drivers that call netif_stop_queue() on link-down. These
calls (and the corresponding netif_wake_queue) would have to be removed.

-Tommy
--- linux-2.6.10-bk7/net/sched/sch_generic.c	Wed Jan  5 16:27:13 2005
+++ linux-2.6.10-work/net/sched/sch_generic.c	Wed Jan  5 16:28:53 2005
@@ -134,7 +134,7 @@
 			/* And release queue */
 			spin_unlock(&dev->queue_lock);
 
-			if (!netif_queue_stopped(dev)) {
+			if (!netif_queue_stopped(dev) && netif_carrier_ok(dev)) {
 				int ret;
 				if (netdev_nit)
 					dev_queue_xmit_nit(skb, dev);
@@ -162,6 +162,11 @@
 			} 
 			spin_lock(&dev->queue_lock);
 			q = dev->qdisc;
+			if (!netif_carrier_ok(dev)) {
+				kfree_skb(skb);
+				q->qstats.drops++;
+				return -1;
+			}
 		}
 
 		/* Device kicked us out :(