提交 64ee3120 编写于 作者: B Ben Hutchings 提交者: Jeff Garzik

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: NBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 46123d04
...@@ -259,7 +259,7 @@ void efx_process_channel_now(struct efx_channel *channel) ...@@ -259,7 +259,7 @@ void efx_process_channel_now(struct efx_channel *channel)
falcon_disable_interrupts(efx); falcon_disable_interrupts(efx);
if (efx->legacy_irq) if (efx->legacy_irq)
synchronize_irq(efx->legacy_irq); synchronize_irq(efx->legacy_irq);
if (channel->has_interrupt && channel->irq) if (channel->irq)
synchronize_irq(channel->irq); synchronize_irq(channel->irq);
/* Wait for any NAPI processing to complete */ /* Wait for any NAPI processing to complete */
...@@ -872,10 +872,8 @@ static void efx_probe_interrupts(struct efx_nic *efx) ...@@ -872,10 +872,8 @@ static void efx_probe_interrupts(struct efx_nic *efx)
} }
if (rc == 0) { if (rc == 0) {
for (i = 0; i < efx->rss_queues; i++) { for (i = 0; i < efx->rss_queues; i++)
efx->channel[i].has_interrupt = true;
efx->channel[i].irq = xentries[i].vector; efx->channel[i].irq = xentries[i].vector;
}
} else { } else {
/* Fall back to single channel MSI */ /* Fall back to single channel MSI */
efx->interrupt_mode = EFX_INT_MODE_MSI; efx->interrupt_mode = EFX_INT_MODE_MSI;
...@@ -889,7 +887,6 @@ static void efx_probe_interrupts(struct efx_nic *efx) ...@@ -889,7 +887,6 @@ static void efx_probe_interrupts(struct efx_nic *efx)
rc = pci_enable_msi(efx->pci_dev); rc = pci_enable_msi(efx->pci_dev);
if (rc == 0) { if (rc == 0) {
efx->channel[0].irq = efx->pci_dev->irq; efx->channel[0].irq = efx->pci_dev->irq;
efx->channel[0].has_interrupt = true;
} else { } else {
EFX_ERR(efx, "could not enable MSI\n"); EFX_ERR(efx, "could not enable MSI\n");
efx->interrupt_mode = EFX_INT_MODE_LEGACY; efx->interrupt_mode = EFX_INT_MODE_LEGACY;
...@@ -899,9 +896,6 @@ static void efx_probe_interrupts(struct efx_nic *efx) ...@@ -899,9 +896,6 @@ static void efx_probe_interrupts(struct efx_nic *efx)
/* Assume legacy interrupts */ /* Assume legacy interrupts */
if (efx->interrupt_mode == EFX_INT_MODE_LEGACY) { if (efx->interrupt_mode == EFX_INT_MODE_LEGACY) {
efx->rss_queues = 1; efx->rss_queues = 1;
/* Every channel is interruptible */
for (i = 0; i < EFX_MAX_CHANNELS; i++)
efx->channel[i].has_interrupt = true;
efx->legacy_irq = efx->pci_dev->irq; efx->legacy_irq = efx->pci_dev->irq;
} }
} }
...@@ -911,7 +905,7 @@ static void efx_remove_interrupts(struct efx_nic *efx) ...@@ -911,7 +905,7 @@ static void efx_remove_interrupts(struct efx_nic *efx)
struct efx_channel *channel; struct efx_channel *channel;
/* Remove MSI/MSI-X interrupts */ /* Remove MSI/MSI-X interrupts */
efx_for_each_channel_with_interrupt(channel, efx) efx_for_each_channel(channel, efx)
channel->irq = 0; channel->irq = 0;
pci_disable_msi(efx->pci_dev); pci_disable_msi(efx->pci_dev);
pci_disable_msix(efx->pci_dev); pci_disable_msix(efx->pci_dev);
...@@ -1106,7 +1100,7 @@ static void efx_stop_all(struct efx_nic *efx) ...@@ -1106,7 +1100,7 @@ static void efx_stop_all(struct efx_nic *efx)
falcon_disable_interrupts(efx); falcon_disable_interrupts(efx);
if (efx->legacy_irq) if (efx->legacy_irq)
synchronize_irq(efx->legacy_irq); synchronize_irq(efx->legacy_irq);
efx_for_each_channel_with_interrupt(channel, efx) { efx_for_each_channel(channel, efx) {
if (channel->irq) if (channel->irq)
synchronize_irq(channel->irq); synchronize_irq(channel->irq);
} }
...@@ -1303,7 +1297,7 @@ static void efx_netpoll(struct net_device *net_dev) ...@@ -1303,7 +1297,7 @@ static void efx_netpoll(struct net_device *net_dev)
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = netdev_priv(net_dev);
struct efx_channel *channel; struct efx_channel *channel;
efx_for_each_channel_with_interrupt(channel, efx) efx_for_each_channel(channel, efx)
efx_schedule_channel(channel); efx_schedule_channel(channel);
} }
......
...@@ -1317,7 +1317,7 @@ void falcon_enable_interrupts(struct efx_nic *efx) ...@@ -1317,7 +1317,7 @@ void falcon_enable_interrupts(struct efx_nic *efx)
/* Force processing of all the channels to get the EVQ RPTRs up to /* Force processing of all the channels to get the EVQ RPTRs up to
date */ date */
efx_for_each_channel_with_interrupt(channel, efx) efx_for_each_channel(channel, efx)
efx_schedule_channel(channel); efx_schedule_channel(channel);
} }
...@@ -1567,7 +1567,7 @@ int falcon_init_interrupt(struct efx_nic *efx) ...@@ -1567,7 +1567,7 @@ int falcon_init_interrupt(struct efx_nic *efx)
} }
/* Hook MSI or MSI-X interrupt */ /* Hook MSI or MSI-X interrupt */
efx_for_each_channel_with_interrupt(channel, efx) { efx_for_each_channel(channel, efx) {
rc = request_irq(channel->irq, falcon_msi_interrupt, rc = request_irq(channel->irq, falcon_msi_interrupt,
IRQF_PROBE_SHARED, /* Not shared */ IRQF_PROBE_SHARED, /* Not shared */
efx->name, channel); efx->name, channel);
...@@ -1580,7 +1580,7 @@ int falcon_init_interrupt(struct efx_nic *efx) ...@@ -1580,7 +1580,7 @@ int falcon_init_interrupt(struct efx_nic *efx)
return 0; return 0;
fail2: fail2:
efx_for_each_channel_with_interrupt(channel, efx) efx_for_each_channel(channel, efx)
free_irq(channel->irq, channel); free_irq(channel->irq, channel);
fail1: fail1:
return rc; return rc;
...@@ -1592,7 +1592,7 @@ void falcon_fini_interrupt(struct efx_nic *efx) ...@@ -1592,7 +1592,7 @@ void falcon_fini_interrupt(struct efx_nic *efx)
efx_oword_t reg; efx_oword_t reg;
/* Disable MSI/MSI-X interrupts */ /* Disable MSI/MSI-X interrupts */
efx_for_each_channel_with_interrupt(channel, efx) { efx_for_each_channel(channel, efx) {
if (channel->irq) if (channel->irq)
free_irq(channel->irq, channel); free_irq(channel->irq, channel);
} }
......
...@@ -329,7 +329,6 @@ enum efx_rx_alloc_method { ...@@ -329,7 +329,6 @@ enum efx_rx_alloc_method {
* @used_flags: Channel is used by net driver * @used_flags: Channel is used by net driver
* @enabled: Channel enabled indicator * @enabled: Channel enabled indicator
* @irq: IRQ number (MSI and MSI-X only) * @irq: IRQ number (MSI and MSI-X only)
* @has_interrupt: Channel has an interrupt
* @irq_moderation: IRQ moderation value (in us) * @irq_moderation: IRQ moderation value (in us)
* @napi_dev: Net device used with NAPI * @napi_dev: Net device used with NAPI
* @napi_str: NAPI control structure * @napi_str: NAPI control structure
...@@ -361,7 +360,6 @@ struct efx_channel { ...@@ -361,7 +360,6 @@ struct efx_channel {
int used_flags; int used_flags;
bool enabled; bool enabled;
int irq; int irq;
bool has_interrupt;
unsigned int irq_moderation; unsigned int irq_moderation;
struct net_device *napi_dev; struct net_device *napi_dev;
struct napi_struct napi_str; struct napi_struct napi_str;
...@@ -834,15 +832,6 @@ struct efx_nic_type { ...@@ -834,15 +832,6 @@ struct efx_nic_type {
continue; \ continue; \
else else
/* Iterate over all used channels with interrupts */
#define efx_for_each_channel_with_interrupt(_channel, _efx) \
for (_channel = &_efx->channel[0]; \
_channel < &_efx->channel[EFX_MAX_CHANNELS]; \
_channel++) \
if (!(_channel->used_flags && _channel->has_interrupt)) \
continue; \
else
/* Iterate over all used TX queues */ /* Iterate over all used TX queues */
#define efx_for_each_tx_queue(_tx_queue, _efx) \ #define efx_for_each_tx_queue(_tx_queue, _efx) \
for (_tx_queue = &_efx->tx_queue[0]; \ for (_tx_queue = &_efx->tx_queue[0]; \
......
...@@ -111,7 +111,7 @@ static int efx_test_interrupts(struct efx_nic *efx, ...@@ -111,7 +111,7 @@ static int efx_test_interrupts(struct efx_nic *efx,
/* ACK each interrupting event queue. Receiving an interrupt due to /* ACK each interrupting event queue. Receiving an interrupt due to
* traffic before a test event is raised is considered a pass */ * traffic before a test event is raised is considered a pass */
efx_for_each_channel_with_interrupt(channel, efx) { efx_for_each_channel(channel, efx) {
if (channel->work_pending) if (channel->work_pending)
efx_process_channel_now(channel); efx_process_channel_now(channel);
if (efx->last_irq_cpu >= 0) if (efx->last_irq_cpu >= 0)
...@@ -136,41 +136,6 @@ static int efx_test_interrupts(struct efx_nic *efx, ...@@ -136,41 +136,6 @@ static int efx_test_interrupts(struct efx_nic *efx,
return 0; return 0;
} }
/* Test generation and receipt of non-interrupting events */
static int efx_test_eventq(struct efx_channel *channel,
struct efx_self_tests *tests)
{
unsigned int magic;
/* Channel specific code, limited to 20 bits */
magic = (0x00010150 + channel->channel);
EFX_LOG(channel->efx, "channel %d testing event queue with code %x\n",
channel->channel, magic);
tests->eventq_dma[channel->channel] = -1;
tests->eventq_int[channel->channel] = 1; /* fake pass */
tests->eventq_poll[channel->channel] = 1; /* fake pass */
/* Reset flag and zero magic word */
channel->efx->last_irq_cpu = -1;
channel->eventq_magic = 0;
smp_wmb();
falcon_generate_test_event(channel, magic);
udelay(1);
efx_process_channel_now(channel);
if (channel->eventq_magic != magic) {
EFX_ERR(channel->efx, "channel %d failed to see test event\n",
channel->channel);
return -ETIMEDOUT;
} else {
tests->eventq_dma[channel->channel] = 1;
}
return 0;
}
/* Test generation and receipt of interrupting events */ /* Test generation and receipt of interrupting events */
static int efx_test_eventq_irq(struct efx_channel *channel, static int efx_test_eventq_irq(struct efx_channel *channel,
struct efx_self_tests *tests) struct efx_self_tests *tests)
...@@ -456,7 +421,7 @@ static int efx_poll_loopback(struct efx_nic *efx) ...@@ -456,7 +421,7 @@ static int efx_poll_loopback(struct efx_nic *efx)
/* NAPI polling is not enabled, so process channels /* NAPI polling is not enabled, so process channels
* synchronously */ * synchronously */
efx_for_each_channel_with_interrupt(channel, efx) { efx_for_each_channel(channel, efx) {
if (channel->work_pending) if (channel->work_pending)
efx_process_channel_now(channel); efx_process_channel_now(channel);
} }
...@@ -689,10 +654,7 @@ int efx_online_test(struct efx_nic *efx, struct efx_self_tests *tests) ...@@ -689,10 +654,7 @@ int efx_online_test(struct efx_nic *efx, struct efx_self_tests *tests)
if (rc) if (rc)
return rc; return rc;
efx_for_each_channel(channel, efx) { efx_for_each_channel(channel, efx) {
if (channel->has_interrupt) rc = efx_test_eventq_irq(channel, tests);
rc = efx_test_eventq_irq(channel, tests);
else
rc = efx_test_eventq(channel, tests);
if (rc) if (rc)
return rc; return rc;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册