aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-11-10 17:07:20 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-10 21:09:03 -0500
commit2e1af7d74f4f7b4d4c1b0fbf5da3b5f92d9c332f (patch)
treebb3897b6254475a5170fda29b9355cf7af678dfb
parentd21385fadabf249afd2e288a1eae1f093ce9fa38 (diff)
mlx4: restore conditional call to napi_complete_done()
After commit 1a28817282 ("mlx4: use napi_complete_done()") we ended up calling napi_complete_done() in the case NAPI poll consumed all its budget. This added extra interrupt pressure, this patch restores proper behavior. Signed-off-by: Eric Dumazet <edumazet@google.com> Fixes: 1a28817282 ("mlx4: use napi_complete_done()") Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_rx.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 46ee78326f1f..5a193f40a14c 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -910,13 +910,14 @@ int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget)
910 cpu_curr = smp_processor_id(); 910 cpu_curr = smp_processor_id();
911 aff = irq_desc_get_irq_data(cq->irq_desc)->affinity; 911 aff = irq_desc_get_irq_data(cq->irq_desc)->affinity;
912 912
913 if (unlikely(!cpumask_test_cpu(cpu_curr, aff))) { 913 if (likely(cpumask_test_cpu(cpu_curr, aff)))
914 /* Current cpu is not according to smp_irq_affinity - 914 return budget;
915 * probably affinity changed. need to stop this NAPI 915
916 * poll, and restart it on the right CPU 916 /* Current cpu is not according to smp_irq_affinity -
917 */ 917 * probably affinity changed. need to stop this NAPI
918 done = 0; 918 * poll, and restart it on the right CPU
919 } 919 */
920 done = 0;
920 } 921 }
921 /* Done for now */ 922 /* Done for now */
922 napi_complete_done(napi, done); 923 napi_complete_done(napi, done);