diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-12-13 00:37:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-13 00:57:45 -0500 |
commit | 56536e9ce7c23bbc8519b8f99837493dea8da57d (patch) | |
tree | 45e13f39d0a6b7f7254a474da016fc319cc5f04e /drivers/net | |
parent | 28b581ab0a0aa7bc8b22935779ca3e8d6f651ac7 (diff) |
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')
-rw-r--r-- | drivers/net/sfc/efx.c | 24 | ||||
-rw-r--r-- | drivers/net/sfc/falcon.c | 2 | ||||
-rw-r--r-- | drivers/net/sfc/net_driver.h | 2 |
3 files changed, 27 insertions, 1 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) | |||
356 | } | 356 | } |
357 | 357 | ||
358 | 358 | ||
359 | static void efx_set_channel_names(struct efx_nic *efx) | ||
360 | { | ||
361 | struct efx_channel *channel; | ||
362 | const char *type = ""; | ||
363 | int number; | ||
364 | |||
365 | efx_for_each_channel(channel, efx) { | ||
366 | number = channel->channel; | ||
367 | if (efx->n_channels > efx->n_rx_queues) { | ||
368 | if (channel->channel < efx->n_rx_queues) { | ||
369 | type = "-rx"; | ||
370 | } else { | ||
371 | type = "-tx"; | ||
372 | number -= efx->n_rx_queues; | ||
373 | } | ||
374 | } | ||
375 | snprintf(channel->name, sizeof(channel->name), | ||
376 | "%s%s-%d", efx->name, type, number); | ||
377 | } | ||
378 | } | ||
379 | |||
359 | /* Channels are shutdown and reinitialised whilst the NIC is running | 380 | /* Channels are shutdown and reinitialised whilst the NIC is running |
360 | * to propagate configuration changes (mtu, checksum offload), or | 381 | * to propagate configuration changes (mtu, checksum offload), or |
361 | * to clear hardware error conditions | 382 | * to clear hardware error conditions |
@@ -1002,6 +1023,7 @@ static int efx_probe_all(struct efx_nic *efx) | |||
1002 | goto fail3; | 1023 | goto fail3; |
1003 | } | 1024 | } |
1004 | } | 1025 | } |
1026 | efx_set_channel_names(efx); | ||
1005 | 1027 | ||
1006 | return 0; | 1028 | return 0; |
1007 | 1029 | ||
@@ -1483,6 +1505,7 @@ static int efx_netdev_event(struct notifier_block *this, | |||
1483 | 1505 | ||
1484 | strcpy(efx->name, net_dev->name); | 1506 | strcpy(efx->name, net_dev->name); |
1485 | efx_mtd_rename(efx); | 1507 | efx_mtd_rename(efx); |
1508 | efx_set_channel_names(efx); | ||
1486 | } | 1509 | } |
1487 | 1510 | ||
1488 | return NOTIFY_DONE; | 1511 | return NOTIFY_DONE; |
@@ -1516,6 +1539,7 @@ static int efx_register_netdev(struct efx_nic *efx) | |||
1516 | return rc; | 1539 | return rc; |
1517 | } | 1540 | } |
1518 | strcpy(efx->name, net_dev->name); | 1541 | strcpy(efx->name, net_dev->name); |
1542 | efx_set_channel_names(efx); | ||
1519 | 1543 | ||
1520 | return 0; | 1544 | return 0; |
1521 | } | 1545 | } |
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 2ef876d8f233..e32be4c83d90 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -1574,7 +1574,7 @@ int falcon_init_interrupt(struct efx_nic *efx) | |||
1574 | efx_for_each_channel(channel, efx) { | 1574 | efx_for_each_channel(channel, efx) { |
1575 | rc = request_irq(channel->irq, falcon_msi_interrupt, | 1575 | rc = request_irq(channel->irq, falcon_msi_interrupt, |
1576 | IRQF_PROBE_SHARED, /* Not shared */ | 1576 | IRQF_PROBE_SHARED, /* Not shared */ |
1577 | efx->name, channel); | 1577 | channel->name, channel); |
1578 | if (rc) { | 1578 | if (rc) { |
1579 | EFX_ERR(efx, "failed to hook IRQ %d\n", channel->irq); | 1579 | EFX_ERR(efx, "failed to hook IRQ %d\n", channel->irq); |
1580 | goto fail2; | 1580 | goto fail2; |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 2c5b5fabac1e..abff9084a986 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -327,6 +327,7 @@ enum efx_rx_alloc_method { | |||
327 | * | 327 | * |
328 | * @efx: Associated Efx NIC | 328 | * @efx: Associated Efx NIC |
329 | * @channel: Channel instance number | 329 | * @channel: Channel instance number |
330 | * @name: Name for channel and IRQ | ||
330 | * @used_flags: Channel is used by net driver | 331 | * @used_flags: Channel is used by net driver |
331 | * @enabled: Channel enabled indicator | 332 | * @enabled: Channel enabled indicator |
332 | * @irq: IRQ number (MSI and MSI-X only) | 333 | * @irq: IRQ number (MSI and MSI-X only) |
@@ -357,6 +358,7 @@ enum efx_rx_alloc_method { | |||
357 | struct efx_channel { | 358 | struct efx_channel { |
358 | struct efx_nic *efx; | 359 | struct efx_nic *efx; |
359 | int channel; | 360 | int channel; |
361 | char name[IFNAMSIZ + 6]; | ||
360 | int used_flags; | 362 | int used_flags; |
361 | bool enabled; | 363 | bool enabled; |
362 | int irq; | 364 | int irq; |