patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@mellanox.com>
To: stable@dpdk.org, Shahaf Shuler <shahafs@mellanox.com>
Cc: Thomas Monjalon <thomas@monjalon.net>,
	Olga Shern <olgas@mellanox.com>,
	Ophir Munk <ophirmu@mellanox.com>
Subject: [dpdk-stable] [PATCH 17.11 v1] net/mlx5: fix secondary process resource leakage
Date: Wed,  1 Aug 2018 13:21:13 +0000	[thread overview]
Message-ID: <1533129673-20901-1-git-send-email-ophirmu@mellanox.com> (raw)

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_<socket num> 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 priv_socket_init()

Fixes: f8b9a3bad467 ("net/mlx5: install a socket to exchange a file descriptor")
Cc: stable@dpdk.org

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 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 5cd1ab8..e817df1 100644
--- a/drivers/net/mlx5/mlx5_socket.c
+++ b/drivers/net/mlx5/mlx5_socket.c
@@ -62,6 +62,12 @@
 	struct stat file_stat;
 
 	/*
+	 * Close the last socket that was used to communicate
+	 * with the secondary process
+	 */
+       if (priv->primary_socket)
+               priv_socket_uninit(priv);
+	/*
 	 * Initialise the socket to communicate with the secondary
 	 * process.
 	 */
-- 
1.8.3.1

             reply	other threads:[~2018-08-01 13:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01 13:21 Ophir Munk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-08-01 13:19 Ophir Munk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1533129673-20901-1-git-send-email-ophirmu@mellanox.com \
    --to=ophirmu@mellanox.com \
    --cc=olgas@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).