common/idpf: fix memory leak on AVX512 TX queue close
PATCH 1/1 common/idpf: fix memory leak on AVX512 TX queue close
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.
--- drivers/common/idpf/idpf_common_rxtx_avx512.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/common/idpf/idpf_common_rxtx_avx512.c +4 -0
@@ -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 = {
Signature · 1 line
2.34.1
PATCH v2 1/1 common/idpf: fix memory leak on AVX512 TX queue close
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.
--- drivers/common/idpf/idpf_common_rxtx_avx512.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/common/idpf/idpf_common_rxtx_avx512.c +4 -0
@@ -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 = {
Signature · 1 line
2.34.1
Quoted 16 lines
-----Original Message-----
From: Wu, Wenjun1 <[email protected]>
Sent: Friday, June 9, 2023 6:54 PM
To: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>; [email protected]
Subject: [PATCH v2] common/idpf: fix memory leak on AVX512 TX queue closeWhen 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.
Quoted 5 lines
Fixes 5bf87b45b2c8 ("net/idpf: add AVX512 data path for single queuemodel")
Cc: [email protected]Signed-off-by Wenjun Wu <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi