fm10k: Fix handling of NAPI budget when multiple queues are enabled per vector
authorAlexander Duyck <aduyck@mirantis.com>
Tue, 22 Sep 2015 21:35:35 +0000 (14:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2016 06:27:39 +0000 (08:27 +0200)
[ Upstream commit 9f872986479b6e0543eb5c615e5f9491bb04e5c1 ]

This patch corrects an issue in which the polling routine would increase
the budget for Rx to at least 1 per queue if multiple queues were present.
This would result in Rx packets being processed when the budget was 0 which
is meant to indicate that no Rx can be handled.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/fm10k/fm10k_main.c

index e76a44cf330cd47d57084a05fd69611985a79e15..746a1986690b1828be5120bf63f5297777d7b26b 100644 (file)
@@ -1428,6 +1428,10 @@ static int fm10k_poll(struct napi_struct *napi, int budget)
        fm10k_for_each_ring(ring, q_vector->tx)
                clean_complete &= fm10k_clean_tx_irq(q_vector, ring);
 
+       /* Handle case where we are called by netpoll with a budget of 0 */
+       if (budget <= 0)
+               return budget;
+
        /* attempt to distribute budget to each queue fairly, but don't
         * allow the budget to go below 1 because we'll exit polling
         */