From patchwork Tue Aug 31 03:28:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiming Chen X-Patchwork-Id: 97575 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C39D6A0C4D; Tue, 31 Aug 2021 05:29:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8669D410FC; Tue, 31 Aug 2021 05:29:01 +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 5ACCB410F8 for ; Tue, 31 Aug 2021 05:29:00 +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=qtR6O Vve89EEZ/lJSiGa+eud6o4KTYvn0bPqt2TkVOA=; b=Gg2A3FTs32FgdqgYZYwHy sIyKDeTuMF0GzcIFXB8sX9VYp7iqw5G84khWfVhNO95rUIK4pe01kJzAOpg0xgbX n07LTZZbsaI8x/4huFtFph67HHTMYEJbuywb0MycZM5kFcx3+3wg6P0ksl1Un7h2 HgJ1lbRzJeyc6Osd8wDWAs= Received: from localhost.localdomain (unknown [124.160.214.152]) by smtp3 (Coremail) with SMTP id G9xpCgAnnaX2oS1hWP7KEw--.58637S2; Tue, 31 Aug 2021 11:28:57 +0800 (CST) From: Qiming Chen To: dev@dpdk.org Cc: haiyue.wang@intel.com, Qiming Chen Date: Tue, 31 Aug 2021 11:28:05 +0800 Message-Id: <20210831032805.5520-1-chenqiming_huawei@163.com> X-Mailer: git-send-email 2.30.1.windows.1 MIME-Version: 1.0 X-CM-TRANSID: G9xpCgAnnaX2oS1hWP7KEw--.58637S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw15Kr43AFy5CFW3Jr1UJrb_yoWkZrc_Ca ykXF47Gr15GF4xKa4akryxZFySkanxurn5urs2q34xGw1aqr4Syas5ZrnIyw18Grs8WFsx Arn5WF1I9Fy7ZjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8g_-DUUUUU== X-Originating-IP: [124.160.214.152] X-CM-SenderInfo: xfkh01xlpl0w5bkxt4lhl6il2tof0z/1tbiDh8AoFXl1LbXLgAAsa Subject: [dpdk-dev] [PATCH] net/ixgbe: slove 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. Signed-off-by: Qiming Chen Acked-by: Haiyue Wang Signed-off-by: Qiming Chen Acked-by: Haiyue Wang Signed-off-by: Qiming Chen Acked-by: Haiyue Wang --- 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;