* [PATCH] bonding: Added fix for device xmit call with irq disabled <resubmit>
@ 2008-06-14 1:14 Laurent Chavey
2008-06-14 2:34 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Laurent Chavey @ 2008-06-14 1:14 UTC (permalink / raw)
To: davem; +Cc: fubar, netdev, bonding-devel
Resubmitting. Previous patch sent with html tags.
In some rare cases (i.e. netconsole), hard_start_xmit() may be
called with interrupts disabled as such it cannot call the slave's
dev_queue_xmit() with interrupts disabled. So instead, it calls the
slave's hard_start_xmit().
Signed-off-by: Laurent Chavey <chavey@google.com>
--- linux-2.6.25.org/drivers/net/bonding/bond_main.c 2008-04-16
19:49:44.000000000 -0700
+++ linux-2.6.25/drivers/net/bonding/bond_main.c 2008-06-13
17:37:10.000000000 -0700
@@ -401,8 +401,21 @@
skb->dev = slave_dev;
}
- skb->priority = 1;
- dev_queue_xmit(skb);
+ /* priority field is used by tc qdiscs for classifying
+ * packets. See usage of TC_H_MAJ and TC_H_MIN in
+ * /net/sched/sch_*.c files.
+ */
+ skb->priority |= 1;
+
+ /* In some rare cases (i.e. netconsole), hard_start_xmit() may be
+ * called with interrupts disabled as such it cannot call the slave's
+ * dev_queue_xmit() with interrupts disabled. So instead, it calls the
+ * slave's hard_start_xmit().
+ */
+ if (unlikely(irqs_disabled()))
+ slave_dev->hard_start_xmit(skb, slave_dev);
+ else
+ dev_queue_xmit(skb);
return 0;
}
--
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] bonding: Added fix for device xmit call with irq disabled <resubmit>
2008-06-14 1:14 [PATCH] bonding: Added fix for device xmit call with irq disabled <resubmit> Laurent Chavey
@ 2008-06-14 2:34 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-06-14 2:34 UTC (permalink / raw)
To: chavey; +Cc: fubar, netdev, bonding-devel, fubar, jgarzik
From: "Laurent Chavey" <chavey@google.com>
Date: Fri, 13 Jun 2008 18:14:55 -0700
Jay, the bonding maintainer, and Jeff Garzik, the
wires networking driver maintainer, added to CC:
> Resubmitting. Previous patch sent with html tags.
>
> In some rare cases (i.e. netconsole), hard_start_xmit() may be
> called with interrupts disabled as such it cannot call the slave's
> dev_queue_xmit() with interrupts disabled. So instead, it calls the
> slave's hard_start_xmit().
>
> Signed-off-by: Laurent Chavey <chavey@google.com>
>
> --- linux-2.6.25.org/drivers/net/bonding/bond_main.c 2008-04-16
> 19:49:44.000000000 -0700
> +++ linux-2.6.25/drivers/net/bonding/bond_main.c 2008-06-13
> 17:37:10.000000000 -0700
> @@ -401,8 +401,21 @@
> skb->dev = slave_dev;
> }
>
> - skb->priority = 1;
> - dev_queue_xmit(skb);
> + /* priority field is used by tc qdiscs for classifying
> + * packets. See usage of TC_H_MAJ and TC_H_MIN in
> + * /net/sched/sch_*.c files.
> + */
> + skb->priority |= 1;
> +
> + /* In some rare cases (i.e. netconsole), hard_start_xmit() may be
> + * called with interrupts disabled as such it cannot call the slave's
> + * dev_queue_xmit() with interrupts disabled. So instead, it calls the
> + * slave's hard_start_xmit().
> + */
> + if (unlikely(irqs_disabled()))
> + slave_dev->hard_start_xmit(skb, slave_dev);
> + else
> + dev_queue_xmit(skb);
>
> return 0;
> }
>
> --
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-14 2:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-14 1:14 [PATCH] bonding: Added fix for device xmit call with irq disabled <resubmit> Laurent Chavey
2008-06-14 2:34 ` David Miller
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).