aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <aduyck@mirantis.com>2015-09-24 12:04:26 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-10-16 07:26:33 -0400
commitc67caceb864cf15731532ab25162166c228fa270 (patch)
tree3b8a21efa80fb4834d50770ba7f7854b2a6bbb02
parent51161aa98d0aa4eb20952e16d6c6dbb1d085330e (diff)
i40e/i40evf: Fix handling of napi budget
The polling routine for i40e was rounding up the budget for Rx cleanup to 1. This is incorrect as the netpoll poll call is expecting no Rx to be processed as the budget passed was 0. Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_txrx.c5
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_txrx.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 01e5ece8046d..b560e0257ba6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1846,6 +1846,10 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
1846 ring->arm_wb = false; 1846 ring->arm_wb = false;
1847 } 1847 }
1848 1848
1849 /* Handle case where we are called by netpoll with a budget of 0 */
1850 if (budget <= 0)
1851 goto tx_only;
1852
1849 /* We attempt to distribute budget to each Rx queue fairly, but don't 1853 /* We attempt to distribute budget to each Rx queue fairly, but don't
1850 * allow the budget to go below 1 because that would exit polling early. 1854 * allow the budget to go below 1 because that would exit polling early.
1851 */ 1855 */
@@ -1862,6 +1866,7 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
1862 1866
1863 /* If work not completed, return budget and polling will return */ 1867 /* If work not completed, return budget and polling will return */
1864 if (!clean_complete) { 1868 if (!clean_complete) {
1869tx_only:
1865 if (arm_wb) 1870 if (arm_wb)
1866 i40e_force_wb(vsi, q_vector); 1871 i40e_force_wb(vsi, q_vector);
1867 return budget; 1872 return budget;
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index 0e71eb4633d5..1894cc8c0524 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1287,6 +1287,10 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)
1287 ring->arm_wb = false; 1287 ring->arm_wb = false;
1288 } 1288 }
1289 1289
1290 /* Handle case where we are called by netpoll with a budget of 0 */
1291 if (budget <= 0)
1292 goto tx_only;
1293
1290 /* We attempt to distribute budget to each Rx queue fairly, but don't 1294 /* We attempt to distribute budget to each Rx queue fairly, but don't
1291 * allow the budget to go below 1 because that would exit polling early. 1295 * allow the budget to go below 1 because that would exit polling early.
1292 */ 1296 */
@@ -1303,6 +1307,7 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)
1303 1307
1304 /* If work not completed, return budget and polling will return */ 1308 /* If work not completed, return budget and polling will return */
1305 if (!clean_complete) { 1309 if (!clean_complete) {
1310tx_only:
1306 if (arm_wb) 1311 if (arm_wb)
1307 i40evf_force_wb(vsi, q_vector); 1312 i40evf_force_wb(vsi, q_vector);
1308 return budget; 1313 return budget;