summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDave Ertman <david.m.ertman@intel.com>2018-10-26 11:44:43 -0700
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-11-20 11:39:04 -0800
commite0c9fd9b77a7334032ec407d9e14d7c3cac1ac4f (patch)
tree127f72b7aba4e5ed2efd16e5c1d335dc2436497e /drivers
parent55aa141ed909711939ee4546b85d09d2f2894532 (diff)
downloadlinux-e0c9fd9b77a7334032ec407d9e14d7c3cac1ac4f.tar.bz2
ice: Fix return value from NAPI poll
ice_napi_poll is hard-coded to return zero when it's done. It should instead return the work done (if any work was done). The only time it should return zero is if an interrupt or poll is handled and no work is performed. So change the return value to be the minimum of work done or budget-1. Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_txrx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index fe5bbabbb41e..99954089a7fb 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1107,7 +1107,8 @@ int ice_napi_poll(struct napi_struct *napi, int budget)
napi_complete_done(napi, work_done);
if (test_bit(ICE_FLAG_MSIX_ENA, pf->flags))
ice_irq_dynamic_ena(&vsi->back->hw, vsi, q_vector);
- return 0;
+
+ return min(work_done, budget - 1);
}
/* helper function for building cmd/type/offset */