Commit 56536e9c authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

sfc: Provide hints to irqbalance daemon

Allocate IRQs with the name format <device>[-<type>]-<number> so that
future versions of irqbalanced understand what we're doing.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 28b581ab
...@@ -356,6 +356,27 @@ static int efx_probe_channel(struct efx_channel *channel) ...@@ -356,6 +356,27 @@ static int efx_probe_channel(struct efx_channel *channel)
} }
static void efx_set_channel_names(struct efx_nic *efx)
{
struct efx_channel *channel;
const char *type = "";
int number;
efx_for_each_channel(channel, efx) {
number = channel->channel;
if (efx->n_channels > efx->n_rx_queues) {
if (channel->channel < efx->n_rx_queues) {
type = "-rx";
} else {
type = "-tx";
number -= efx->n_rx_queues;
}
}
snprintf(channel->name, sizeof(channel->name),
"%s%s-%d", efx->name, type, number);
}
}
/* Channels are shutdown and reinitialised whilst the NIC is running /* Channels are shutdown and reinitialised whilst the NIC is running
* to propagate configuration changes (mtu, checksum offload), or * to propagate configuration changes (mtu, checksum offload), or
* to clear hardware error conditions * to clear hardware error conditions
...@@ -1002,6 +1023,7 @@ static int efx_probe_all(struct efx_nic *efx) ...@@ -1002,6 +1023,7 @@ static int efx_probe_all(struct efx_nic *efx)
goto fail3; goto fail3;
} }
} }
efx_set_channel_names(efx);
return 0; return 0;
...@@ -1483,6 +1505,7 @@ static int efx_netdev_event(struct notifier_block *this, ...@@ -1483,6 +1505,7 @@ static int efx_netdev_event(struct notifier_block *this,
strcpy(efx->name, net_dev->name); strcpy(efx->name, net_dev->name);
efx_mtd_rename(efx); efx_mtd_rename(efx);
efx_set_channel_names(efx);
} }
return NOTIFY_DONE; return NOTIFY_DONE;
...@@ -1516,6 +1539,7 @@ static int efx_register_netdev(struct efx_nic *efx) ...@@ -1516,6 +1539,7 @@ static int efx_register_netdev(struct efx_nic *efx)
return rc; return rc;
} }
strcpy(efx->name, net_dev->name); strcpy(efx->name, net_dev->name);
efx_set_channel_names(efx);
return 0; return 0;
} }
......
...@@ -1574,7 +1574,7 @@ int falcon_init_interrupt(struct efx_nic *efx) ...@@ -1574,7 +1574,7 @@ int falcon_init_interrupt(struct efx_nic *efx)
efx_for_each_channel(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); channel->name, channel);
if (rc) { if (rc) {
EFX_ERR(efx, "failed to hook IRQ %d\n", channel->irq); EFX_ERR(efx, "failed to hook IRQ %d\n", channel->irq);
goto fail2; goto fail2;
......
...@@ -327,6 +327,7 @@ enum efx_rx_alloc_method { ...@@ -327,6 +327,7 @@ enum efx_rx_alloc_method {
* *
* @efx: Associated Efx NIC * @efx: Associated Efx NIC
* @channel: Channel instance number * @channel: Channel instance number
* @name: Name for channel and IRQ
* @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)
...@@ -357,6 +358,7 @@ enum efx_rx_alloc_method { ...@@ -357,6 +358,7 @@ enum efx_rx_alloc_method {
struct efx_channel { struct efx_channel {
struct efx_nic *efx; struct efx_nic *efx;
int channel; int channel;
char name[IFNAMSIZ + 6];
int used_flags; int used_flags;
bool enabled; bool enabled;
int irq; int irq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment