netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] enic: fix work done in tx napi_poll
@ 2014-11-12 22:42 Govindarajulu Varadarajan
  2014-11-12 23:44 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Govindarajulu Varadarajan @ 2014-11-12 22:42 UTC (permalink / raw)
  To: davem, netdev; +Cc: ssujith, Govindarajulu Varadarajan

With the commit d75b1ade567 ("net: less interrupt masking in NAPI") napi repoll
is done only when work_done == budget. In tx napi poll we always return 0.
So tx napi is not called again and we do not clean up the tx ring.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
---
 drivers/net/ethernet/cisco/enic/enic_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 73cf165..5afe360 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1312,9 +1312,10 @@ static int enic_poll_msix_wq(struct napi_struct *napi, int budget)
 	if (!wq_work_done) {
 		napi_complete(napi);
 		vnic_intr_unmask(&enic->intr[intr]);
+		return 0;
 	}
 
-	return 0;
+	return budget;
 }
 
 static int enic_poll_msix_rq(struct napi_struct *napi, int budget)
-- 
2.1.3

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

* Re: [PATCH net-next] enic: fix work done in tx napi_poll
  2014-11-12 22:42 [PATCH net-next] enic: fix work done in tx napi_poll Govindarajulu Varadarajan
@ 2014-11-12 23:44 ` Florian Fainelli
  2014-11-13  3:18   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2014-11-12 23:44 UTC (permalink / raw)
  To: Govindarajulu Varadarajan, davem, netdev
  Cc: ssujith, edumazet@google.com >> Eric Dumazet

On 11/12/2014 02:42 PM, Govindarajulu Varadarajan wrote:
> With the commit d75b1ade567 ("net: less interrupt masking in NAPI") napi repoll
> is done only when work_done == budget. In tx napi poll we always return 0.
> So tx napi is not called again and we do not clean up the tx ring.

Good catch, I had exactly the same bug in bcmsysport.c, sounds like
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c could also need a fix.

Thanks!

> 
> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
> ---
>  drivers/net/ethernet/cisco/enic/enic_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
> index 73cf165..5afe360 100644
> --- a/drivers/net/ethernet/cisco/enic/enic_main.c
> +++ b/drivers/net/ethernet/cisco/enic/enic_main.c
> @@ -1312,9 +1312,10 @@ static int enic_poll_msix_wq(struct napi_struct *napi, int budget)
>  	if (!wq_work_done) {
>  		napi_complete(napi);
>  		vnic_intr_unmask(&enic->intr[intr]);
> +		return 0;
>  	}
>  
> -	return 0;
> +	return budget;
>  }
>  
>  static int enic_poll_msix_rq(struct napi_struct *napi, int budget)
> 

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

* Re: [PATCH net-next] enic: fix work done in tx napi_poll
  2014-11-12 23:44 ` Florian Fainelli
@ 2014-11-13  3:18   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2014-11-13  3:18 UTC (permalink / raw)
  To: f.fainelli; +Cc: _govind, netdev, ssujith, edumazet

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Wed, 12 Nov 2014 15:44:06 -0800

> On 11/12/2014 02:42 PM, Govindarajulu Varadarajan wrote:
>> With the commit d75b1ade567 ("net: less interrupt masking in NAPI") napi repoll
>> is done only when work_done == budget. In tx napi poll we always return 0.
>> So tx napi is not called again and we do not clean up the tx ring.
> 
> Good catch, I had exactly the same bug in bcmsysport.c, sounds like
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c could also need a fix.
> 
> Thanks!
> 
>> 
>> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>

Applied, thanks everyone.

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

end of thread, other threads:[~2014-11-13  3:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12 22:42 [PATCH net-next] enic: fix work done in tx napi_poll Govindarajulu Varadarajan
2014-11-12 23:44 ` Florian Fainelli
2014-11-13  3:18   ` 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).