From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7793CA0521 for ; Tue, 3 Nov 2020 09:28:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2E21CC7F4; Tue, 3 Nov 2020 09:28:52 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 997AAC7F4 for ; Tue, 3 Nov 2020 09:28:50 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@nvidia.com) with SMTP; 3 Nov 2020 10:28:44 +0200 Received: from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0A38SiFp010709; Tue, 3 Nov 2020 10:28:44 +0200 From: Xueming Li To: Matan Azrad , Viacheslav Ovsiienko Cc: dev@dpdk.org, xuemingl@nvidia.com, Asaf Penso , bingz@nvidia.com, stable@dpdk.org Date: Tue, 3 Nov 2020 08:28:43 +0000 Message-Id: <1604392123-8397-1-git-send-email-xuemingl@nvidia.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-stable] [PATCH] net/mlx5: fix unix socket server file name X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "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 --- 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