diff options
author | Christian Marangi <ansuelsmth@gmail.com> | 2023-10-09 15:37:51 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-10-12 02:28:05 +0200 |
commit | 0a779003213b589d7b3eef72f69e19a30f603ebc (patch) | |
tree | 8b72a8ed8b2b7e69cef34c9e8ab5c81d92e1f4c2 | |
parent | netdev: replace simple napi_schedule_prep/__napi_schedule to napi_schedule (diff) | |
download | linux-0a779003213b589d7b3eef72f69e19a30f603ebc.tar.xz linux-0a779003213b589d7b3eef72f69e19a30f603ebc.zip |
netdev: make napi_schedule return bool on NAPI successful schedule
Change napi_schedule to return a bool on NAPI successful schedule.
This might be useful for some driver to do additional steps after a
NAPI has been scheduled.
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20231009133754.9834-2-ansuelsmth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | include/linux/netdevice.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 11d704bfec9b..2874770a0a74 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -490,11 +490,18 @@ bool napi_schedule_prep(struct napi_struct *n); * * Schedule NAPI poll routine to be called if it is not already * running. + * Return true if we schedule a NAPI or false if not. + * Refer to napi_schedule_prep() for additional reason on why + * a NAPI might not be scheduled. */ -static inline void napi_schedule(struct napi_struct *n) +static inline bool napi_schedule(struct napi_struct *n) { - if (napi_schedule_prep(n)) + if (napi_schedule_prep(n)) { __napi_schedule(n); + return true; + } + + return false; } /** |