Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122611
b: refs/heads/master
c: 56536e9
h: refs/heads/master
i:
  122609: 076870f
  122607: a2ab7dc
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Dec 13, 2008
1 parent 2d6b9ef commit beb30fe
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28b581ab0a0aa7bc8b22935779ca3e8d6f651ac7
refs/heads/master: 56536e9ce7c23bbc8519b8f99837493dea8da57d
24 changes: 24 additions & 0 deletions trunk/drivers/net/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1002,6 +1023,7 @@ static int efx_probe_all(struct efx_nic *efx)
goto fail3;
}
}
efx_set_channel_names(efx);

return 0;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/sfc/falcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ int falcon_init_interrupt(struct efx_nic *efx)
efx_for_each_channel(channel, efx) {
rc = request_irq(channel->irq, falcon_msi_interrupt,
IRQF_PROBE_SHARED, /* Not shared */
efx->name, channel);
channel->name, channel);
if (rc) {
EFX_ERR(efx, "failed to hook IRQ %d\n", channel->irq);
goto fail2;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/sfc/net_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ enum efx_rx_alloc_method {
*
* @efx: Associated Efx NIC
* @channel: Channel instance number
* @name: Name for channel and IRQ
* @used_flags: Channel is used by net driver
* @enabled: Channel enabled indicator
* @irq: IRQ number (MSI and MSI-X only)
Expand Down Expand Up @@ -357,6 +358,7 @@ enum efx_rx_alloc_method {
struct efx_channel {
struct efx_nic *efx;
int channel;
char name[IFNAMSIZ + 6];
int used_flags;
bool enabled;
int irq;
Expand Down

0 comments on commit beb30fe

Please sign in to comment.