diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-09-01 07:47:38 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-03 09:53:46 -0400 |
commit | 64ee3120f73b9e904d97ba66386b1e8e93b81385 (patch) | |
tree | d529e4e4597b654922a74130330c0c9e197037da /drivers/net | |
parent | 46123d043d4bab23aa0d22f33972ee52cfac7f68 (diff) |
sfc: Remove efx_channel::has_interrupt
efx_channel::has_interrupt is redundant with efx_channel::used_flags.
Remove efx_test_eventq() because it is now obviously unreachable.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/sfc/efx.c | 16 | ||||
-rw-r--r-- | drivers/net/sfc/falcon.c | 8 | ||||
-rw-r--r-- | drivers/net/sfc/net_driver.h | 11 | ||||
-rw-r--r-- | drivers/net/sfc/selftest.c | 44 |
4 files changed, 12 insertions, 67 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 487df9499c35..2deac7b04282 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -259,7 +259,7 @@ void efx_process_channel_now(struct efx_channel *channel) | |||
259 | falcon_disable_interrupts(efx); | 259 | falcon_disable_interrupts(efx); |
260 | if (efx->legacy_irq) | 260 | if (efx->legacy_irq) |
261 | synchronize_irq(efx->legacy_irq); | 261 | synchronize_irq(efx->legacy_irq); |
262 | if (channel->has_interrupt && channel->irq) | 262 | if (channel->irq) |
263 | synchronize_irq(channel->irq); | 263 | synchronize_irq(channel->irq); |
264 | 264 | ||
265 | /* Wait for any NAPI processing to complete */ | 265 | /* Wait for any NAPI processing to complete */ |
@@ -872,10 +872,8 @@ static void efx_probe_interrupts(struct efx_nic *efx) | |||
872 | } | 872 | } |
873 | 873 | ||
874 | if (rc == 0) { | 874 | if (rc == 0) { |
875 | for (i = 0; i < efx->rss_queues; i++) { | 875 | for (i = 0; i < efx->rss_queues; i++) |
876 | efx->channel[i].has_interrupt = true; | ||
877 | efx->channel[i].irq = xentries[i].vector; | 876 | efx->channel[i].irq = xentries[i].vector; |
878 | } | ||
879 | } else { | 877 | } else { |
880 | /* Fall back to single channel MSI */ | 878 | /* Fall back to single channel MSI */ |
881 | efx->interrupt_mode = EFX_INT_MODE_MSI; | 879 | efx->interrupt_mode = EFX_INT_MODE_MSI; |
@@ -889,7 +887,6 @@ static void efx_probe_interrupts(struct efx_nic *efx) | |||
889 | rc = pci_enable_msi(efx->pci_dev); | 887 | rc = pci_enable_msi(efx->pci_dev); |
890 | if (rc == 0) { | 888 | if (rc == 0) { |
891 | efx->channel[0].irq = efx->pci_dev->irq; | 889 | efx->channel[0].irq = efx->pci_dev->irq; |
892 | efx->channel[0].has_interrupt = true; | ||
893 | } else { | 890 | } else { |
894 | EFX_ERR(efx, "could not enable MSI\n"); | 891 | EFX_ERR(efx, "could not enable MSI\n"); |
895 | efx->interrupt_mode = EFX_INT_MODE_LEGACY; | 892 | efx->interrupt_mode = EFX_INT_MODE_LEGACY; |
@@ -899,9 +896,6 @@ static void efx_probe_interrupts(struct efx_nic *efx) | |||
899 | /* Assume legacy interrupts */ | 896 | /* Assume legacy interrupts */ |
900 | if (efx->interrupt_mode == EFX_INT_MODE_LEGACY) { | 897 | if (efx->interrupt_mode == EFX_INT_MODE_LEGACY) { |
901 | efx->rss_queues = 1; | 898 | efx->rss_queues = 1; |
902 | /* Every channel is interruptible */ | ||
903 | for (i = 0; i < EFX_MAX_CHANNELS; i++) | ||
904 | efx->channel[i].has_interrupt = true; | ||
905 | efx->legacy_irq = efx->pci_dev->irq; | 899 | efx->legacy_irq = efx->pci_dev->irq; |
906 | } | 900 | } |
907 | } | 901 | } |
@@ -911,7 +905,7 @@ static void efx_remove_interrupts(struct efx_nic *efx) | |||
911 | struct efx_channel *channel; | 905 | struct efx_channel *channel; |
912 | 906 | ||
913 | /* Remove MSI/MSI-X interrupts */ | 907 | /* Remove MSI/MSI-X interrupts */ |
914 | efx_for_each_channel_with_interrupt(channel, efx) | 908 | efx_for_each_channel(channel, efx) |
915 | channel->irq = 0; | 909 | channel->irq = 0; |
916 | pci_disable_msi(efx->pci_dev); | 910 | pci_disable_msi(efx->pci_dev); |
917 | pci_disable_msix(efx->pci_dev); | 911 | pci_disable_msix(efx->pci_dev); |
@@ -1106,7 +1100,7 @@ static void efx_stop_all(struct efx_nic *efx) | |||
1106 | falcon_disable_interrupts(efx); | 1100 | falcon_disable_interrupts(efx); |
1107 | if (efx->legacy_irq) | 1101 | if (efx->legacy_irq) |
1108 | synchronize_irq(efx->legacy_irq); | 1102 | synchronize_irq(efx->legacy_irq); |
1109 | efx_for_each_channel_with_interrupt(channel, efx) { | 1103 | efx_for_each_channel(channel, efx) { |
1110 | if (channel->irq) | 1104 | if (channel->irq) |
1111 | synchronize_irq(channel->irq); | 1105 | synchronize_irq(channel->irq); |
1112 | } | 1106 | } |
@@ -1303,7 +1297,7 @@ static void efx_netpoll(struct net_device *net_dev) | |||
1303 | struct efx_nic *efx = netdev_priv(net_dev); | 1297 | struct efx_nic *efx = netdev_priv(net_dev); |
1304 | struct efx_channel *channel; | 1298 | struct efx_channel *channel; |
1305 | 1299 | ||
1306 | efx_for_each_channel_with_interrupt(channel, efx) | 1300 | efx_for_each_channel(channel, efx) |
1307 | efx_schedule_channel(channel); | 1301 | efx_schedule_channel(channel); |
1308 | } | 1302 | } |
1309 | 1303 | ||
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 30176390481c..40dd643e930d 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -1317,7 +1317,7 @@ void falcon_enable_interrupts(struct efx_nic *efx) | |||
1317 | 1317 | ||
1318 | /* Force processing of all the channels to get the EVQ RPTRs up to | 1318 | /* Force processing of all the channels to get the EVQ RPTRs up to |
1319 | date */ | 1319 | date */ |
1320 | efx_for_each_channel_with_interrupt(channel, efx) | 1320 | efx_for_each_channel(channel, efx) |
1321 | efx_schedule_channel(channel); | 1321 | efx_schedule_channel(channel); |
1322 | } | 1322 | } |
1323 | 1323 | ||
@@ -1567,7 +1567,7 @@ int falcon_init_interrupt(struct efx_nic *efx) | |||
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | /* Hook MSI or MSI-X interrupt */ | 1569 | /* Hook MSI or MSI-X interrupt */ |
1570 | efx_for_each_channel_with_interrupt(channel, efx) { | 1570 | efx_for_each_channel(channel, efx) { |
1571 | rc = request_irq(channel->irq, falcon_msi_interrupt, | 1571 | rc = request_irq(channel->irq, falcon_msi_interrupt, |
1572 | IRQF_PROBE_SHARED, /* Not shared */ | 1572 | IRQF_PROBE_SHARED, /* Not shared */ |
1573 | efx->name, channel); | 1573 | efx->name, channel); |
@@ -1580,7 +1580,7 @@ int falcon_init_interrupt(struct efx_nic *efx) | |||
1580 | return 0; | 1580 | return 0; |
1581 | 1581 | ||
1582 | fail2: | 1582 | fail2: |
1583 | efx_for_each_channel_with_interrupt(channel, efx) | 1583 | efx_for_each_channel(channel, efx) |
1584 | free_irq(channel->irq, channel); | 1584 | free_irq(channel->irq, channel); |
1585 | fail1: | 1585 | fail1: |
1586 | return rc; | 1586 | return rc; |
@@ -1592,7 +1592,7 @@ void falcon_fini_interrupt(struct efx_nic *efx) | |||
1592 | efx_oword_t reg; | 1592 | efx_oword_t reg; |
1593 | 1593 | ||
1594 | /* Disable MSI/MSI-X interrupts */ | 1594 | /* Disable MSI/MSI-X interrupts */ |
1595 | efx_for_each_channel_with_interrupt(channel, efx) { | 1595 | efx_for_each_channel(channel, efx) { |
1596 | if (channel->irq) | 1596 | if (channel->irq) |
1597 | free_irq(channel->irq, channel); | 1597 | free_irq(channel->irq, channel); |
1598 | } | 1598 | } |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 390275710ef4..1fa134ab8eb8 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -329,7 +329,6 @@ enum efx_rx_alloc_method { | |||
329 | * @used_flags: Channel is used by net driver | 329 | * @used_flags: Channel is used by net driver |
330 | * @enabled: Channel enabled indicator | 330 | * @enabled: Channel enabled indicator |
331 | * @irq: IRQ number (MSI and MSI-X only) | 331 | * @irq: IRQ number (MSI and MSI-X only) |
332 | * @has_interrupt: Channel has an interrupt | ||
333 | * @irq_moderation: IRQ moderation value (in us) | 332 | * @irq_moderation: IRQ moderation value (in us) |
334 | * @napi_dev: Net device used with NAPI | 333 | * @napi_dev: Net device used with NAPI |
335 | * @napi_str: NAPI control structure | 334 | * @napi_str: NAPI control structure |
@@ -361,7 +360,6 @@ struct efx_channel { | |||
361 | int used_flags; | 360 | int used_flags; |
362 | bool enabled; | 361 | bool enabled; |
363 | int irq; | 362 | int irq; |
364 | bool has_interrupt; | ||
365 | unsigned int irq_moderation; | 363 | unsigned int irq_moderation; |
366 | struct net_device *napi_dev; | 364 | struct net_device *napi_dev; |
367 | struct napi_struct napi_str; | 365 | struct napi_struct napi_str; |
@@ -834,15 +832,6 @@ struct efx_nic_type { | |||
834 | continue; \ | 832 | continue; \ |
835 | else | 833 | else |
836 | 834 | ||
837 | /* Iterate over all used channels with interrupts */ | ||
838 | #define efx_for_each_channel_with_interrupt(_channel, _efx) \ | ||
839 | for (_channel = &_efx->channel[0]; \ | ||
840 | _channel < &_efx->channel[EFX_MAX_CHANNELS]; \ | ||
841 | _channel++) \ | ||
842 | if (!(_channel->used_flags && _channel->has_interrupt)) \ | ||
843 | continue; \ | ||
844 | else | ||
845 | |||
846 | /* Iterate over all used TX queues */ | 835 | /* Iterate over all used TX queues */ |
847 | #define efx_for_each_tx_queue(_tx_queue, _efx) \ | 836 | #define efx_for_each_tx_queue(_tx_queue, _efx) \ |
848 | for (_tx_queue = &_efx->tx_queue[0]; \ | 837 | for (_tx_queue = &_efx->tx_queue[0]; \ |
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index ff7b84c3fcfb..2f7def657679 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -111,7 +111,7 @@ static int efx_test_interrupts(struct efx_nic *efx, | |||
111 | 111 | ||
112 | /* ACK each interrupting event queue. Receiving an interrupt due to | 112 | /* ACK each interrupting event queue. Receiving an interrupt due to |
113 | * traffic before a test event is raised is considered a pass */ | 113 | * traffic before a test event is raised is considered a pass */ |
114 | efx_for_each_channel_with_interrupt(channel, efx) { | 114 | efx_for_each_channel(channel, efx) { |
115 | if (channel->work_pending) | 115 | if (channel->work_pending) |
116 | efx_process_channel_now(channel); | 116 | efx_process_channel_now(channel); |
117 | if (efx->last_irq_cpu >= 0) | 117 | if (efx->last_irq_cpu >= 0) |
@@ -136,41 +136,6 @@ static int efx_test_interrupts(struct efx_nic *efx, | |||
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
138 | 138 | ||
139 | /* Test generation and receipt of non-interrupting events */ | ||
140 | static int efx_test_eventq(struct efx_channel *channel, | ||
141 | struct efx_self_tests *tests) | ||
142 | { | ||
143 | unsigned int magic; | ||
144 | |||
145 | /* Channel specific code, limited to 20 bits */ | ||
146 | magic = (0x00010150 + channel->channel); | ||
147 | EFX_LOG(channel->efx, "channel %d testing event queue with code %x\n", | ||
148 | channel->channel, magic); | ||
149 | |||
150 | tests->eventq_dma[channel->channel] = -1; | ||
151 | tests->eventq_int[channel->channel] = 1; /* fake pass */ | ||
152 | tests->eventq_poll[channel->channel] = 1; /* fake pass */ | ||
153 | |||
154 | /* Reset flag and zero magic word */ | ||
155 | channel->efx->last_irq_cpu = -1; | ||
156 | channel->eventq_magic = 0; | ||
157 | smp_wmb(); | ||
158 | |||
159 | falcon_generate_test_event(channel, magic); | ||
160 | udelay(1); | ||
161 | |||
162 | efx_process_channel_now(channel); | ||
163 | if (channel->eventq_magic != magic) { | ||
164 | EFX_ERR(channel->efx, "channel %d failed to see test event\n", | ||
165 | channel->channel); | ||
166 | return -ETIMEDOUT; | ||
167 | } else { | ||
168 | tests->eventq_dma[channel->channel] = 1; | ||
169 | } | ||
170 | |||
171 | return 0; | ||
172 | } | ||
173 | |||
174 | /* Test generation and receipt of interrupting events */ | 139 | /* Test generation and receipt of interrupting events */ |
175 | static int efx_test_eventq_irq(struct efx_channel *channel, | 140 | static int efx_test_eventq_irq(struct efx_channel *channel, |
176 | struct efx_self_tests *tests) | 141 | struct efx_self_tests *tests) |
@@ -456,7 +421,7 @@ static int efx_poll_loopback(struct efx_nic *efx) | |||
456 | 421 | ||
457 | /* NAPI polling is not enabled, so process channels | 422 | /* NAPI polling is not enabled, so process channels |
458 | * synchronously */ | 423 | * synchronously */ |
459 | efx_for_each_channel_with_interrupt(channel, efx) { | 424 | efx_for_each_channel(channel, efx) { |
460 | if (channel->work_pending) | 425 | if (channel->work_pending) |
461 | efx_process_channel_now(channel); | 426 | efx_process_channel_now(channel); |
462 | } | 427 | } |
@@ -689,10 +654,7 @@ int efx_online_test(struct efx_nic *efx, struct efx_self_tests *tests) | |||
689 | if (rc) | 654 | if (rc) |
690 | return rc; | 655 | return rc; |
691 | efx_for_each_channel(channel, efx) { | 656 | efx_for_each_channel(channel, efx) { |
692 | if (channel->has_interrupt) | 657 | rc = efx_test_eventq_irq(channel, tests); |
693 | rc = efx_test_eventq_irq(channel, tests); | ||
694 | else | ||
695 | rc = efx_test_eventq(channel, tests); | ||
696 | if (rc) | 658 | if (rc) |
697 | return rc; | 659 | return rc; |
698 | } | 660 | } |