diff options
author | Eric Dumazet <edumazet@google.com> | 2016-11-15 13:15:13 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-16 13:40:58 -0500 |
commit | 364b6055738b4c752c30ccaaf25c624e69d76195 (patch) | |
tree | 4992c104a968cc42db4e45151426388845903ad3 /include/linux/netdevice.h | |
parent | 21cb84c48ca0619181106f0f44f3802a989de024 (diff) |
net: busy-poll: return busypolling status to drivers
NAPI drivers use napi_complete_done() or napi_complete() when
they drained RX ring and right before re-enabling device interrupts.
In busy polling, we can avoid interrupts being delivered since
we are polling RX ring in a controlled loop.
Drivers can chose to use napi_complete_done() return value
to reduce interrupts overhead while busy polling is active.
This is optional, legacy drivers should work fine even
if not updated.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Adam Belay <abelay@google.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Yuval Mintz <Yuval.Mintz@cavium.com>
Cc: Ariel Elior <ariel.elior@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index e71de66e3792..bcddf951ccee 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -463,16 +463,17 @@ static inline bool napi_reschedule(struct napi_struct *napi) | |||
463 | return false; | 463 | return false; |
464 | } | 464 | } |
465 | 465 | ||
466 | void __napi_complete(struct napi_struct *n); | 466 | bool __napi_complete(struct napi_struct *n); |
467 | void napi_complete_done(struct napi_struct *n, int work_done); | 467 | bool napi_complete_done(struct napi_struct *n, int work_done); |
468 | /** | 468 | /** |
469 | * napi_complete - NAPI processing complete | 469 | * napi_complete - NAPI processing complete |
470 | * @n: NAPI context | 470 | * @n: NAPI context |
471 | * | 471 | * |
472 | * Mark NAPI processing as complete. | 472 | * Mark NAPI processing as complete. |
473 | * Consider using napi_complete_done() instead. | 473 | * Consider using napi_complete_done() instead. |
474 | * Return false if device should avoid rearming interrupts. | ||
474 | */ | 475 | */ |
475 | static inline void napi_complete(struct napi_struct *n) | 476 | static inline bool napi_complete(struct napi_struct *n) |
476 | { | 477 | { |
477 | return napi_complete_done(n, 0); | 478 | return napi_complete_done(n, 0); |
478 | } | 479 | } |