summaryrefslogtreecommitdiff
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-12-12 21:37:02 -0800
committerDavid S. Miller <davem@davemloft.net>2008-12-12 21:57:45 -0800
commit56536e9ce7c23bbc8519b8f99837493dea8da57d (patch)
tree45e13f39d0a6b7f7254a474da016fc319cc5f04e /drivers/net/sfc/efx.c
parent28b581ab0a0aa7bc8b22935779ca3e8d6f651ac7 (diff)
downloadlwn-56536e9ce7c23bbc8519b8f99837493dea8da57d.tar.gz
lwn-56536e9ce7c23bbc8519b8f99837493dea8da57d.zip
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: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r--drivers/net/sfc/efx.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 2faaa965afca..bba11490ef41 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -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
* to propagate configuration changes (mtu, checksum offload), or
* to clear hardware error conditions
@@ -1002,6 +1023,7 @@ static int efx_probe_all(struct efx_nic *efx)
goto fail3;
}
}
+ efx_set_channel_names(efx);
return 0;
@@ -1483,6 +1505,7 @@ static int efx_netdev_event(struct notifier_block *this,
strcpy(efx->name, net_dev->name);
efx_mtd_rename(efx);
+ efx_set_channel_names(efx);
}
return NOTIFY_DONE;
@@ -1516,6 +1539,7 @@ static int efx_register_netdev(struct efx_nic *efx)
return rc;
}
strcpy(efx->name, net_dev->name);
+ efx_set_channel_names(efx);
return 0;
}