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 02800A0C46; Tue, 31 Aug 2021 10:03:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E61D940E2D; Tue, 31 Aug 2021 10:03:57 +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 8C9D3406A3; Tue, 31 Aug 2021 10:03:54 +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=mWeOp AvUPwUVAK6XG9DLYaLpMVCuhCP2p+yChZ/x/OQ=; b=JAVvsy3xLt2wZOOsOvC/c eKEucsx8wTE8O8wZzhgxB5F3Vam7MtB/wh8dl5kPoF++xAcpEhjkzH+tsK17Kd7w un9EM8KJ2/sErjQ5/WCqXltqSc1edcf3tiRKPEPezOrQC2JZaAT3uTbDYImn5giq Ogox0TLMzigsUHLs5PEDUo= Received: from localhost.localdomain (unknown [124.160.214.152]) by smtp3 (Coremail) with SMTP id G9xpCgAXo7Bl4i1h+b7pEw--.52058S2; Tue, 31 Aug 2021 16:03:53 +0800 (CST) From: Qiming Chen To: dev@dpdk.org Cc: haiyue.wang@intel.com, Qiming Chen , stable@dpdk.org Date: Tue, 31 Aug 2021 16:03:08 +0800 Message-Id: <20210831080308.5660-1-chenqiming_huawei@163.com> X-Mailer: git-send-email 2.30.1.windows.1 In-Reply-To: <20210831032805.5520-1-chenqiming_huawei@163.com> References: <20210831032805.5520-1-chenqiming_huawei@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: G9xpCgAXo7Bl4i1h+b7pEw--.52058S2 X-Coremail-Antispam: 1Uf129KBjvJXoWrtw15Kr43AFy5CFW3Jr1UJrb_yoW8JF1kpF s7Kry7Ar4UXr4xCwsxZa1rCry3uan2vFWjgFW0k345Cr4DZryUG3ZIgFyjv3WDGr40qFWI vF1jgr47Ga9xZFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jVUDJUUUUU= X-Originating-IP: [124.160.214.152] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/1tbiNh0AoFWBn+XebwAAsU Subject: [dpdk-dev] [PATCH v2] 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: abf7275bbaa2 ("ixgbe: move to drivers/net/") Cc: stable@dpdk.org Signed-off-by: Qiming Chen --- v2: Cc: stable@dpdk.org --- 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