netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] bnx2x: Disable local BHes to prevent a dead-lock situation
@ 2010-11-24 13:41 Vladislav Zolotarov
  0 siblings, 0 replies; 5+ messages in thread
From: Vladislav Zolotarov @ 2010-11-24 13:41 UTC (permalink / raw)
  To: Dave Miller; +Cc: Eilon Greenstein, netdev list

From: Eric Dumazet <eric.dumazet@gmail.com>

Disable local BHes to prevent a dead-lock situation between sch_direct_xmit()
(Soft_IRQ context) and bnx2x_tx_int (called by bnx2x_run_loopback() - syscall
context), as both are taking a netif_tx_lock().

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/bnx2x/bnx2x_ethtool.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index d02ffbd..0301278 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -1499,8 +1499,15 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up)
 	 * updates that have been performed while interrupts were
 	 * disabled.
 	 */
-	if (bp->common.int_block == INT_BLOCK_IGU)
+	if (bp->common.int_block == INT_BLOCK_IGU) {
+		/* Disable local BHes to prevent a dead-lock situation between
+		 * sch_direct_xmit() and bnx2x_run_loopback() (calling
+		 * bnx2x_tx_int()), as both are taking netif_tx_lock().
+		 */
+		local_bh_disable();
 		bnx2x_tx_int(fp_tx);
+		local_bh_enable();
+	}
 
 	rx_idx = le16_to_cpu(*fp_rx->rx_cons_sb);
 	if (rx_idx != rx_start_idx + num_pkts)
-- 
1.7.0.4





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next] bnx2x: Disable local BHes to prevent a dead-lock situation
@ 2010-11-24 13:45 Vladislav Zolotarov
  2010-11-24 14:04 ` Eric Dumazet
  2010-11-24 19:09 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Vladislav Zolotarov @ 2010-11-24 13:45 UTC (permalink / raw)
  To: Dave Miller; +Cc: Eilon Greenstein, netdev list, Eric Dumazet

From: Eric Dumazet <eric.dumazet@gmail.com>

According to Eric's suggestion:
Disable local BHes to prevent a dead-lock situation between sch_direct_xmit()
(Soft_IRQ context) and bnx2x_tx_int (called by bnx2x_run_loopback() - syscall
context), as both are taking a netif_tx_lock().

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
CCing Eric... :)

 drivers/net/bnx2x/bnx2x_ethtool.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index d02ffbd..0301278 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -1499,8 +1499,15 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up)
 	 * updates that have been performed while interrupts were
 	 * disabled.
 	 */
-	if (bp->common.int_block == INT_BLOCK_IGU)
+	if (bp->common.int_block == INT_BLOCK_IGU) {
+		/* Disable local BHes to prevent a dead-lock situation between
+		 * sch_direct_xmit() and bnx2x_run_loopback() (calling
+		 * bnx2x_tx_int()), as both are taking netif_tx_lock().
+		 */
+		local_bh_disable();
 		bnx2x_tx_int(fp_tx);
+		local_bh_enable();
+	}
 
 	rx_idx = le16_to_cpu(*fp_rx->rx_cons_sb);
 	if (rx_idx != rx_start_idx + num_pkts)
-- 
1.7.0.4





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] bnx2x: Disable local BHes to prevent a dead-lock situation
  2010-11-24 13:45 [PATCH net-next] bnx2x: Disable local BHes to prevent a dead-lock situation Vladislav Zolotarov
@ 2010-11-24 14:04 ` Eric Dumazet
  2010-11-24 14:18   ` Vladislav Zolotarov
  2010-11-24 19:09 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2010-11-24 14:04 UTC (permalink / raw)
  To: Vladislav Zolotarov; +Cc: Dave Miller, Eilon Greenstein, netdev list

Le mercredi 24 novembre 2010 à 15:45 +0200, Vladislav Zolotarov a
écrit :
> From: Eric Dumazet <eric.dumazet@gmail.com>
> 
> According to Eric's suggestion:
> Disable local BHes to prevent a dead-lock situation between sch_direct_xmit()
> (Soft_IRQ context) and bnx2x_tx_int (called by bnx2x_run_loopback() - syscall
> context), as both are taking a netif_tx_lock().
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
> ---
> CCing Eric... :)

Dont worry, I am subscribed to netdev ;)

Thanks !



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH net-next] bnx2x: Disable local BHes to prevent a dead-lock situation
  2010-11-24 14:04 ` Eric Dumazet
@ 2010-11-24 14:18   ` Vladislav Zolotarov
  0 siblings, 0 replies; 5+ messages in thread
From: Vladislav Zolotarov @ 2010-11-24 14:18 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Dave Miller, Eilon Greenstein, netdev list

> > CCing Eric... :)
> 
> Dont worry, I am subscribed to netdev ;)
> 
> Thanks !
> 

I'm sure u r. ;) But u see, Dave is very punctual about a formal
side and the rule says I had to add u. So I fixed myself before
Dave's remark on this... ;)

Thanks again for your help.

Regards,
vlad

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next] bnx2x: Disable local BHes to prevent a dead-lock situation
  2010-11-24 13:45 [PATCH net-next] bnx2x: Disable local BHes to prevent a dead-lock situation Vladislav Zolotarov
  2010-11-24 14:04 ` Eric Dumazet
@ 2010-11-24 19:09 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2010-11-24 19:09 UTC (permalink / raw)
  To: vladz; +Cc: eilong, netdev, eric.dumazet

From: "Vladislav Zolotarov" <vladz@broadcom.com>
Date: Wed, 24 Nov 2010 15:45:10 +0200

> From: Eric Dumazet <eric.dumazet@gmail.com>
> 
> According to Eric's suggestion:
> Disable local BHes to prevent a dead-lock situation between sch_direct_xmit()
> (Soft_IRQ context) and bnx2x_tx_int (called by bnx2x_run_loopback() - syscall
> context), as both are taking a netif_tx_lock().
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-24 19:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-24 13:45 [PATCH net-next] bnx2x: Disable local BHes to prevent a dead-lock situation Vladislav Zolotarov
2010-11-24 14:04 ` Eric Dumazet
2010-11-24 14:18   ` Vladislav Zolotarov
2010-11-24 19:09 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2010-11-24 13:41 Vladislav Zolotarov

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).