Commit 0a779003 authored by Christian Marangi's avatar Christian Marangi Committed by Jakub Kicinski

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: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarChristian Marangi <ansuelsmth@gmail.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20231009133754.9834-2-ansuelsmth@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ef724517
...@@ -490,11 +490,18 @@ bool napi_schedule_prep(struct napi_struct *n); ...@@ -490,11 +490,18 @@ bool napi_schedule_prep(struct napi_struct *n);
* *
* Schedule NAPI poll routine to be called if it is not already * Schedule NAPI poll routine to be called if it is not already
* running. * 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); __napi_schedule(n);
return true;
}
return false;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment