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: Jakub Kicinski <kuba@kernel.org>
Date: 2024-08-29 22:05:04
Also in: lkml

On Thu, 29 Aug 2024 13:11:57 +0000 Joe Damato wrote:
+/**
+ * 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);
+
+/**
+ * napi_set_defer_hard_irqs - set the defer_hard_irqs for a napi
+ * @n: napi_struct to set the defer_hard_irqs field
+ * @defer: the value the field should be set to
+ */
+void napi_set_defer_hard_irqs(struct napi_struct *n, int defer);
+
+/**
+ * netdev_set_defer_hard_irqs - set defer_hard_irqs for all NAPIs of a netdev
+ * @netdev: the net_device for which all NAPIs will have their defer_hard_irqs set
+ * @defer: the defer_hard_irqs value to set
+ */
+void netdev_set_defer_hard_irqs(struct net_device *netdev, int defer);
Do you expect drivers or modules to call these?
I'm not sure we need the wrappers just to cover up the READ/WRITE_ONCE()
but if you do want to keep them they can be static inlines in
net/core/dev.h

nit: IIUC the kdoc should go on the definition, not the declaration.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help