[PATCH 3/3] backports: add napi_is_scheduled()

Johannes Berg <[email protected]> Fri, 24 May 2024 19:48:18 +0200
Newsgroups org.kernel.vger.backports
Message-ID <20240524194829.b59bcf51bf91.I27d58940522266d55eaf288bebd0981e393bfc7f@changeid>
From: Johannes Berg <[email protected]>

Signed-off-by: Johannes Berg <[email protected]>
---
 backport/backport-include/linux/netdevice.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index f720b7537f4b..7f72c3a8eb98 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -204,6 +204,12 @@ static inline bool LINUX_BACKPORT(napi_schedule)(struct napi_struct *n)
 	return false;
 }
 #define napi_schedule LINUX_BACKPORT(napi_schedule)
+
+#define napi_is_scheduled LINUX_BACKPORT(napi_is_scheduled)
+static inline bool napi_is_scheduled(struct napi_struct *n)
+{
+	return test_bit(NAPI_STATE_SCHED, &n->state);
+}
 #endif /* < 6.7.0 */
 
 #endif /* __BACKPORT_NETDEVICE_H */
-- 
2.45.1