Subject: Re: [PATCH net-next 1/5] net: napi: Make napi_defer_hard_irqs per-NAPI

From: Simon Horman <[email-masked]>
Date: Fri, 30 Aug 2024 09:36:41 +0100

On Thu, Aug 29, 2024 at 01:11:57PM +0000, Joe Damato wrote:
> Allow per-NAPI defer_hard_irqs setting.
> 
> The existing sysfs parameter is respected; writes to sysfs will write to
> all NAPI structs for the device and the net_device defer_hard_irq field.
> Reads from sysfs will read from the net_device field.
> 
> sysfs code was updated to guard against what appears to be a potential
> overflow as the field is an int, but the value passed in is an unsigned
> long.
> 
> The ability to set defer_hard_irqs on specific NAPI instances will be
> added in a later commit, via netdev-genl.
> 
> Signed-off-by: Joe Damato <[email-masked]>
> Reviewed-by: Martin Karsten <[email-masked]>
> Tested-by: Martin Karsten <[email-masked]>
> ---
>  include/linux/netdevice.h | 23 +++++++++++++++++++++++
>  net/core/dev.c            | 29 ++++++++++++++++++++++++++---
>  net/core/net-sysfs.c      |  5 ++++-
>  3 files changed, 53 insertions(+), 4 deletions(-)

...

> @@ -534,6 +535,28 @@ static inline void napi_schedule_irqoff(struct napi_struct *n)
>  		__napi_schedule_irqoff(n);
>  }
>  
> +/**
> + * napi_get_defer_hard_irqs - get the NAPI's defer_hard_irqs
> + * @n: napi struct to get the defer_hard_irqs field from
> + *
> + * Returns the per-NAPI value of the defar_hard_irqs field.
> + */
> +int napi_get_defer_hard_irqs(const struct napi_struct *n);

Hi Joe,

As it looks like there will be a v2 anyway, a minor nit from my side.

Thanks for documenting the return value, but I believe that
./scripts/kernel-doc -none -Wall expects "Return: " or "Returns: "

Likewise in patch 3/5.

...