netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxim Uvarov <maxim.uvarov@oracle.com>
To: netdev@vger.kernel.org
Cc: Maxim Uvarov <maxim.uvarov@oracle.com>
Subject: [PATCH] bond_alb: do not disable BH under netpoll
Date: Tue,  3 Jan 2012 18:20:18 -0800	[thread overview]
Message-ID: <1325643618-3051-1-git-send-email-maxim.uvarov@oracle.com> (raw)

Do not disable BH if interrupts are already disabled
(netpoll case).
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
---
 drivers/net/bonding/bond_alb.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index d4fbd2e..69eeb36 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -101,12 +101,18 @@ static inline u8 _simple_hash(const u8 *hash_start, int hash_size)
 
 static inline void _lock_tx_hashtbl(struct bonding *bond)
 {
-	spin_lock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
+	if (unlikely(irqs_disabled())) /*netpoll case*/
+		spin_lock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
+	else
+		spin_lock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
 }
 
 static inline void _unlock_tx_hashtbl(struct bonding *bond)
 {
-	spin_unlock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
+	if (unlikely(irqs_disabled())) /*netpoll case*/
+		spin_unlock(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
+	else
+		spin_unlock_bh(&(BOND_ALB_INFO(bond).tx_hashtbl_lock));
 }
 
 /* Caller must hold tx_hashtbl lock */
-- 
1.7.4.1

             reply	other threads:[~2012-01-04  2:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04  2:20 Maxim Uvarov [this message]
2012-01-04  2:49 ` [PATCH] bond_alb: do not disable BH under netpoll David Miller
2012-01-04  8:14   ` Maxim Uvarov
2012-01-04 18:25     ` David Miller
2012-01-04 19:35       ` Maxim Uvarov

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=1325643618-3051-1-git-send-email-maxim.uvarov@oracle.com \
    --to=maxim.uvarov@oracle.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).