From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C339D4CBB for ; Wed, 1 Aug 2018 00:38:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from ophirmu@mellanox.com) with ESMTPS (AES256-SHA encrypted); 1 Aug 2018 01:41:34 +0300 Received: from localhost.localdomain (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w6VMcCJ4004222; Wed, 1 Aug 2018 01:38:12 +0300 Received: from pegasus05.mtr.labs.mlnx (localhost [127.0.0.1]) by localhost.localdomain (8.14.7/8.14.7) with ESMTP id w6VMcChN019122; Tue, 31 Jul 2018 22:38:12 GMT Received: (from root@localhost) by pegasus05.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id w6VMcBZF019120; Tue, 31 Jul 2018 22:38:11 GMT From: Ophir Munk To: dev@dpdk.org, Shahaf Shuler Cc: Thomas Monjalon , Olga Shern , Ophir Munk , stable@dpdk.org Date: Tue, 31 Jul 2018 22:38:04 +0000 Message-Id: <1533076684-19078-1-git-send-email-ophirmu@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH v1] net/mlx5: fix secondary process resource leakage X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2018 22:38:17 -0000 When running testpmd with an mlx5 device and then executing at testpmd prompt in a raw: "port start all" followed by "port stop all" a new file named /var/tmp/net_mlx5_ is created as a result of creating a new unix domain socket (used for communication between the primary and secondary processes). When the new unix socket file is created the old unix socket file should have been removed. This commit fixes it by closing the old unix socket just before creating the new one in function mlx5_socket_init() Fixes: f8b9a3bad467 ("net/mlx5: install a socket to exchange a file descriptor") Cc: stable@dpdk.org Signed-off-by: Ophir Munk --- drivers/net/mlx5/mlx5_socket.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/mlx5/mlx5_socket.c b/drivers/net/mlx5/mlx5_socket.c index 99297d5..a3a5229 100644 --- a/drivers/net/mlx5/mlx5_socket.c +++ b/drivers/net/mlx5/mlx5_socket.c @@ -36,6 +36,12 @@ int flags; /* + * Close the last socket that was used to communicate + * with the secondary process + */ + if (priv->primary_socket) + mlx5_socket_uninit(dev); + /* * Initialise the socket to communicate with the secondary * process. */ -- 1.8.3.1