netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] bnx2: Fix lost MSI-X problem on 5709 NICs.
@ 2010-04-27 21:28 Michael Chan
  2010-04-27 21:28 ` [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan Michael Chan
  2010-04-27 21:38 ` [PATCH 1/3] bnx2: Fix lost MSI-X problem on 5709 NICs David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Chan @ 2010-04-27 21:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, jfeeney

It has been reported that under certain heavy traffic conditions in MSI-X
mode, the driver can lose an MSI-X vector causing all packets in the
associated rx/tx ring pair to be dropped.  The problem is caused by
the chip dropping the write to unmask the MSI-X vector by the kernel
(when migrating the IRQ for example).

This can be prevented by increasing the GRC timeout value for these
register read and write operations.

Thanks to Dell for helping us debug this problem.

Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/bnx2.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index a257bab..4c1e51e 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -4759,8 +4759,12 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code)
 		rc = bnx2_alloc_bad_rbuf(bp);
 	}
 
-	if (bp->flags & BNX2_FLAG_USING_MSIX)
+	if (bp->flags & BNX2_FLAG_USING_MSIX) {
 		bnx2_setup_msix_tbl(bp);
+		/* Prevent MSIX table reads and write from timing out */
+		REG_WR(bp, BNX2_MISC_ECO_HW_CTL,
+			BNX2_MISC_ECO_HW_CTL_LARGE_GRC_TMOUT_EN);
+	}
 
 	return rc;
 }
-- 
1.6.4.GIT



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

* [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan.
  2010-04-27 21:28 [PATCH 1/3] bnx2: Fix lost MSI-X problem on 5709 NICs Michael Chan
@ 2010-04-27 21:28 ` Michael Chan
  2010-04-27 21:28   ` [PATCH 3/3] bnx2: Update version to 2.0.9 Michael Chan
  2010-04-27 21:38   ` [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan David Miller
  2010-04-27 21:38 ` [PATCH 1/3] bnx2: Fix lost MSI-X problem on 5709 NICs David Miller
  1 sibling, 2 replies; 6+ messages in thread
From: Michael Chan @ 2010-04-27 21:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, jfeeney

The bonding driver calls ndo_vlan_rx_register() while holding bond->lock.
The bnx2 driver calls bnx2_netif_stop() to stop the rx handling while
changing the vlgrp.  The call also stops the cnic driver which sleeps
while the bond->lock is held and cause the warning.

This code path only needs to stop the NAPI rx handling while we are
changing the vlgrp.  Since no reset is going to occur, there is no need
to stop cnic in this case.  By adding a parameter to bnx2_netif_stop()
to skip stopping cnic, we can avoid the warning.

Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/bnx2.c |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 4c1e51e..35eec2d 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -651,9 +651,10 @@ bnx2_napi_enable(struct bnx2 *bp)
 }
 
 static void
-bnx2_netif_stop(struct bnx2 *bp)
+bnx2_netif_stop(struct bnx2 *bp, bool stop_cnic)
 {
-	bnx2_cnic_stop(bp);
+	if (stop_cnic)
+		bnx2_cnic_stop(bp);
 	if (netif_running(bp->dev)) {
 		int i;
 
@@ -671,14 +672,15 @@ bnx2_netif_stop(struct bnx2 *bp)
 }
 
 static void
-bnx2_netif_start(struct bnx2 *bp)
+bnx2_netif_start(struct bnx2 *bp, bool start_cnic)
 {
 	if (atomic_dec_and_test(&bp->intr_sem)) {
 		if (netif_running(bp->dev)) {
 			netif_tx_wake_all_queues(bp->dev);
 			bnx2_napi_enable(bp);
 			bnx2_enable_int(bp);
-			bnx2_cnic_start(bp);
+			if (start_cnic)
+				bnx2_cnic_start(bp);
 		}
 	}
 }
@@ -6277,12 +6279,12 @@ bnx2_reset_task(struct work_struct *work)
 		return;
 	}
 
-	bnx2_netif_stop(bp);
+	bnx2_netif_stop(bp, true);
 
 	bnx2_init_nic(bp, 1);
 
 	atomic_set(&bp->intr_sem, 1);
-	bnx2_netif_start(bp);
+	bnx2_netif_start(bp, true);
 	rtnl_unlock();
 }
 
@@ -6324,7 +6326,7 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp)
 	struct bnx2 *bp = netdev_priv(dev);
 
 	if (netif_running(dev))
-		bnx2_netif_stop(bp);
+		bnx2_netif_stop(bp, false);
 
 	bp->vlgrp = vlgrp;
 
@@ -6335,7 +6337,7 @@ bnx2_vlan_rx_register(struct net_device *dev, struct vlan_group *vlgrp)
 	if (bp->flags & BNX2_FLAG_CAN_KEEP_VLAN)
 		bnx2_fw_sync(bp, BNX2_DRV_MSG_CODE_KEEP_VLAN_UPDATE, 0, 1);
 
-	bnx2_netif_start(bp);
+	bnx2_netif_start(bp, false);
 }
 #endif
 
@@ -7055,9 +7057,9 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
 	bp->stats_ticks &= BNX2_HC_STATS_TICKS_HC_STAT_TICKS;
 
 	if (netif_running(bp->dev)) {
-		bnx2_netif_stop(bp);
+		bnx2_netif_stop(bp, true);
 		bnx2_init_nic(bp, 0);
-		bnx2_netif_start(bp);
+		bnx2_netif_start(bp, true);
 	}
 
 	return 0;
@@ -7087,7 +7089,7 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx)
 		/* Reset will erase chipset stats; save them */
 		bnx2_save_stats(bp);
 
-		bnx2_netif_stop(bp);
+		bnx2_netif_stop(bp, true);
 		bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
 		bnx2_free_skbs(bp);
 		bnx2_free_mem(bp);
@@ -7115,7 +7117,7 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx)
 			bnx2_setup_cnic_irq_info(bp);
 		mutex_unlock(&bp->cnic_lock);
 #endif
-		bnx2_netif_start(bp);
+		bnx2_netif_start(bp, true);
 	}
 	return 0;
 }
@@ -7368,7 +7370,7 @@ bnx2_self_test(struct net_device *dev, struct ethtool_test *etest, u64 *buf)
 	if (etest->flags & ETH_TEST_FL_OFFLINE) {
 		int i;
 
-		bnx2_netif_stop(bp);
+		bnx2_netif_stop(bp, true);
 		bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_DIAG);
 		bnx2_free_skbs(bp);
 
@@ -7387,7 +7389,7 @@ bnx2_self_test(struct net_device *dev, struct ethtool_test *etest, u64 *buf)
 			bnx2_shutdown_chip(bp);
 		else {
 			bnx2_init_nic(bp, 1);
-			bnx2_netif_start(bp);
+			bnx2_netif_start(bp, true);
 		}
 
 		/* wait for link up */
@@ -8381,7 +8383,7 @@ bnx2_suspend(struct pci_dev *pdev, pm_message_t state)
 		return 0;
 
 	flush_scheduled_work();
-	bnx2_netif_stop(bp);
+	bnx2_netif_stop(bp, true);
 	netif_device_detach(dev);
 	del_timer_sync(&bp->timer);
 	bnx2_shutdown_chip(bp);
@@ -8403,7 +8405,7 @@ bnx2_resume(struct pci_dev *pdev)
 	bnx2_set_power_state(bp, PCI_D0);
 	netif_device_attach(dev);
 	bnx2_init_nic(bp, 1);
-	bnx2_netif_start(bp);
+	bnx2_netif_start(bp, true);
 	return 0;
 }
 
@@ -8430,7 +8432,7 @@ static pci_ers_result_t bnx2_io_error_detected(struct pci_dev *pdev,
 	}
 
 	if (netif_running(dev)) {
-		bnx2_netif_stop(bp);
+		bnx2_netif_stop(bp, true);
 		del_timer_sync(&bp->timer);
 		bnx2_reset_nic(bp, BNX2_DRV_MSG_CODE_RESET);
 	}
@@ -8487,7 +8489,7 @@ static void bnx2_io_resume(struct pci_dev *pdev)
 
 	rtnl_lock();
 	if (netif_running(dev))
-		bnx2_netif_start(bp);
+		bnx2_netif_start(bp, true);
 
 	netif_device_attach(dev);
 	rtnl_unlock();
-- 
1.6.4.GIT



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

* [PATCH 3/3] bnx2: Update version to 2.0.9.
  2010-04-27 21:28 ` [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan Michael Chan
@ 2010-04-27 21:28   ` Michael Chan
  2010-04-27 21:38     ` David Miller
  2010-04-27 21:38   ` [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Chan @ 2010-04-27 21:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, gospo, jfeeney

Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/bnx2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 35eec2d..ac90a38 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -58,8 +58,8 @@
 #include "bnx2_fw.h"
 
 #define DRV_MODULE_NAME		"bnx2"
-#define DRV_MODULE_VERSION	"2.0.8"
-#define DRV_MODULE_RELDATE	"Feb 15, 2010"
+#define DRV_MODULE_VERSION	"2.0.9"
+#define DRV_MODULE_RELDATE	"April 27, 2010"
 #define FW_MIPS_FILE_06		"bnx2/bnx2-mips-06-5.0.0.j6.fw"
 #define FW_RV2P_FILE_06		"bnx2/bnx2-rv2p-06-5.0.0.j3.fw"
 #define FW_MIPS_FILE_09		"bnx2/bnx2-mips-09-5.0.0.j9.fw"
-- 
1.6.4.GIT



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

* Re: [PATCH 1/3] bnx2: Fix lost MSI-X problem on 5709 NICs.
  2010-04-27 21:28 [PATCH 1/3] bnx2: Fix lost MSI-X problem on 5709 NICs Michael Chan
  2010-04-27 21:28 ` [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan Michael Chan
@ 2010-04-27 21:38 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2010-04-27 21:38 UTC (permalink / raw)
  To: mchan; +Cc: netdev, gospo, jfeeney

From: "Michael Chan" <mchan@broadcom.com>
Date: Tue, 27 Apr 2010 14:28:09 -0700

> It has been reported that under certain heavy traffic conditions in MSI-X
> mode, the driver can lose an MSI-X vector causing all packets in the
> associated rx/tx ring pair to be dropped.  The problem is caused by
> the chip dropping the write to unmask the MSI-X vector by the kernel
> (when migrating the IRQ for example).
> 
> This can be prevented by increasing the GRC timeout value for these
> register read and write operations.
> 
> Thanks to Dell for helping us debug this problem.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied to net-2.6

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

* Re: [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan.
  2010-04-27 21:28 ` [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan Michael Chan
  2010-04-27 21:28   ` [PATCH 3/3] bnx2: Update version to 2.0.9 Michael Chan
@ 2010-04-27 21:38   ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2010-04-27 21:38 UTC (permalink / raw)
  To: mchan; +Cc: netdev, gospo, jfeeney

From: "Michael Chan" <mchan@broadcom.com>
Date: Tue, 27 Apr 2010 14:28:10 -0700

> The bonding driver calls ndo_vlan_rx_register() while holding bond->lock.
> The bnx2 driver calls bnx2_netif_stop() to stop the rx handling while
> changing the vlgrp.  The call also stops the cnic driver which sleeps
> while the bond->lock is held and cause the warning.
> 
> This code path only needs to stop the NAPI rx handling while we are
> changing the vlgrp.  Since no reset is going to occur, there is no need
> to stop cnic in this case.  By adding a parameter to bnx2_netif_stop()
> to skip stopping cnic, we can avoid the warning.
> 
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied to net-2.6

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

* Re: [PATCH 3/3] bnx2: Update version to 2.0.9.
  2010-04-27 21:28   ` [PATCH 3/3] bnx2: Update version to 2.0.9 Michael Chan
@ 2010-04-27 21:38     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-04-27 21:38 UTC (permalink / raw)
  To: mchan; +Cc: netdev, gospo, jfeeney

From: "Michael Chan" <mchan@broadcom.com>
Date: Tue, 27 Apr 2010 14:28:11 -0700

> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied to net-2.6

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

end of thread, other threads:[~2010-04-27 21:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27 21:28 [PATCH 1/3] bnx2: Fix lost MSI-X problem on 5709 NICs Michael Chan
2010-04-27 21:28 ` [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan Michael Chan
2010-04-27 21:28   ` [PATCH 3/3] bnx2: Update version to 2.0.9 Michael Chan
2010-04-27 21:38     ` David Miller
2010-04-27 21:38   ` [PATCH 2/3] bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan David Miller
2010-04-27 21:38 ` [PATCH 1/3] bnx2: Fix lost MSI-X problem on 5709 NICs 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).