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 162CDA0C54; Mon, 23 Aug 2021 03:52:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E9C740143; Mon, 23 Aug 2021 03:52:14 +0200 (CEST) Received: from mail-m973.mail.163.com (mail-m973.mail.163.com [123.126.97.3]) by mails.dpdk.org (Postfix) with ESMTP id 2C0F84003E; Mon, 23 Aug 2021 03:52:11 +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=8PhwV PRWPJwx0oZQjcN4dRISUSC8VtTDyzXJ0hrFWTM=; b=czqPaiVy1yGSNqmsTiIsM vnd5rR0S5M30/zJ4wGRgO0gFiFd8JtO9g+L9CA2sWYjqdrX07ziOlhjx09AtPTtQ QZi+yRTCou2/MFQHMPwxnoDYGqWaaqxCmuR2VQr/DFKLTW17b1M2kQzTQvxuV/pZ gRdE9VQam/LAObVAiTptP8= Received: from localhost.localdomain (unknown [124.160.214.99]) by smtp3 (Coremail) with SMTP id G9xpCgDntp9E_yJhcygNDw--.144S2; Mon, 23 Aug 2021 09:52:06 +0800 (CST) From: chenqiming_huawei@163.com To: dev@dpdk.org Cc: beilei.xing@intel.com, Qiming Chen , stable@dpdk.org Date: Mon, 23 Aug 2021 09:50:34 +0800 Message-Id: <20210823015034.6922-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: G9xpCgDntp9E_yJhcygNDw--.144S2 X-Coremail-Antispam: 1Uf129KBjvJXoWrtw15Kr43AFy5CFW3Jr1UJrb_yoW8Jr43pr srK347Cr4UXwnrG39rAF4fCFyfGw1DZFWjgFZIk3sY9r4qva48uF47KFy8u3WDCr48ArZ2 vF1UKr9xCa98ZFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jLhLnUUUUU= X-Originating-IP: [124.160.214.99] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/xtbBUQf3oFaD-44fpQAAsf Subject: [dpdk-dev] [PATCH] net/i40e: 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" From: Qiming Chen 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 lead. 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: 5c9222058df7 ("i40e: move to drivers/net/") Cc: stable@dpdk.org Signed-off-by: Qiming Chen --- drivers/net/i40e/i40e_rxtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 026cda948c..e4dfde9171 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -2590,6 +2590,10 @@ i40e_reset_rx_queue(struct i40e_rx_queue *rxq) #endif /* RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC */ 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; -- 2.30.1.windows.1