Skip to contentSkip to conversation

enic: fix work done in tx napi_poll

PATCH Applied Govindarajulu Varadarajan 3 participants 3 messages Nov 12, 2014 – Nov 13, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 enic: fix work done in tx napi_poll

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.

---
 drivers/net/ethernet/cisco/enic/enic_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/cisco/enic/enic_main.c +2 -1
index 73cf165..5afe360 100644
@@ -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)
Signature · 1 line
2.1.3
#1 lore raw
Quoted 3 lines · 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.

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!

Quoted 23 lines
---
 drivers/net/ethernet/cisco/enic/enic_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/cisco/enic/enic_main.c +2 -1
index 73cf165..5afe360 100644
@@ -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)
maintainer Applied
#2 lore raw

From: Florian Fainelli <[email protected]>
Date: Wed, 12 Nov 2014 15:44:06 -0800

Quoted 5 lines · Govindarajulu Varadarajan
Quoted 3 lines

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.

Quoted 7 lines

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!

Quoted 2 lines

Applied, thanks everyone.