From: Eric Dumazet Date: Mon, 10 Nov 2014 22:07:20 +0000 (-0800) Subject: mlx4: restore conditional call to napi_complete_done() X-Git-Tag: v5.15~16721^2~230 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e1af7d74f4f7b4d4c1b0fbf5da3b5f92d9c332f;p=platform%2Fkernel%2Flinux-starfive.git 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 Fixes: 1a28817282 ("mlx4: use napi_complete_done()") Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index 46ee783..5a193f4 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) cpu_curr = smp_processor_id(); aff = irq_desc_get_irq_data(cq->irq_desc)->affinity; - if (unlikely(!cpumask_test_cpu(cpu_curr, aff))) { - /* Current cpu is not according to smp_irq_affinity - - * probably affinity changed. need to stop this NAPI - * poll, and restart it on the right CPU - */ - done = 0; - } + if (likely(cpumask_test_cpu(cpu_curr, aff))) + return budget; + + /* Current cpu is not according to smp_irq_affinity - + * probably affinity changed. need to stop this NAPI + * poll, and restart it on the right CPU + */ + done = 0; } /* Done for now */ napi_complete_done(napi, done);