DPDK patches and discussions
 help / color / mirror / Atom feed
From: longli@linuxonhyperv.com
To: Matan Azrad <matan@nvidia.com>, Ferruh Yigit <ferruh.yigit@xilinx.com>
Cc: dev@dpdk.org, Long Li <longli@microsoft.com>
Subject: [PATCH] net/mlx4: fix verbs cmd fd leak in the secondary process
Date: Wed,  6 Jul 2022 10:22:24 -0700	[thread overview]
Message-ID: <1657128145-7764-1-git-send-email-longli@linuxonhyperv.com> (raw)

From: Long Li <longli@microsoft.com>

FDs passed from rte_mp_msg are duplicated to the secondary process and
need to be closed.

Fixes: 0203d33a10 ("net/mlx4: support secondary process")
Signed-off-by: Long Li <longli@microsoft.com>
---
 drivers/net/mlx4/mlx4_txq.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c
index 0db2e55bef..bf7e036e19 100644
--- a/drivers/net/mlx4/mlx4_txq.c
+++ b/drivers/net/mlx4/mlx4_txq.c
@@ -146,6 +146,7 @@ mlx4_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd)
 		if (ret)
 			goto error;
 	}
+	close(fd);
 	return 0;
 error:
 	/* Rollback. */
@@ -155,6 +156,7 @@ mlx4_tx_uar_init_secondary(struct rte_eth_dev *dev, int fd)
 			continue;
 		txq_uar_uninit_secondary(txq);
 	} while (i--);
+	close(fd);
 	return -rte_errno;
 }
 
-- 
2.17.1


             reply	other threads:[~2022-07-06 17:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 17:22 longli [this message]
2022-07-06 17:22 ` [PATCH] net/mlx5: fix verbs " longli

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=1657128145-7764-1-git-send-email-longli@linuxonhyperv.com \
    --to=longli@linuxonhyperv.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=longli@microsoft.com \
    --cc=matan@nvidia.com \
    /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).