From: Jacob Keller Date: Mon, 20 Jun 2016 17:39:32 +0000 (-0700) Subject: fm10k: NAPI polling routine must return actual work done X-Git-Tag: v4.1.12-92~3^2~95 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ad82146f49454c86402d942281a81324b596b58d;p=users%2Fjedix%2Flinux-maple.git fm10k: NAPI polling routine must return actual work done When fm10k_poll fully cleans rings it returns 0. This is incorrect as it messes up the budget accounting in the core NAPI code. Fix this by returning actual work done, capped at budget - 1 since the core doesn't expect a return of the full budget when the driver modifies the NAPI status. Cc: Paolo Abeni Cc: Venkatesh Srinivas Signed-off-by: Jacob Keller Acked-by: Paolo Abeni Tested-by: Krishneil Singh Signed-off-by: Jeff Kirsher Orabug: 25394529 (cherry picked from commit e5fbfb78641ff0c5139ae665289ed9f91524265e) Signed-off-by: Jack Vogel --- diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c index f5a5bf910a889..91b4e7951049f 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c @@ -1500,7 +1500,7 @@ static int fm10k_poll(struct napi_struct *napi, int budget) /* re-enable the q_vector */ fm10k_qv_enable(q_vector); - return 0; + return min(work_done, budget - 1); } /**