diff mbox series

[53/74] backports: add napi_schedule()

Message ID 20240524190907.7a4b3ef2a400.I78f3e2b2279ed65ee357cf5f22cf5b339cc7e6a5@changeid (mailing list archive)
State New, archived
Headers show
Series backport updates from Intel | expand

Commit Message

Johannes Berg May 24, 2024, 5:08 p.m. UTC
From: Gregory Greenman <gregory.greenman@intel.com>

napi_schedule() was introduced in v6.7 by the commit
0a779003213b ("netdev: make napi_schedule return bool on NAPI successful schedule")

Adjust backports accordingly.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/netdevice.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 96d47811f7d9..319a1a4eff05 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -176,4 +176,17 @@  struct net_device_path_ctx {
 };
 #endif /* NET_DEVICE_PATH_STACK_MAX */
 
+#if LINUX_VERSION_IS_LESS(6,7,0)
+static inline bool LINUX_BACKPORT(napi_schedule)(struct napi_struct *n)
+{
+	if (napi_schedule_prep(n)) {
+		__napi_schedule(n);
+		return true;
+	}
+
+	return false;
+}
+#define napi_schedule LINUX_BACKPORT(napi_schedule)
+#endif /* < 6.7.0 */
+
 #endif /* __BACKPORT_NETDEVICE_H */