Thread (48 messages) 48 messages, 7 authors, 2024-09-09

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

From: Simon Horman <horms@kernel.org>
Date: 2024-08-30 08:36:47
Also in: lkml

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 <redacted>
Reviewed-by: Martin Karsten <redacted>
Tested-by: Martin Karsten <redacted>
---
 include/linux/netdevice.h | 23 +++++++++++++++++++++++
 net/core/dev.c            | 29 ++++++++++++++++++++++++++---
 net/core/net-sysfs.c      |  5 ++++-
 3 files changed, 53 insertions(+), 4 deletions(-)
...
quoted hunk ↗ jump to hunk
@@ -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.

...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help