Welcome! Log In Create A New Profile Recent Messages

Advanced

[PATCH] staging: octeon: Add prevent NAPI from scheduling

Posted by Marina Makienko 
Marina Makienko
[PATCH] staging: octeon: Add prevent NAPI from scheduling
August 21, 2012 02:46AM
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.napi);
+ napi_disable(&cvm_oct_napi.napi);
}
--
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at [vger.kernel.org]
Please read the FAQ at [www.tux.org]
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.napi);
> + napi_disable(&cvm_oct_napi.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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at [vger.kernel.org]
Please read the FAQ at [www.tux.org]
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.napi);
> + napi_disable(&cvm_oct_napi.napi);
> }

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

--
Thanks.
-- Max
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at [vger.kernel.org]
Please read the FAQ at [www.tux.org]
Sorry, you do not have permission to post/reply in this forum.