All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] net/mlx5: improve socket file path
@ 2024-12-13  9:24 Yang Ming
  2024-12-13  9:24 ` [PATCH 2/2] net/mlx5: improve log " Yang Ming
                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Yang Ming @ 2024-12-13  9:24 UTC (permalink / raw)
  To: Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
	Suanming Mou, Matan Azrad
  Cc: dev, Yang Ming

1. /var/tmp is hard code which is not a good style
2. /var/tmp may be not allowed to be written via container's
read only mode.

Signed-off-by: Yang Ming <ming.1.yang@nokia-sbell.com>
---
 drivers/net/mlx5/linux/mlx5_socket.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_socket.c b/drivers/net/mlx5/linux/mlx5_socket.c
index 6ce0e59643..7fa6e5345c 100644
--- a/drivers/net/mlx5/linux/mlx5_socket.c
+++ b/drivers/net/mlx5/linux/mlx5_socket.c
@@ -20,7 +20,7 @@
 
 /* PMD socket service for tools. */
 
-#define MLX5_SOCKET_PATH "/var/tmp/dpdk_net_mlx5_%d"
+#define MLX5_SOCKET_FNAME "dpdk_net_mlx5"
 #define MLX5_ALL_PORT_IDS 0xffff
 
 int server_socket = -1; /* Unix socket for primary process. */
@@ -177,8 +177,8 @@ mlx5_pmd_socket_init(void)
 	ret = fcntl(server_socket, F_SETFL, flags | O_NONBLOCK);
 	if (ret < 0)
 		goto close;
-	snprintf(sun.sun_path, sizeof(sun.sun_path), MLX5_SOCKET_PATH,
-		 getpid());
+	snprintf(sun.sun_path, sizeof(sun.sun_path), "%s/%s_%d",
+		 rte_eal_get_runtime_dir(), MLX5_SOCKET_FNAME, getpid());
 	remove(sun.sun_path);
 	ret = bind(server_socket, (const struct sockaddr *)&sun, sizeof(sun));
 	if (ret < 0) {
@@ -223,6 +223,7 @@ mlx5_pmd_socket_uninit(void)
 					  mlx5_pmd_socket_handle, NULL);
 	claim_zero(close(server_socket));
 	server_socket = -1;
-	MKSTR(path, MLX5_SOCKET_PATH, getpid());
+	MKSTR(path, "%s/%s_%d", rte_eal_get_runtime_dir(), MLX5_SOCKET_FNAME,
+	      getpid());
 	claim_zero(remove(path));
 }
-- 
2.34.1


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

end of thread, other threads:[~2025-11-26  9:10 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-13  9:24 [PATCH 1/2] net/mlx5: improve socket file path Yang Ming
2024-12-13  9:24 ` [PATCH 2/2] net/mlx5: improve log " Yang Ming
2025-03-04  6:23   ` Bing Zhao
2025-03-05  3:20     ` Yang Ming
2025-03-10 14:59     ` Stephen Hemminger
2025-03-12  2:32       ` [External] " Yang Ming
2025-03-17 16:05         ` Bing Zhao
2025-03-21  9:48           ` Ming 1. Yang (NSB)
2024-12-13 17:12 ` [PATCH 1/2] net/mlx5: improve socket " Stephen Hemminger
2024-12-13 17:16   ` Bruce Richardson
2025-01-03  2:51     ` Yang Ming
2025-03-12  2:55       ` Yang Ming
2025-03-14 11:48         ` Dariusz Sosnowski
2025-03-21 13:27 ` [PATCH v2 1/2] net/mlx5: enhance " Yang Ming
2025-03-21 13:27   ` [PATCH v2 2/2] net/mlx5: enhance log " Yang Ming
2025-04-10  7:53     ` Yang Ming
2025-05-12 10:12       ` Moses Young
2025-06-04  6:54         ` Maayan Kashani
2025-06-26 13:06           ` Dariusz Sosnowski
2025-07-20  8:57             ` Moses Young
2025-06-26 12:48   ` [PATCH v2 1/2] net/mlx5: enhance socket " Dariusz Sosnowski
2025-08-29 14:49   ` [PATCH v3 1/2] net/mlx5: improve socket file path handling Yang Ming
2025-08-29 14:49     ` [PATCH v3 2/2] net/mlx5: improve debug dump " Yang Ming
2025-11-07 16:48       ` Dariusz Sosnowski
2025-11-17 17:56       ` Stephen Hemminger
2025-08-29 19:57     ` [PATCH v3 1/2] net/mlx5: improve socket " Stephen Hemminger
2025-08-31  0:55       ` Moses Young
2025-08-31  3:21         ` Stephen Hemminger
2025-09-01  1:40           ` Moses Young
2025-11-17 13:43     ` Raslan Darawsheh
2025-11-17 17:58     ` Stephen Hemminger
2025-11-18 14:45       ` Dariusz Sosnowski
2025-11-26  9:10         ` Moses Young
2025-11-08  1:16   ` [PATCH v2 1/2] net/mlx5: enhance socket file path Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.