netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Laurent Chavey" <chavey@google.com>
To: davem@davemloft.net
Cc: fubar@us.ibm.com, netdev@vger.kernel.org,
	bonding-devel@lists.sourceforge.net
Subject: [PATCH] bonding: Added fix for device xmit call with irq disabled <resubmit>
Date: Fri, 13 Jun 2008 18:14:55 -0700	[thread overview]
Message-ID: <97949e3e0806131814j1f22fd72oce1541511d728120@mail.gmail.com> (raw)

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;
 }

--

             reply	other threads:[~2008-06-14  1:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-14  1:14 Laurent Chavey [this message]
2008-06-14  2:34 ` [PATCH] bonding: Added fix for device xmit call with irq disabled <resubmit> David 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=97949e3e0806131814j1f22fd72oce1541511d728120@mail.gmail.com \
    --to=chavey@google.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=davem@davemloft.net \
    --cc=fubar@us.ibm.com \
    --cc=netdev@vger.kernel.org \
    /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).