lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071113230636.GJ8421@austin.ibm.com>
Date:	Tue, 13 Nov 2007 17:06:36 -0600
From:	linas@...tin.ibm.com (Linas Vepstas)
To:	Jeff Garzik <jeff@...zik.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	NetDev <netdev@...r.kernel.org>, e1000-devel@...ts.sourceforge.net
Subject: [PATCH] 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.

Signed-off-by: Linas Vepstas <linas@...tin.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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ