From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6E5FBA0547; Fri, 10 Sep 2021 10:32:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1A46406B4; Fri, 10 Sep 2021 10:32:28 +0200 (CEST) Received: from mail-m974.mail.163.com (mail-m974.mail.163.com [123.126.97.4]) by mails.dpdk.org (Postfix) with ESMTP id 413934067E; Fri, 10 Sep 2021 10:32:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=xMdus x5C6crGwwP5cRQC4KMkwDJ2KqAemG4uYFl05bQ=; b=j76Ru5MbQhNkofZ/W0DKS 3fRmmjE6evegpjQaaw0ZbZtlGeMbWMaCP1XNtpdnfSc8IGorMJ946TXE7mcv8kly 7p+YckTPq5rHH8iGPF0L5vxlgB5h16gQgBjVjMcZDeYBVdNUiySOpkZuY+Akse5k xHdhzV4V9wK0pXcpbj/Yb4= Received: from localhost.localdomain (unknown [124.160.213.250]) by smtp4 (Coremail) with SMTP id HNxpCgCHFTMVGDthDiMmCA--.86S2; Fri, 10 Sep 2021 16:32:24 +0800 (CST) From: Qiming Chen To: dev@dpdk.org Cc: beilei.xing@intel.com, jingjing.wu@intel.com, Qiming Chen , stable@dpdk.org Date: Fri, 10 Sep 2021 16:31:38 +0800 Message-Id: <20210910083138.12867-1-chenqiming_huawei@163.com> X-Mailer: git-send-email 2.30.1.windows.1 In-Reply-To: <20210910082318.12755-1-chenqiming_huawei@163.com> References: <20210910082318.12755-1-chenqiming_huawei@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: HNxpCgCHFTMVGDthDiMmCA--.86S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7JF45tFW8JF18WF17Jr1xGrg_yoWkArb_Wa 10qF42qr4qk3ZYqr18Ar4fXFW8Kr4vqFn5uF42v3ySy3s3Zw45Xr1UZrnxCw48Aa1qkFy7 Cr13C34rta43XjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU1NzV5UUUUU== X-Originating-IP: [124.160.213.250] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/xtbBZAwKoFQHOZZX8QAAsY Subject: [dpdk-dev] [PATCH v2] net/iavf: fix mbuf leak X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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