rdma: add option to specify inteface name
[vpp.git] / src / plugins / rdma / device.c
index 31112a9..4098d3c 100644 (file)
@@ -248,6 +248,7 @@ rdma_dev_cleanup (rdma_device_t * rd)
 
   vec_free (rd->rxqs);
   vec_free (rd->txqs);
+  vec_free (rd->name);
   pool_put (rm->devices, rd);
 }
 
@@ -430,6 +431,7 @@ 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 = ~0;
+  rd->name = vec_dup (args->name);
 
   /* check if device exist and if it is bound to mlx5_core */
   s = format (s, "/sys/class/net/%s/device/driver/module%c", args->ifname, 0);