]> git.karo-electronics.de Git - linux-beck.git/commitdiff
i40e/i40evf: napi_poll must return the work done
authorAlexander Duyck <alexander.h.duyck@intel.com>
Tue, 8 Nov 2016 21:05:16 +0000 (13:05 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 7 Dec 2016 04:46:13 +0000 (20:46 -0800)
Currently the function i40e_napi-poll() returns 0 when it clean completely
the Rx rings, but this foul budget accounting in core code.

Fix this by returning the actual work done, capped to budget - 1, since
the core doesn't allow to return the full budget when the driver modifies
the NAPI status

This is based on a similar change that was made for the ixgbe driver by
Paolo Abeni.

Change-ID: Ic3d93ad2fa2fc8ce3164bc461e69367da0f9173b
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

index 5544b509832feb39e12af93010f69d6e6b5b4e86..352cf7cd2ef4bd3fbc81819b5cc3bdc095f52b8d 100644 (file)
@@ -2027,7 +2027,7 @@ tx_only:
        else
                i40e_update_enable_itr(vsi, q_vector);
 
-       return 0;
+       return min(work_done, budget - 1);
 }
 
 /**
index c4b174afd253d69ac2cd556e22d6ad2f46c318ad..df67ef37b7f3c8c7f1e94fdb8ffe492a406b5049 100644 (file)
@@ -1490,7 +1490,7 @@ tx_only:
        else
                i40e_update_enable_itr(vsi, q_vector);
 
-       return 0;
+       return min(work_done, budget - 1);
 }
 
 /**