DPDK patches and discussions
 help / color / mirror / Atom feed
From: Wenjun Wu <wenjun1.wu@intel.com>
To: dev@dpdk.org, jingjing.wu@intel.com, beilei.xing@intel.com,
	qi.z.zhang@intel.com
Cc: Wenjun Wu <wenjun1.wu@intel.com>
Subject: [PATCH v1] common/idpf: fix memory leak on AVX512 TX queue close
Date: Wed, 31 May 2023 09:39:55 +0800	[thread overview]
Message-ID: <20230531013955.1069485-1-wenjun1.wu@intel.com> (raw)

When releasing mbufs for TX queue software ring of AVX512,
the mbuf in the range [i, tx_tail] should also be freed.
The variable i refers to the index of the last mbuf released
in the software ring.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
---
 drivers/common/idpf/idpf_common_rxtx_avx512.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/common/idpf/idpf_common_rxtx_avx512.c b/drivers/common/idpf/idpf_common_rxtx_avx512.c
index dffb11fcf2..81312617cc 100644
--- a/drivers/common/idpf/idpf_common_rxtx_avx512.c
+++ b/drivers/common/idpf/idpf_common_rxtx_avx512.c
@@ -1601,6 +1601,10 @@ idpf_tx_release_mbufs_avx512(struct idpf_tx_queue *txq)
 		}
 		i = 0;
 	}
+	for (; i < txq->tx_tail; i++) {
+		rte_pktmbuf_free_seg(swr[i].mbuf);
+		swr[i].mbuf = NULL;
+	}
 }
 
 static const struct idpf_txq_ops avx512_tx_vec_ops = {
-- 
2.34.1


             reply	other threads:[~2023-05-31  1:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  1:39 Wenjun Wu [this message]
2023-06-09 10:54 ` [PATCH v2] " Wenjun Wu
2023-06-14  5:54   ` Zhang, Qi Z

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=20230531013955.1069485-1-wenjun1.wu@intel.com \
    --to=wenjun1.wu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.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).