netdev: create an "is_napi_enabled()" call
Subsystems (2)
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.
Signed-off-by Linas Vepstas <[email protected]>
-------
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
@@ -384,6 +384,17 @@ static inline void napi_enable(struct naclear_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
David Miller
maintainerFrom: [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.Signed-off-by Linas Vepstas <[email protected]>
Can you show how you'll use this?
I'm just suspicious :-)