netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netdev: create an "is_napi_enabled()" call
@ 2007-11-13 23:06 Linas Vepstas
  2007-11-14  1:42 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Linas Vepstas @ 2007-11-13 23:06 UTC (permalink / raw)
  To: Jeff Garzik, Andrew Morton; +Cc: NetDev, e1000-devel


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.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
-------
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(+)

Index: linux-2.6.23-rc8-mm1/include/linux/netdevice.h
===================================================================
--- linux-2.6.23-rc8-mm1.orig/include/linux/netdevice.h	2007-11-09 17:36:51.000000000 -0600
+++ linux-2.6.23-rc8-mm1/include/linux/netdevice.h	2007-11-09 17:40:19.000000000 -0600
@@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] netdev: create an "is_napi_enabled()" call
  2007-11-13 23:06 [PATCH] netdev: create an "is_napi_enabled()" call Linas Vepstas
@ 2007-11-14  1:42 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2007-11-14  1:42 UTC (permalink / raw)
  To: linas; +Cc: jeff, akpm, netdev, e1000-devel

From: linas@austin.ibm.com (Linas Vepstas)
Date: Tue, 13 Nov 2007 17:06:36 -0600

> 
> 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.
> 
> Signed-off-by: Linas Vepstas <linas@austin.ibm.com>

Can you show how you'll use this?

I'm just suspicious :-)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-11-14  1:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-13 23:06 [PATCH] netdev: create an "is_napi_enabled()" call Linas Vepstas
2007-11-14  1:42 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).