aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
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)
356} 356}
357 357
358 358
359static 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}