* [net patch 0/2] bnx2x: Correct bnx2x operation with netpoll
@ 2012-08-27 13:26 Merav Sicron
2012-08-27 13:26 ` [net patch 1/2] bnx2x: Move netif_napi_add to the open call Merav Sicron
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Merav Sicron @ 2012-08-27 13:26 UTC (permalink / raw)
To: davem, netdev, eilong; +Cc: Merav Sicron
Hi Dave,
This patch series corrects bnx2x operation with netpoll:
The first patch is to move the netif_napi_add to the open call to avoid napi
objects that are added but may not be later enabled.
The second patch corrects the poll_bnx2x function itself to also work with
MSI-X.
Please consider applying this patch series to net.
Thanks,
Merav
^ permalink raw reply [flat|nested] 4+ messages in thread
* [net patch 1/2] bnx2x: Move netif_napi_add to the open call
2012-08-27 13:26 [net patch 0/2] bnx2x: Correct bnx2x operation with netpoll Merav Sicron
@ 2012-08-27 13:26 ` Merav Sicron
2012-08-27 13:26 ` [net patch 2/2] bnx2x: Correct the ndo_poll_controller call Merav Sicron
2012-08-30 17:37 ` [net patch 0/2] bnx2x: Correct bnx2x operation with netpoll David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Merav Sicron @ 2012-08-27 13:26 UTC (permalink / raw)
To: davem, netdev, eilong; +Cc: Merav Sicron, Dmitry Kravkov
Move netif_napi_add for all queues from the probe call to the open call, to
avoid the case that napi objects are added for queues that may eventually not
be initialized and activated. With the former behavior, the driver could crash
when netpoll was calling ndo_poll_controller.
Signed-off-by: Merav Sicron <meravs@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 3 ---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 4 ++++
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 4 ++--
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 2 --
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 10 ++++------
5 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 77bcd4c..a462cbc 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -1708,9 +1708,6 @@ struct bnx2x_func_init_params {
continue; \
else
-#define for_each_napi_rx_queue(bp, var) \
- for ((var) = 0; (var) < bp->num_napi_queues; (var)++)
-
/* Skip OOO FP */
#define for_each_tx_queue(bp, var) \
for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index e879e19..af20c6e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2046,6 +2046,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
*/
bnx2x_setup_tc(bp->dev, bp->max_cos);
+ /* Add all NAPI objects */
+ bnx2x_add_all_napi(bp);
bnx2x_napi_enable(bp);
/* set pf load just before approaching the MCP */
@@ -2408,6 +2410,8 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
/* Disable HW interrupts, NAPI */
bnx2x_netif_stop(bp, 1);
+ /* Delete all NAPI objects */
+ bnx2x_del_all_napi(bp);
/* Release IRQs */
bnx2x_free_irq(bp);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index dfa757e..21b5532 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -792,7 +792,7 @@ static inline void bnx2x_add_all_napi(struct bnx2x *bp)
bp->num_napi_queues = bp->num_queues;
/* Add NAPI objects */
- for_each_napi_rx_queue(bp, i)
+ for_each_rx_queue(bp, i)
netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi),
bnx2x_poll, BNX2X_NAPI_WEIGHT);
}
@@ -801,7 +801,7 @@ static inline void bnx2x_del_all_napi(struct bnx2x *bp)
{
int i;
- for_each_napi_rx_queue(bp, i)
+ for_each_rx_queue(bp, i)
netif_napi_del(&bnx2x_fp(bp, i, napi));
}
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index fc4e0e3..c37a68d 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -2888,11 +2888,9 @@ static void bnx2x_get_channels(struct net_device *dev,
*/
static void bnx2x_change_num_queues(struct bnx2x *bp, int num_rss)
{
- bnx2x_del_all_napi(bp);
bnx2x_disable_msi(bp);
BNX2X_NUM_QUEUES(bp) = num_rss + NON_ETH_CONTEXT_USE;
bnx2x_set_int_mode(bp);
- bnx2x_add_all_napi(bp);
}
/**
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index dd451c3..f6d6baf 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -8441,6 +8441,8 @@ unload_error:
/* Disable HW interrupts, NAPI */
bnx2x_netif_stop(bp, 1);
+ /* Delete all NAPI objects */
+ bnx2x_del_all_napi(bp);
/* Release IRQs */
bnx2x_free_irq(bp);
@@ -11915,9 +11917,6 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
*/
bnx2x_set_int_mode(bp);
- /* Add all NAPI objects */
- bnx2x_add_all_napi(bp);
-
rc = register_netdev(dev);
if (rc) {
dev_err(&pdev->dev, "Cannot register net device\n");
@@ -11992,9 +11991,6 @@ static void __devexit bnx2x_remove_one(struct pci_dev *pdev)
unregister_netdev(dev);
- /* Delete all NAPI objects */
- bnx2x_del_all_napi(bp);
-
/* Power on: we can't let PCI layer write to us while we are in D3 */
bnx2x_set_power_state(bp, PCI_D0);
@@ -12041,6 +12037,8 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
bnx2x_tx_disable(bp);
bnx2x_netif_stop(bp, 0);
+ /* Delete all NAPI objects */
+ bnx2x_del_all_napi(bp);
del_timer_sync(&bp->timer);
--
1.7.10
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [net patch 2/2] bnx2x: Correct the ndo_poll_controller call
2012-08-27 13:26 [net patch 0/2] bnx2x: Correct bnx2x operation with netpoll Merav Sicron
2012-08-27 13:26 ` [net patch 1/2] bnx2x: Move netif_napi_add to the open call Merav Sicron
@ 2012-08-27 13:26 ` Merav Sicron
2012-08-30 17:37 ` [net patch 0/2] bnx2x: Correct bnx2x operation with netpoll David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Merav Sicron @ 2012-08-27 13:26 UTC (permalink / raw)
To: davem, netdev, eilong; +Cc: Merav Sicron, Dmitry Kravkov
This patch correct poll_bnx2x (ndo_poll_controller call) which was not
functioning well with MSI-X.
Signed-off-by: Merav Sicron <meravs@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index f6d6baf..ce03456 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -11244,10 +11244,12 @@ static int bnx2x_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static void poll_bnx2x(struct net_device *dev)
{
struct bnx2x *bp = netdev_priv(dev);
+ int i;
- disable_irq(bp->pdev->irq);
- bnx2x_interrupt(bp->pdev->irq, dev);
- enable_irq(bp->pdev->irq);
+ for_each_eth_queue(bp, i) {
+ struct bnx2x_fastpath *fp = &bp->fp[i];
+ napi_schedule(&bnx2x_fp(bp, fp->index, napi));
+ }
}
#endif
--
1.7.10---
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net patch 0/2] bnx2x: Correct bnx2x operation with netpoll
2012-08-27 13:26 [net patch 0/2] bnx2x: Correct bnx2x operation with netpoll Merav Sicron
2012-08-27 13:26 ` [net patch 1/2] bnx2x: Move netif_napi_add to the open call Merav Sicron
2012-08-27 13:26 ` [net patch 2/2] bnx2x: Correct the ndo_poll_controller call Merav Sicron
@ 2012-08-30 17:37 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-08-30 17:37 UTC (permalink / raw)
To: meravs; +Cc: netdev, eilong
From: "Merav Sicron" <meravs@broadcom.com>
Date: Mon, 27 Aug 2012 16:26:18 +0300
> Hi Dave,
> This patch series corrects bnx2x operation with netpoll:
> The first patch is to move the netif_napi_add to the open call to avoid napi
> objects that are added but may not be later enabled.
> The second patch corrects the poll_bnx2x function itself to also work with
> MSI-X.
>
> Please consider applying this patch series to net.
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-08-30 17:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-27 13:26 [net patch 0/2] bnx2x: Correct bnx2x operation with netpoll Merav Sicron
2012-08-27 13:26 ` [net patch 1/2] bnx2x: Move netif_napi_add to the open call Merav Sicron
2012-08-27 13:26 ` [net patch 2/2] bnx2x: Correct the ndo_poll_controller call Merav Sicron
2012-08-30 17:37 ` [net patch 0/2] bnx2x: Correct bnx2x operation with netpoll 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).