aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/net_driver.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-01-05 15:14:10 -0500
committerBen Hutchings <bhutchings@solarflare.com>2012-01-26 19:10:52 -0500
commit1646a6f352a6f70fcca828589ed04797aa09d494 (patch)
tree7f39f32e75140e831c26dd57caa7c28515252053 /drivers/net/ethernet/sfc/net_driver.h
parentf70d1847348e9548a9a56e4434946315bca297c8 (diff)
sfc: Clean up test interrupt handling
Interrupts are normally generated by the event queues, moderated by timers. However, they may also be triggered by detection of a 'fatal' error condition (e.g. memory parity error) or by the host writing to certain CSR fields as part of a self-test. The IRQ level/index used for these on Falcon rev B0 and Siena is set by the KER_INT_LEVE_SEL field and cached by the driver in efx_nic::fatal_irq_level. Since this value is also relevant to self-tests rename the field to just 'irq_level'. Avoid unnecessary cache traffic by using a per-channel 'last_irq_cpu' field and only writing to the per-controller field when the interrupt matches efx_nic::irq_level. Remove the volatile qualifier and use ACCESS_ONCE in the places we read these fields. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/net_driver.h')
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 8ce4d068bba5..a4cf8cb8180c 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -325,6 +325,7 @@ enum efx_rx_alloc_method {
325 * @eventq_mask: Event queue pointer mask 325 * @eventq_mask: Event queue pointer mask
326 * @eventq_read_ptr: Event queue read pointer 326 * @eventq_read_ptr: Event queue read pointer
327 * @last_eventq_read_ptr: Last event queue read pointer value. 327 * @last_eventq_read_ptr: Last event queue read pointer value.
328 * @last_irq_cpu: Last CPU to handle interrupt for this channel
328 * @irq_count: Number of IRQs since last adaptive moderation decision 329 * @irq_count: Number of IRQs since last adaptive moderation decision
329 * @irq_mod_score: IRQ moderation score 330 * @irq_mod_score: IRQ moderation score
330 * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors 331 * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors
@@ -355,6 +356,7 @@ struct efx_channel {
355 unsigned int eventq_read_ptr; 356 unsigned int eventq_read_ptr;
356 unsigned int last_eventq_read_ptr; 357 unsigned int last_eventq_read_ptr;
357 358
359 int last_irq_cpu;
358 unsigned int irq_count; 360 unsigned int irq_count;
359 unsigned int irq_mod_score; 361 unsigned int irq_mod_score;
360#ifdef CONFIG_RFS_ACCEL 362#ifdef CONFIG_RFS_ACCEL
@@ -648,7 +650,7 @@ struct efx_filter_state;
648 * @int_error_expire: Time at which error count will be expired 650 * @int_error_expire: Time at which error count will be expired
649 * @irq_status: Interrupt status buffer 651 * @irq_status: Interrupt status buffer
650 * @irq_zero_count: Number of legacy IRQs seen with queue flags == 0 652 * @irq_zero_count: Number of legacy IRQs seen with queue flags == 0
651 * @fatal_irq_level: IRQ level (bit number) used for serious errors 653 * @irq_level: IRQ level/index for IRQs not triggered by an event queue
652 * @mtd_list: List of MTDs attached to the NIC 654 * @mtd_list: List of MTDs attached to the NIC
653 * @nic_data: Hardware dependent state 655 * @nic_data: Hardware dependent state
654 * @mac_lock: MAC access lock. Protects @port_enabled, @phy_mode, 656 * @mac_lock: MAC access lock. Protects @port_enabled, @phy_mode,
@@ -679,10 +681,9 @@ struct efx_filter_state;
679 * @loopback_selftest: Offline self-test private state 681 * @loopback_selftest: Offline self-test private state
680 * @monitor_work: Hardware monitor workitem 682 * @monitor_work: Hardware monitor workitem
681 * @biu_lock: BIU (bus interface unit) lock 683 * @biu_lock: BIU (bus interface unit) lock
682 * @last_irq_cpu: Last CPU to handle interrupt. 684 * @last_irq_cpu: Last CPU to handle a possible test interrupt. This
683 * This register is written with the SMP processor ID whenever an 685 * field is used by efx_test_interrupts() to verify that an
684 * interrupt is handled. It is used by efx_nic_test_interrupt() 686 * interrupt has occurred.
685 * to verify that an interrupt has occurred.
686 * @n_rx_nodesc_drop_cnt: RX no descriptor drop count 687 * @n_rx_nodesc_drop_cnt: RX no descriptor drop count
687 * @mac_stats: MAC statistics. These include all statistics the MACs 688 * @mac_stats: MAC statistics. These include all statistics the MACs
688 * can provide. Generic code converts these into a standard 689 * can provide. Generic code converts these into a standard
@@ -735,7 +736,7 @@ struct efx_nic {
735 736
736 struct efx_buffer irq_status; 737 struct efx_buffer irq_status;
737 unsigned irq_zero_count; 738 unsigned irq_zero_count;
738 unsigned fatal_irq_level; 739 unsigned irq_level;
739 740
740#ifdef CONFIG_SFC_MTD 741#ifdef CONFIG_SFC_MTD
741 struct list_head mtd_list; 742 struct list_head mtd_list;
@@ -779,7 +780,7 @@ struct efx_nic {
779 780
780 struct delayed_work monitor_work ____cacheline_aligned_in_smp; 781 struct delayed_work monitor_work ____cacheline_aligned_in_smp;
781 spinlock_t biu_lock; 782 spinlock_t biu_lock;
782 volatile signed int last_irq_cpu; 783 int last_irq_cpu;
783 unsigned n_rx_nodesc_drop_cnt; 784 unsigned n_rx_nodesc_drop_cnt;
784 struct efx_mac_stats mac_stats; 785 struct efx_mac_stats mac_stats;
785 spinlock_t stats_lock; 786 spinlock_t stats_lock;