rdma: fix name auto-generation on create
When creating rdma interface without specifying a name, we need to generate one instead of NULL. Type: fix Change-Id: If41870691dec47e8e673d48ac4b4ddffd2385a03 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit a50892e1504401e243076f08d9077675eb0b030e)
This commit is contained in:

committed by
Andrew Yourtchenko

parent
4cf238b9d7
commit
061e8671a7
@ -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;
|
||||
|
Reference in New Issue
Block a user