]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e/i40evf: Fix handling of napi budget
authorAlexander Duyck <aduyck@mirantis.com>
Thu, 24 Sep 2015 16:04:26 +0000 (09:04 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:32:47 +0000 (08:32 -0800)
Orabug: 22342532

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>
(cherry picked from commit c67caceb864cf15731532ab25162166c228fa270)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

index aaac366c56acc9944ecafa9f619f1abead7b9a6b..195e0ed5dd2028a160a60ba4ae71b729521bd287 100644 (file)
@@ -1848,6 +1848,10 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
                ring->arm_wb = false;
        }
 
+       /* Handle case where we are called by netpoll with a budget of 0 */
+       if (budget <= 0)
+               goto tx_only;
+
        /* We attempt to distribute budget to each Rx queue fairly, but don't
         * allow the budget to go below 1 because that would exit polling early.
         */
@@ -1864,6 +1868,7 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
 
        /* If work not completed, return budget and polling will return */
        if (!clean_complete) {
+tx_only:
                if (arm_wb)
                        i40e_force_wb(vsi, q_vector);
                return budget;
index acaf58b4e39e3a133b2b0495616b51c16c088f50..e4e93824f24a1b16cafae922815646d607f6d1db 100644 (file)
@@ -1289,6 +1289,10 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)
                ring->arm_wb = false;
        }
 
+       /* Handle case where we are called by netpoll with a budget of 0 */
+       if (budget <= 0)
+               goto tx_only;
+
        /* We attempt to distribute budget to each Rx queue fairly, but don't
         * allow the budget to go below 1 because that would exit polling early.
         */
@@ -1305,6 +1309,7 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)
 
        /* If work not completed, return budget and polling will return */
        if (!clean_complete) {
+tx_only:
                if (arm_wb)
                        i40evf_force_wb(vsi, q_vector);
                return budget;