diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 22:31:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 22:31:54 -0400 |
commit | 4fa4d23fa20de67df919030c1216295664866ad7 (patch) | |
tree | 90e80f8a40665a351950ef25ab9de85b3647a23a /include/linux | |
parent | a9e82d3a02247af6b729be0a963862d70cb25bf9 (diff) | |
parent | 4f1e5ba0977570b7a198bb3ac110ccc5f532821b (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
pcnet32: remove private net_device_stats structure
vortex_up should initialize "err"
pcnet32: remove compile warnings in non-napi mode
pcnet32: fix non-napi packet reception
fix EMAC driver for proper napi_synchronize API
sky2: shutdown cleanup
napi_synchronize: waiting for NAPI
forcedeth msi bugfix
gianfar: fix obviously wrong #ifdef CONFIG_GFAR_NAPI placement
fs_enet: Update for API changes
gianfar: remove orphan struct.
forcedeth: fix rx-work condition in nv_rx_process_optimized() too
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/netdevice.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 452c88d971ad..6f85db3535e2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -407,6 +407,24 @@ static inline void napi_enable(struct napi_struct *n) | |||
407 | clear_bit(NAPI_STATE_SCHED, &n->state); | 407 | clear_bit(NAPI_STATE_SCHED, &n->state); |
408 | } | 408 | } |
409 | 409 | ||
410 | #ifdef CONFIG_SMP | ||
411 | /** | ||
412 | * napi_synchronize - wait until NAPI is not running | ||
413 | * @n: napi context | ||
414 | * | ||
415 | * Wait until NAPI is done being scheduled on this context. | ||
416 | * Waits till any outstanding processing completes but | ||
417 | * does not disable future activations. | ||
418 | */ | ||
419 | static inline void napi_synchronize(const struct napi_struct *n) | ||
420 | { | ||
421 | while (test_bit(NAPI_STATE_SCHED, &n->state)) | ||
422 | msleep(1); | ||
423 | } | ||
424 | #else | ||
425 | # define napi_synchronize(n) barrier() | ||
426 | #endif | ||
427 | |||
410 | /* | 428 | /* |
411 | * The DEVICE structure. | 429 | * The DEVICE structure. |
412 | * Actually, this whole structure is a big mistake. It mixes I/O | 430 | * Actually, this whole structure is a big mistake. It mixes I/O |