* [dpdk-stable] [PATCH] net/mlx5: fix unix socket server file name
@ 2020-11-03 8:28 Xueming Li
2020-11-13 14:57 ` Slava Ovsiienko
0 siblings, 1 reply; 3+ messages in thread
From: Xueming Li @ 2020-11-03 8:28 UTC (permalink / raw)
To: Matan Azrad, Viacheslav Ovsiienko
Cc: dev, xuemingl, Asaf Penso, bingz, stable
mlx_steering_dump_parser.py tool failed to dump flow due to socket file
name changed.
Change socket file name back to make it consistent.
Fixes: b1e15224849b ("common/mlx5: fix PCI driver name")
Cc: bingz@nvidia.com
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
drivers/net/mlx5/linux/mlx5_socket.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/drivers/net/mlx5/linux/mlx5_socket.c b/drivers/net/mlx5/linux/mlx5_socket.c
index 08af905126..1938453980 100644
--- a/drivers/net/mlx5/linux/mlx5_socket.c
+++ b/drivers/net/mlx5/linux/mlx5_socket.c
@@ -20,16 +20,11 @@
/* PMD socket service for tools. */
+#define MLX5_SOCKET_PATH "/var/tmp/dpdk_net_mlx5_%d"
+
int server_socket; /* Unix socket for primary process. */
struct rte_intr_handle server_intr_handle; /* Interrupt handler. */
-static void
-mlx5_pmd_make_path(struct sockaddr_un *addr, int pid)
-{
- snprintf(addr->sun_path, sizeof(addr->sun_path), "/var/tmp/dpdk_%s_%d",
- MLX5_DRIVER_NAME, pid);
-}
-
/**
* Handle server pmd socket interrupts.
*/
@@ -186,7 +181,8 @@ mlx5_pmd_socket_init(void)
ret = fcntl(server_socket, F_SETFL, flags | O_NONBLOCK);
if (ret < 0)
goto error;
- mlx5_pmd_make_path(&sun, getpid());
+ snprintf(sun.sun_path, sizeof(sun.sun_path), MLX5_SOCKET_PATH,
+ getpid());
remove(sun.sun_path);
ret = bind(server_socket, (const struct sockaddr *)&sun, sizeof(sun));
if (ret < 0) {
@@ -225,6 +221,6 @@ RTE_FINI(mlx5_pmd_socket_uninit)
mlx5_pmd_interrupt_handler_uninstall();
claim_zero(close(server_socket));
server_socket = 0;
- MKSTR(path, "/var/tmp/dpdk_%s_%d", MLX5_DRIVER_NAME, getpid());
+ MKSTR(path, MLX5_SOCKET_PATH, getpid());
claim_zero(remove(path));
}
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH] net/mlx5: fix unix socket server file name
2020-11-03 8:28 [dpdk-stable] [PATCH] net/mlx5: fix unix socket server file name Xueming Li
@ 2020-11-13 14:57 ` Slava Ovsiienko
2020-11-13 19:17 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Slava Ovsiienko @ 2020-11-13 14:57 UTC (permalink / raw)
To: Xueming(Steven) Li, Matan Azrad
Cc: dev, Xueming(Steven) Li, Asaf Penso, Bing Zhao, stable
> -----Original Message-----
> From: Xueming Li <xuemingl@nvidia.com>
> Sent: Tuesday, November 3, 2020 10:29
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Xueming(Steven) Li <xuemingl@nvidia.com>; Asaf Penso
> <asafp@nvidia.com>; Bing Zhao <bingz@nvidia.com>; stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix unix socket server file name
>
> mlx_steering_dump_parser.py tool failed to dump flow due to socket file name
> changed.
>
> Change socket file name back to make it consistent.
>
> Fixes: b1e15224849b ("common/mlx5: fix PCI driver name")
> Cc: bingz@nvidia.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
> drivers/net/mlx5/linux/mlx5_socket.c | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/mlx5/linux/mlx5_socket.c
> b/drivers/net/mlx5/linux/mlx5_socket.c
> index 08af905126..1938453980 100644
> --- a/drivers/net/mlx5/linux/mlx5_socket.c
> +++ b/drivers/net/mlx5/linux/mlx5_socket.c
> @@ -20,16 +20,11 @@
>
> /* PMD socket service for tools. */
>
> +#define MLX5_SOCKET_PATH "/var/tmp/dpdk_net_mlx5_%d"
> +
> int server_socket; /* Unix socket for primary process. */ struct
> rte_intr_handle server_intr_handle; /* Interrupt handler. */
>
> -static void
> -mlx5_pmd_make_path(struct sockaddr_un *addr, int pid) -{
> - snprintf(addr->sun_path, sizeof(addr->sun_path),
> "/var/tmp/dpdk_%s_%d",
> - MLX5_DRIVER_NAME, pid);
> -}
> -
> /**
> * Handle server pmd socket interrupts.
> */
> @@ -186,7 +181,8 @@ mlx5_pmd_socket_init(void)
> ret = fcntl(server_socket, F_SETFL, flags | O_NONBLOCK);
> if (ret < 0)
> goto error;
> - mlx5_pmd_make_path(&sun, getpid());
> + snprintf(sun.sun_path, sizeof(sun.sun_path), MLX5_SOCKET_PATH,
> + getpid());
> remove(sun.sun_path);
> ret = bind(server_socket, (const struct sockaddr *)&sun, sizeof(sun));
> if (ret < 0) {
> @@ -225,6 +221,6 @@ RTE_FINI(mlx5_pmd_socket_uninit)
> mlx5_pmd_interrupt_handler_uninstall();
> claim_zero(close(server_socket));
> server_socket = 0;
> - MKSTR(path, "/var/tmp/dpdk_%s_%d", MLX5_DRIVER_NAME,
> getpid());
> + MKSTR(path, MLX5_SOCKET_PATH, getpid());
> claim_zero(remove(path));
> }
> --
> 2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH] net/mlx5: fix unix socket server file name
2020-11-13 14:57 ` Slava Ovsiienko
@ 2020-11-13 19:17 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2020-11-13 19:17 UTC (permalink / raw)
To: Xueming(Steven) Li
Cc: Matan Azrad, stable, dev, Asaf Penso, Bing Zhao, Slava Ovsiienko
> > mlx_steering_dump_parser.py tool failed to dump flow due to socket file name
> > changed.
> >
> > Change socket file name back to make it consistent.
> >
> > Fixes: b1e15224849b ("common/mlx5: fix PCI driver name")
> > Cc: bingz@nvidia.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Xueming Li <xuemingl@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Applied in next-net-mlx, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-13 19:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 8:28 [dpdk-stable] [PATCH] net/mlx5: fix unix socket server file name Xueming Li
2020-11-13 14:57 ` Slava Ovsiienko
2020-11-13 19:17 ` Thomas Monjalon
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).