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 D16D5A0C53; Wed, 1 Sep 2021 09:23:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 573E34013F; Wed, 1 Sep 2021 09:23:29 +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 F319540041; Wed, 1 Sep 2021 09:23: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=e7bL9 wf9tmcRE+5tOmyl+l3MFh7tyx7xfwMQXrwkABU=; b=nDqcuYDLSH2Tylf0Lhvc7 PtPVv9d83Sh6hUFYsmK+kvLAZBxDgcwDUesRW/NpVuWZf/W8gP5mHTkQpNjWkqgM hlwTlA48HJBIII0Kgh6rSad1XN4lJsuCIAgNy2zAj8geECVPSt+zG+Mw8xDYBv6w trgr6tuALhi78iJLWTOHWA= Received: from localhost.localdomain (unknown [124.160.213.27]) by smtp2 (Coremail) with SMTP id GtxpCgC3hwtmKi9hSfttQw--.3S2; Wed, 01 Sep 2021 15:23:23 +0800 (CST) From: Qiming Chen To: dev@dpdk.org Cc: haiyue.wang@intel.com, Qiming Chen , stable@dpdk.org Date: Wed, 1 Sep 2021 15:22:37 +0800 Message-Id: <20210901072237.9451-1-chenqiming_huawei@163.com> X-Mailer: git-send-email 2.30.1.windows.1 In-Reply-To: <20210831080630.5719-1-chenqiming_huawei@163.com> References: <20210831080630.5719-1-chenqiming_huawei@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: GtxpCgC3hwtmKi9hSfttQw--.3S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJr43ur47AF43GryUtrWfGrg_yoW8JFy3pF s7Kry7Ar4UXr4xCws3Za15CFy3uan2vFWjgFWvk34Ykr4DZryUC3ZFgFyjv3WDGr48XrW2 vF1jgr47Gay3ZFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jjfOwUUUUU= X-Originating-IP: [124.160.213.27] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/xtbBZwsBoFet3xYD4QAAsc Subject: [dpdk-dev] [PATCH v3] net/ixgbe: 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: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Qiming Chen --- v2: Sync to stable@dpdk.org v3: Modify fixes commit --- drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index c814a28cb4..bfdfd5e755 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -2981,6 +2981,10 @@ ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue *rxq) rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1); 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