diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-04-04 09:22:11 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-04-12 11:37:54 -0400 |
commit | d4fabcc8e8ecac21262b1a5b9684fe415b128bd2 (patch) | |
tree | b9c8f2532b4ff56589477b5f12f85ed4d70409e5 /drivers/net/sfc/net_driver.h | |
parent | 9d1aea62e45d447e7fc05d4e7f4e90f633e3abfc (diff) |
sfc: Do not use efx_process_channel_now() in online self-test
During self-tests we use efx_process_channel_now() to handle
completion and other events synchronously. This disables interrupts
and NAPI processing for the channel in question, but it may still be
interrupted by another channel. A single socket may receive packets
from multiple net devices or even multiple channels of the same net
device, so this can result in deadlock on a socket lock.
Receiving packets in process context will also result in incorrect
classification by the network cgroup classifier.
Therefore, we must only use efx_process_channel_now() in the offline
loopback tests (which never deliver packets up the stack) and not for
the online interrupt and event tests.
For the interrupt test, there is no reason to process events. We
only care that an interrupt is raised.
For the event test, we want to know whether events have been received,
and there may be many events ahead of the one we inject. Therefore
remove efx_channel::magic_count and instead test whether
efx_channel::eventq_read_ptr advances. This is currently an event
queue index and might wrap around to exactly the same value, resulting
in a false negative. Therefore move the masking to efx_event() and
efx_nic_eventq_read_ack() so that it cannot wrap within the time of
the test.
The event test also tries to diagnose failures by checking whether an
event was delivered without causing an interrupt. Add and use a
helper function that only does this.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc/net_driver.h')
-rw-r--r-- | drivers/net/sfc/net_driver.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 9ffa9a6b55a0..191a311da2dc 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -330,7 +330,6 @@ enum efx_rx_alloc_method { | |||
330 | * @eventq_mask: Event queue pointer mask | 330 | * @eventq_mask: Event queue pointer mask |
331 | * @eventq_read_ptr: Event queue read pointer | 331 | * @eventq_read_ptr: Event queue read pointer |
332 | * @last_eventq_read_ptr: Last event queue read pointer value. | 332 | * @last_eventq_read_ptr: Last event queue read pointer value. |
333 | * @magic_count: Event queue test event count | ||
334 | * @irq_count: Number of IRQs since last adaptive moderation decision | 333 | * @irq_count: Number of IRQs since last adaptive moderation decision |
335 | * @irq_mod_score: IRQ moderation score | 334 | * @irq_mod_score: IRQ moderation score |
336 | * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors | 335 | * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors |
@@ -360,7 +359,6 @@ struct efx_channel { | |||
360 | unsigned int eventq_mask; | 359 | unsigned int eventq_mask; |
361 | unsigned int eventq_read_ptr; | 360 | unsigned int eventq_read_ptr; |
362 | unsigned int last_eventq_read_ptr; | 361 | unsigned int last_eventq_read_ptr; |
363 | unsigned int magic_count; | ||
364 | 362 | ||
365 | unsigned int irq_count; | 363 | unsigned int irq_count; |
366 | unsigned int irq_mod_score; | 364 | unsigned int irq_mod_score; |