From: Qiming Chen <chenqiming_huawei@163.com>
To: dev@dpdk.org
Cc: beilei.xing@intel.com, jingjing.wu@intel.com,
Qiming Chen <chenqiming_huawei@163.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2] net/iavf: fix mbuf leak
Date: Fri, 10 Sep 2021 16:31:38 +0800 [thread overview]
Message-ID: <20210910083138.12867-1-chenqiming_huawei@163.com> (raw)
In-Reply-To: <20210910082318.12755-1-chenqiming_huawei@163.com>
In the iavf_dev_rx_queue_start function, if the iavf_switch_queue
or iavf_switch_queue_lv function fails, the previously applied mbuf
is not released, resulting in leakage. The patch fixes the problem.
Fixes: 9cf9c02bf6ee ("net/iavf: add enable/disable queues for large VF")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
v2:
Modify coding style warning.
---
drivers/net/iavf/iavf_rxtx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index e33fe4576b..55393a9400 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -848,12 +848,14 @@ iavf_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
else
err = iavf_switch_queue_lv(adapter, rx_queue_id, true, true);
- if (err)
+ if (err) {
+ release_rxq_mbufs(rxq);
PMD_DRV_LOG(ERR, "Failed to switch RX queue %u on",
rx_queue_id);
- else
+ } else {
dev->data->rx_queue_state[rx_queue_id] =
RTE_ETH_QUEUE_STATE_STARTED;
+ }
return err;
}
--
2.30.1.windows.1
next prev parent reply other threads:[~2021-09-10 8:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-10 8:23 [dpdk-dev] [PATCH] " Qiming Chen
2021-09-10 8:31 ` Qiming Chen [this message]
2021-09-15 3:27 ` [dpdk-dev] [PATCH v2] " Zhang, Qi Z
2021-09-16 14:04 ` Qiming Chen
2021-09-22 7:04 ` 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=20210910083138.12867-1-chenqiming_huawei@163.com \
--to=chenqiming_huawei@163.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@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).