Skip to contentSkip to conversation

netdev: create an "is_napi_enabled()" call

PATCH In review Linas Vepstas 2 participants 2 messages Nov 13, 2007 – Nov 14, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netdev: create an "is_napi_enabled()" call

In certain rare cases, it can be nice to be able to check if napi is enabled or not. Create an is_napi_enabled() call.

-------
Actually, I'm confused about whether I'd mailed this previously. It might be a duplicate submission.

 include/linux/netdevice.h |   11 +++++++++++
 1 file changed, 11 insertions(+)
include/linux/netdevice.h +11 -0
Index: linux-2.6.23-rc8-mm1/include/linux/netdevice.h
===================================================================
@@ -384,6 +384,17 @@ static inline void napi_enable(struct na
 	clear_bit(NAPI_STATE_SCHED, &n->state);
 }
 
+/**
+ *	is_napi_enabled - return non-zero if napi enabled
+ *	@n: napi context
+ *
+ * Return true if napi is enabled.
+ */
+static inline bool is_napi_enabled(struct napi_struct *n)
+{
+	return !test_bit(NAPI_STATE_SCHED, &n->state);
+}
+
 /*
  *	The DEVICE structure.
  *	Actually, this whole structure is a big mistake.  It mixes I/O
maintainer
#1 lore raw

From: [email protected] (Linas Vepstas)
Date: Tue, 13 Nov 2007 17:06:36 -0600

Quoted 5 lines

In certain rare cases, it can be nice to be able to check if napi is enabled or not. Create an is_napi_enabled() call.

Can you show how you'll use this?

I'm just suspicious :-)