DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/vdev_netvsc: fix creating short name devices
@ 2018-04-10  7:20 Ophir Munk
  2018-04-10  8:04 ` Matan Azrad
  2018-04-24 12:56 ` [dpdk-dev] " Ferruh Yigit
  0 siblings, 2 replies; 10+ messages in thread
From: Ophir Munk @ 2018-04-10  7:20 UTC (permalink / raw)
  To: dev, Matan Azrad; +Cc: Thomas Monjalon, Olga Shern, Ophir Munk, stable

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".
Long names containing more than 32 characters may be rejected by some
APIs (e.g. membuf pool creation).
This commits fixes this issue by creating tap and failsafe devices
with short names such as "tap_net_vsc0" or "net_failsafe_vsc0".

Fixes: e7dc5d7becc5 ("net/vdev_netvsc: implement core functionality")
Cc: stable@dpdk.org

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 drivers/net/vdev_netvsc/vdev_netvsc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index db0080a..bb2f78d 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -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) {
-- 
2.7.4

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-25 10:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10  7:20 [dpdk-dev] [PATCH v1] net/vdev_netvsc: fix creating short name devices Ophir Munk
2018-04-10  8:04 ` Matan Azrad
2018-04-10 15:35   ` Ophir Munk
2018-04-10 15:39     ` Matan Azrad
2018-04-24 14:19       ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2018-04-25 10:25         ` Matan Azrad
2018-04-25 10:29           ` Ferruh Yigit
2018-04-25 10:33             ` Matan Azrad
2018-04-25 10:49               ` Ferruh Yigit
2018-04-24 12:56 ` [dpdk-dev] " Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).