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 AFF25A0547; Fri, 10 Sep 2021 10:24:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E50740041; Fri, 10 Sep 2021 10:24:16 +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 1FF304003E; Fri, 10 Sep 2021 10:24:13 +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=fycYU FnuJBT16SxjJSfkZl6kAT8CDFmpvVL3f/zGmFA=; b=TwuWNwihYZHQfm2tSuLxn jLCAlL1vlfP4dMMjpSiOMVy4axbQCmoXfVDwfXnwca9S3NsWp3ghI3tPHVdFZfuW lJ8eHhyzAqeXNMu2SybPizr3b+CSsdtDlut1z+4UNgIoLig3vA7mx/4E9i+klhEo LNFiX0aR5VKsq+3R2/PH+E= Received: from localhost.localdomain (unknown [124.160.213.250]) by smtp4 (Coremail) with SMTP id HNxpCgBHAFQlFjthteYkCA--.97S2; Fri, 10 Sep 2021 16:24:11 +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:23:18 +0800 Message-Id: <20210910082318.12755-1-chenqiming_huawei@163.com> X-Mailer: git-send-email 2.30.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: HNxpCgBHAFQlFjthteYkCA--.97S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7JF45tFW8JF18WF17Jr1xGrg_yoWDCwb_Wa 10qF42qr4qk3ZYqr48Ar4fXFWrKFWvqF1fuF42vaySy39xXw45Xr17ZrnxCw4UAa1vkF9r Cr13C34rKa4agjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU1iZ2DUUUUU== X-Originating-IP: [124.160.213.250] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/xtbBzwsKoFaEAIyPxgAAs5 Subject: [dpdk-dev] [PATCH] 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 --- 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