net/i40e: fix mbuf resource leakage problem

Message ID 20210821072220.5107-1-chenqiming_huawei@163.com (mailing list archive)
State Not Applicable, archived
Delegated to: Qi Zhang
Headers
Series net/i40e: fix mbuf resource leakage problem |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing fail Testing issues
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing fail Testing issues

Commit Message

Qiming Chen Aug. 21, 2021, 7:22 a.m. UTC
  From: Qiming Chen <chenqiming_huawei@163.com>

In the i40evf_dev_rx_queue_start function, when the function
i40evf_switch_queue returns failed, the previously requested mbuf resource
is not released.

Fixes: 74b7496b0cb3 ("net/i40e: remove redundant queue id checks")
Cc: stable@dpdk.org

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 0cfe13b7b2..003d41373b 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1822,6 +1822,7 @@  i40evf_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
 	/* Ready to switch the queue on */
 	err = i40evf_switch_queue(dev, TRUE, rx_queue_id, TRUE);
 	if (err) {
+		i40e_rx_queue_release_mbufs(rxq);
 		PMD_DRV_LOG(ERR, "Failed to switch RX queue %u on",
 			    rx_queue_id);
 		return err;