All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: octeon: Add prevent NAPI from scheduling
@ 2012-08-20 10:41 Marina Makienko
  2012-08-20 16:26 ` David Daney
  2012-08-20 17:00 ` [PATCH] staging: octeon: Add prevent NAPI from scheduling Max Filippov
  0 siblings, 2 replies; 5+ messages in thread
From: Marina Makienko @ 2012-08-20 10:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Marina Makienko, David Daney, Ralf Baechle, Roy.Li, devel,
	linux-kernel, ldv-project

Code inspection shows that this can
only be triggered by calling napi_enable() without
napi_disable().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Marina Makienko <makienko@ispras.ru>
---
 drivers/staging/octeon/ethernet-rx.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 34afc16..db81613 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -560,4 +560,5 @@ void cvm_oct_rx_shutdown(void)
 	/* Shutdown all of the NAPIs */
 	for_each_possible_cpu(i)
 		netif_napi_del(&cvm_oct_napi[i].napi);
+		napi_disable(&cvm_oct_napi[i].napi);
 }
-- 
1.7.7


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

* Re: [PATCH] staging: octeon: Add prevent NAPI from scheduling
  2012-08-20 10:41 [PATCH] staging: octeon: Add prevent NAPI from scheduling Marina Makienko
@ 2012-08-20 16:26 ` David Daney
  2012-08-21  7:48   ` [PATCH] staging: octeon: Add prevent NAPI from scheduling IN-REPLY-TO: Marina Makienko
  2012-08-21 11:18   ` Marina Makienko
  2012-08-20 17:00 ` [PATCH] staging: octeon: Add prevent NAPI from scheduling Max Filippov
  1 sibling, 2 replies; 5+ messages in thread
From: David Daney @ 2012-08-20 16:26 UTC (permalink / raw)
  To: Marina Makienko
  Cc: Greg Kroah-Hartman, David Daney, Ralf Baechle, Roy.Li, devel,
	linux-kernel, ldv-project

On 08/20/2012 03:41 AM, Marina Makienko wrote:
> Code inspection shows that this can
> only be triggered by calling napi_enable() without
> napi_disable().
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Marina Makienko <makienko@ispras.ru>
> ---
>   drivers/staging/octeon/ethernet-rx.c |    1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
> index 34afc16..db81613 100644
> --- a/drivers/staging/octeon/ethernet-rx.c
> +++ b/drivers/staging/octeon/ethernet-rx.c
> @@ -560,4 +560,5 @@ void cvm_oct_rx_shutdown(void)
>   	/* Shutdown all of the NAPIs */
>   	for_each_possible_cpu(i)
>   		netif_napi_del(&cvm_oct_napi[i].napi);
> +		napi_disable(&cvm_oct_napi[i].napi);


Does the order of netif_napi_del() and napi_disable() matter?  If so, 
does this patch have the correct ordering?

I don't really want to apply the patch until we know the answer to these 
two questions.

David Daney



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

* Re: [PATCH] staging: octeon: Add prevent NAPI from scheduling
  2012-08-20 10:41 [PATCH] staging: octeon: Add prevent NAPI from scheduling Marina Makienko
  2012-08-20 16:26 ` David Daney
@ 2012-08-20 17:00 ` Max Filippov
  1 sibling, 0 replies; 5+ messages in thread
From: Max Filippov @ 2012-08-20 17:00 UTC (permalink / raw)
  To: Marina Makienko
  Cc: Greg Kroah-Hartman, David Daney, Ralf Baechle, Roy.Li, devel,
	linux-kernel, ldv-project

On Mon, Aug 20, 2012 at 2:41 PM, Marina Makienko <makienko@ispras.ru> wrote:
> Code inspection shows that this can
> only be triggered by calling napi_enable() without
> napi_disable().
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Marina Makienko <makienko@ispras.ru>
> ---
>  drivers/staging/octeon/ethernet-rx.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
> index 34afc16..db81613 100644
> --- a/drivers/staging/octeon/ethernet-rx.c
> +++ b/drivers/staging/octeon/ethernet-rx.c
> @@ -560,4 +560,5 @@ void cvm_oct_rx_shutdown(void)
>         /* Shutdown all of the NAPIs */
>         for_each_possible_cpu(i)
>                 netif_napi_del(&cvm_oct_napi[i].napi);
> +               napi_disable(&cvm_oct_napi[i].napi);
>  }

Looks like napi_disable is meant to be inside for_each_possible_cpu loop,
but curly braces are missing.

-- 
Thanks.
-- Max

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

* [PATCH] staging: octeon: Add prevent NAPI from scheduling IN-REPLY-TO:
  2012-08-20 16:26 ` David Daney
@ 2012-08-21  7:48   ` Marina Makienko
  2012-08-21 11:18   ` Marina Makienko
  1 sibling, 0 replies; 5+ messages in thread
From: Marina Makienko @ 2012-08-21  7:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Marina Makienko, David Daney, Ralf Baechle, Roy.Li, devel,
	linux-kernel, ldv-project

There are netif_napi_add() and napi_enable() in for_each_possible_cpu
loop in function cvm_oct_rx_initialize(). So it's logical to add
napi_disable() in for_each_possible_cpu loop in function
cvm_oct_rx_shutdown().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Marina Makienko <makienko@ispras.ru>
---
 drivers/staging/octeon/ethernet-rx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 34afc16..e5b62fc 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -558,6 +558,8 @@ void cvm_oct_rx_shutdown(void)
 {
 	int i;
 	/* Shutdown all of the NAPIs */
-	for_each_possible_cpu(i)
+	for_each_possible_cpu(i) {
 		netif_napi_del(&cvm_oct_napi[i].napi);
+		napi_disable(&cvm_oct_napi[i].napi);
+	}
 }
-- 
1.7.7


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

* [PATCH] staging: octeon: Add prevent NAPI from scheduling IN-REPLY-TO:
  2012-08-20 16:26 ` David Daney
  2012-08-21  7:48   ` [PATCH] staging: octeon: Add prevent NAPI from scheduling IN-REPLY-TO: Marina Makienko
@ 2012-08-21 11:18   ` Marina Makienko
  1 sibling, 0 replies; 5+ messages in thread
From: Marina Makienko @ 2012-08-21 11:18 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Marina Makienko, David Daney, Ralf Baechle, Roy.Li, devel,
	linux-kernel, ldv-project

Please ignore previous message.

-- 
1.7.7


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

end of thread, other threads:[~2012-08-21 11:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-20 10:41 [PATCH] staging: octeon: Add prevent NAPI from scheduling Marina Makienko
2012-08-20 16:26 ` David Daney
2012-08-21  7:48   ` [PATCH] staging: octeon: Add prevent NAPI from scheduling IN-REPLY-TO: Marina Makienko
2012-08-21 11:18   ` Marina Makienko
2012-08-20 17:00 ` [PATCH] staging: octeon: Add prevent NAPI from scheduling Max Filippov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.