aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/rdma/device.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/rdma/device.c b/src/plugins/rdma/device.c
index 6c48a97f5bf..422680df117 100644
--- a/src/plugins/rdma/device.c
+++ b/src/plugins/rdma/device.c
@@ -632,9 +632,13 @@ rdma_create_if (vlib_main_t * vm, rdma_create_if_args_t * args)
pool_get_zero (rm->devices, rd);
rd->dev_instance = rd - rm->devices;
rd->per_interface_next_index = VNET_DEVICE_INPUT_NEXT_ETHERNET_INPUT;
- rd->name = format (0, "%s", args->name);
rd->linux_ifname = format (0, "%s", args->ifname);
+ if (!args->name || 0 == args->name[0])
+ rd->name = format (0, "%s/%d", args->ifname, rd->dev_instance);
+ else
+ rd->name = format (0, "%s", args->name);
+
rd->pci = vlib_pci_get_device_info (vm, &pci_addr, &args->error);
if (!rd->pci)
goto err2;