be2net: call napi_disable() for all event queues
Subsystems (3)
PATCH 1/1 be2net: call napi_disable() for all event queues
The recent be2net commit 6384a4d (adds a support for busy polling) introduces a regression that results in kernel crash. It incorrectly modified be_close() so napi_disable() is called only for the first queue. This breaks a correct pairing of napi_enable/_disable for the rest of event queues and causes a crash in subsequent be_open() call.
--- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/emulex/benet/be_main.c +1 -1
@@ -2663,8 +2663,8 @@ static int be_close(struct net_device *netdev)napi_disable (&eqo->napi);be_disable_busy_poll (eqo); } - adapter->flags &= ~BE_FLAGS_NAPI_ENABLED ; } + adapter->flags &= ~BE_FLAGS_NAPI_ENABLED ;be_async_mcc_disable (adapter);
Signature · 1 line
1.8.3.2
Quoted 13 lines
-----Original Message-----
From: Ivan Vecera [mailto:[email protected]]
Sent: Tuesday, November 26, 2013 10:55 AM
To: [email protected]
Cc: Sathya Perla; Subramanian Seetharaman; Ajit Khaparde
Subject: [PATCH net] be2net: callnapi_disable()for all event queuesThe recent be2net commit 6384a4d (adds a support for busy polling) introduces a regression that results in kernel crash. It incorrectly modified
be_close()sonapi_disable()is called only for the first queue. This breaks a correct pairing of napi_enable/_disable for the rest of event queues and causes a crash in subsequentbe_open()call.
Quoted 4 lines
Cc Sathya Perla <[email protected]>Cc Subbu Seetharaman <[email protected]>Cc Ajit Khaparde <[email protected]>Signed-off-by Ivan Vecera <[email protected]>
Quoted 21 lines
--- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/emulex/benet/be_main.c +1
-2@@ -2663,8 +2663,8 @@ static int be_close(struct net_device *netdev)napi_disable (&eqo->napi);be_disable_busy_poll (eqo); } - adapter->flags &= ~BE_FLAGS_NAPI_ENABLED ; } + adapter->flags &= ~BE_FLAGS_NAPI_ENABLED ;be_async_mcc_disable (adapter); --1.8.3.2
Quoted 23 lines
-----Original Message-----
From: Ivan Vecera [mailto:[email protected]]The recent be2net commit 6384a4d (adds a support for busy polling) introduces a regression that results in kernel crash. It incorrectly modified
be_close()sonapi_disable()is called only for the first queue. This breaks a correct pairing of napi_enable/_disable for the rest of event queues and causes a crash in subsequentbe_open()call.Cc Sathya Perla <[email protected]>Cc Subbu Seetharaman <[email protected]>Cc Ajit Khaparde <[email protected]>Signed-off-by Ivan Vecera <[email protected]>--- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/emulex/benet/be_main.c +0
-0
drivers/net/ethernet/emulex/benet/be_main.c static int be_close(struct net_device *netdev) · line 2668
Quoted 7 lines
drivers/net/ethernet/emulex/benet/be_main.c +1
-1@@ -2663,8 +2663,8 @@ static int be_close(struct net_device *netdev)napi_disable (&eqo->napi);be_disable_busy_poll (eqo); } - adapter->flags &= ~BE_FLAGS_NAPI_ENABLED ; } + adapter->flags &= ~BE_FLAGS_NAPI_ENABLED ;
Ivan, Thanks for spotting this.
Your fix is correct but it'll be nice if the for-loop for napi_disable is not even entered when FLAGS_NAPI_ENABLED is not set, as in:
drivers/net/ethernet/emulex/benet/be_main.c +2 -2
@@ -2658,8 +2658,8 @@ static int be_close(struct net_device *netdev)be_roce_dev_close (adapter); - for_all_evt_queues(adapter, eqo, i) { -if (adapter->flags &BE_FLAGS_NAPI_ENABLED ) { +if (adapter->flags &BE_FLAGS_NAPI_ENABLED ) { + for_all_evt_queues(adapter, eqo, i) {napi_disable (&eqo->napi);be_disable_busy_poll (eqo); }
Could you also add the following line to your patch as it fixes a regression caused by an older be2net commit:
-Sathya
Quoted 51 lines · Sathya Perla
Quoted 23 lines
-----Original Message-----
From: Ivan Vecera [mailto:[email protected]]The recent be2net commit 6384a4d (adds a support for busy polling) introduces a regression that results in kernel crash. It incorrectly modified
be_close()sonapi_disable()is called only for the first queue. This breaks a correct pairing of napi_enable/_disable for the rest of event queues and causes a crash in subsequentbe_open()call.Cc Sathya Perla <[email protected]>Cc Subbu Seetharaman <[email protected]>Cc Ajit Khaparde <[email protected]>Signed-off-by Ivan Vecera <[email protected]>--- drivers/net/ethernet/emulex/benet/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/emulex/benet/be_main.c +0
-0drivers/net/ethernet/emulex/benet/be_main.c static int be_close(struct net_device *netdev) · line 2668
Quoted 7 lines
drivers/net/ethernet/emulex/benet/be_main.c +1
-1@@ -2663,8 +2663,8 @@ static int be_close(struct net_device *netdev)napi_disable (&eqo->napi);be_disable_busy_poll (eqo); } - adapter->flags &= ~BE_FLAGS_NAPI_ENABLED ; } + adapter->flags &= ~BE_FLAGS_NAPI_ENABLED ;Ivan, Thanks for spotting this.
Your fix is correct but it'll be nice if the for-loop fornapi_disableis not even entered whenFLAGS_NAPI_ENABLEDis not set, as in:drivers/net/ethernet/emulex/benet/be_main.c +2
-2@@ -2658,8 +2658,8 @@ static int be_close(struct net_device *netdev)be_roce_dev_close (adapter); - for_all_evt_queues(adapter, eqo, i) { -if (adapter->flags &BE_FLAGS_NAPI_ENABLED ) { +if (adapter->flags &BE_FLAGS_NAPI_ENABLED ) { + for_all_evt_queues(adapter, eqo, i) {napi_disable (&eqo->napi);be_disable_busy_poll (eqo); }
Quoted 4 lines
Could you also add the following line to your patch as it fixes a regression caused by an older be2net commit:
Fixes 6384a4d0dcf9 ("be2net: add support for ndo_busy_poll")
Sure, I'm sending v2.
Ivan