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 246DFA034F; Sat, 11 Sep 2021 03:48:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A287340041; Sat, 11 Sep 2021 03:47:59 +0200 (CEST) Received: from mail-m972.mail.163.com (mail-m972.mail.163.com [123.126.97.2]) by mails.dpdk.org (Postfix) with ESMTP id 789CA4003E; Sat, 11 Sep 2021 03:47:57 +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=dhvup yfY+EizVgbk1KYM6CsVo0WSPBy10kSLiTXTFHw=; b=DuBCWA0fQWlc82OcFBPwN JgtGN6EarfCf5g/GDaqyAORWsGJOpIfbQKBncTD1JAKVCzOXRIDETVvLLOMaDb4/ C+gpl/9LnKE1Ptu29iTKcHbCKnlbXNVc7EJYTPrGucBMClDwuaXDhJc+8EktD8Vk D+uk4PPVe7n2A+mGXvJhTI= Received: from localhost.localdomain (unknown [124.160.213.250]) by smtp2 (Coremail) with SMTP id GtxpCgAnW43ICjxhxn3iSQ--.57S2; Sat, 11 Sep 2021 09:47:55 +0800 (CST) From: Qiming Chen To: dev@dpdk.org Cc: beilei.xing@intel.com, jingjing.wu@intel.com, Qiming Chen , stable@dpdk.org Date: Sat, 11 Sep 2021 09:47:09 +0800 Message-Id: <20210911014709.2518-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: GtxpCgAnW43ICjxhxn3iSQ--.57S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw15Kr43AFy5CFW3Jr1UJrb_yoWkAFc_Ga 1qqr17Gr1UJa18KasrC3yxZFW0gw1fuwn5ua4Iv3yxAw13tr4Iyr1kur1ayr4rCr48WFsx Ar1DX34fZa43ZjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0189JUUUUU== X-Originating-IP: [124.160.213.250] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/xtbBUQkKoFaEADnUeAABs0 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" A local test found that repeated port start and stop operations during the continuous SSE vector bufflist receiving process will cause the mbuf resource to run out. The final positioning is when the port is stopped, the mbuf of the pkt_first_seg pointer is not released. Resources leak. The patch scheme is to judge whether the pointer is empty when the port is stopped, and release the corresponding mbuf if it is not empty. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Cc: stable@dpdk.org Signed-off-by: Qiming Chen --- drivers/net/iavf/iavf_rxtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index 55393a9400..59448eae98 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -225,6 +225,10 @@ reset_rx_queue(struct iavf_rx_queue *rxq) rxq->rx_tail = 0; rxq->nb_rx_hold = 0; + + if (rxq->pkt_first_seg != NULL) + rte_pktmbuf_free(rxq->pkt_first_seg); + rxq->pkt_first_seg = NULL; rxq->pkt_last_seg = NULL; rxq->rxrearm_nb = 0; -- 2.30.1.windows.1