lkml.org 
[lkml]   [2023]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [net-next PATCH 2/4] netdev: make napi_schedule return bool on NAPI successful schedule
From
On 10/2/2023 8:10 AM, Christian Marangi wrote:
> Change napi_schedule to return a bool on NAPI successful schedule. This
> might be useful for some driver to do additional step after a NAPI ahs

nit:s/ahs/has/

> been scheduled.
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
> include/linux/netdevice.h | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 7e520c14eb8c..2bead8e2a14d 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;
> }
>
> /**

\
 
 \ /
  Last update: 2023-10-02 18:10    [W:0.134 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site