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>, stable@dpdk.org
Subject: [PATCH v2] common/idpf: fix memory leak on AVX512 TX queue close
Date: Fri, 9 Jun 2023 18:54:05 +0800 [thread overview]
Message-ID: <20230609105405.1778979-1-wenjun1.wu@intel.com> (raw)
In-Reply-To: <20230531013955.1069485-1-wenjun1.wu@intel.com>
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.
Fixes: 5bf87b45b2c8 ("net/idpf: add AVX512 data path for single queue model")
Cc: stable@dpdk.org
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
next prev parent reply other threads:[~2023-06-09 10:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 1:39 [PATCH v1] " Wenjun Wu
2023-06-09 10:54 ` Wenjun Wu [this message]
2023-06-14 5:54 ` [PATCH v2] " 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=20230609105405.1778979-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 \
--cc=stable@dpdk.org \
/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).