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 6E3ABA0C4B for ; Tue, 31 Aug 2021 10:07:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 617A5410DC; Tue, 31 Aug 2021 10:07:18 +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 5B23B40141; Tue, 31 Aug 2021 10:07:15 +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=Twnn5 9ZgQG1DGCPUMJ71hDjMC+f7uw2X5/iuIXpDhdc=; b=Ab2/9PMzmmxPBdBzPzuXn GpRba2du1PqiPyv3TgzBVk0lfy6B0KJh9RE5k5pAwusksSTlnA8V8yFnJGdq7FVT 9JvsoU45ClJgsH6TCoiyA43odBdQJc+MH5Lgd3Ft+AonKTBYrkqBUotj2VVFOmgQ N8fny0sanRa6TbiGdrblIQ= Received: from localhost.localdomain (unknown [124.160.214.152]) by smtp3 (Coremail) with SMTP id G9xpCgB326sv4y1hkRrqEw--.61422S2; Tue, 31 Aug 2021 16:07:13 +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:06:30 +0800 Message-Id: <20210831080630.5719-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: G9xpCgB326sv4y1hkRrqEw--.61422S2 X-Coremail-Antispam: 1Uf129KBjvJXoWrtw15Kr43AFy5CFW3Jr1UJrb_yoW8JF45pF s7Kry7Ar4UXr4xCws3Za1rCry3uan2vFWjgFW0k3s8Cr4DZryUG3ZIgFyjv3WDGr40qFWI vF1jgr47Ga9xZFDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07js6p9UUUUU= X-Originating-IP: [124.160.214.152] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/1tbiDhkAoFXl1LljngAAsX Subject: [dpdk-stable] [PATCH v2] net/ixgbe: fix mbuf leak X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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: Sync to 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