Skip to content

Commit

Permalink
mlx4: restore conditional call to napi_complete_done()
Browse files Browse the repository at this point in the history
After commit 1a28817 ("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: 1a28817 ("mlx4: use napi_complete_done()")
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 11, 2014
1 parent d21385f commit 2e1af7d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/net/ethernet/mellanox/mlx4/en_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2e1af7d

Please sign in to comment.