public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2] be2net: call napi_disable() for all event queues
@ 2013-11-27  7:59 Ivan Vecera
  2013-11-27 10:08 ` Sathya Perla
  2013-11-28 23:51 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ivan Vecera @ 2013-11-27  7:59 UTC (permalink / raw)
  To: netdev; +Cc: Sathya Perla, Subbu Seetharaman, Ajit Khaparde

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.

v2: Applied suggestions from Sathya

Fixes: 6384a4d ("be2net: add support for ndo_busy_poll")
Cc: Sathya Perla <sathya.perla@emulex.com>
Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 78a0e85..fee64bf 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -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);
 		}
-- 
1.8.3.2

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

* RE: [PATCH net v2] be2net: call napi_disable() for all event queues
  2013-11-27  7:59 [PATCH net v2] be2net: call napi_disable() for all event queues Ivan Vecera
@ 2013-11-27 10:08 ` Sathya Perla
  2013-11-28 23:51 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Sathya Perla @ 2013-11-27 10:08 UTC (permalink / raw)
  To: Ivan Vecera, netdev@vger.kernel.org
  Cc: Subramanian Seetharaman, Ajit Khaparde

> -----Original Message-----
> From: Ivan Vecera [mailto:ivecera@redhat.com]
> 
> 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.
> 
> v2: Applied suggestions from Sathya
> 
> Fixes: 6384a4d ("be2net: add support for ndo_busy_poll")
> Cc: Sathya Perla <sathya.perla@emulex.com>
> Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
> Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>

Acked-by: Sathya Perla <sathya.perla@emulex.com>

> ---
>  drivers/net/ethernet/emulex/benet/be_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c
> b/drivers/net/ethernet/emulex/benet/be_main.c
> index 78a0e85..fee64bf 100644
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -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);
>  		}
> --
> 1.8.3.2

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

* Re: [PATCH net v2] be2net: call napi_disable() for all event queues
  2013-11-27  7:59 [PATCH net v2] be2net: call napi_disable() for all event queues Ivan Vecera
  2013-11-27 10:08 ` Sathya Perla
@ 2013-11-28 23:51 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2013-11-28 23:51 UTC (permalink / raw)
  To: ivecera; +Cc: netdev, sathya.perla, subbu.seetharaman, ajit.khaparde

From: Ivan Vecera <ivecera@redhat.com>
Date: Wed, 27 Nov 2013 08:59:32 +0100

> 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.
> 
> v2: Applied suggestions from Sathya
> 
> Fixes: 6384a4d ("be2net: add support for ndo_busy_poll")
> Cc: Sathya Perla <sathya.perla@emulex.com>
> Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
> Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>

Applied, thanks.

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

end of thread, other threads:[~2013-11-28 23:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27  7:59 [PATCH net v2] be2net: call napi_disable() for all event queues Ivan Vecera
2013-11-27 10:08 ` Sathya Perla
2013-11-28 23:51 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox