net/vdev_netvsc: shorten devices names
authorOphir Munk <ophirmu@mellanox.com>
Tue, 10 Apr 2018 07:20:21 +0000 (07:20 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 16:34:42 +0000 (17:34 +0100)
Prior to this commit the vdev_netvsc PMD was creating tap and failsafe
devices with long names, such as "net_tap_net_vdev_netvsc0" or
"net_failsafe_net_vdev_netvsc0".
This commits creates tap and failsafe devices with short names such as
"net_tap_netvsc0" or "net_failsafe_netvsc0".

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/vdev_netvsc/vdev_netvsc.c

index f902dbe..f83aab4 100644 (file)
@@ -614,13 +614,13 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface,
                       name, ctx->id);
        if (ret == -1 || (size_t)ret >= sizeof(ctx->name))
                ++i;
-       ret = snprintf(ctx->devname, sizeof(ctx->devname), "net_failsafe_%s",
-                      ctx->name);
+       ret = snprintf(ctx->devname, sizeof(ctx->devname), "net_failsafe_vsc%u",
+                      ctx->id);
        if (ret == -1 || (size_t)ret >= sizeof(ctx->devname))
                ++i;
        ret = snprintf(ctx->devargs, sizeof(ctx->devargs),
-                      "fd(%d),dev(net_tap_%s,remote=%s)",
-                      ctx->pipe[0], ctx->name, ctx->if_name);
+                      "fd(%d),dev(net_tap_vsc%u,remote=%s)",
+                      ctx->pipe[0], ctx->id, ctx->if_name);
        if (ret == -1 || (size_t)ret >= sizeof(ctx->devargs))
                ++i;
        if (i) {