From patchwork Wed May 31 01:39:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 127733 X-Patchwork-Delegate: qi.z.zhang@intel.com 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 713B142BE8; Wed, 31 May 2023 03:39:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7D6240ED7; Wed, 31 May 2023 03:39:19 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 5010A40E2D for ; Wed, 31 May 2023 03:39:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685497158; x=1717033158; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fJlWLO+Jc6BdIYCXQblfUzebhlHaUdmjUx/uCBz5MIk=; b=EH5X9KEbhnMxvqeK0Ocy3oq5PGZYyAl+/KS+ptw0KatEpy8n22BhhefL 5jwRhEQLyhyAdolGXsCnV9czNxvtzKcbxOAnYff4CLyFvBcWAuIeJpoqs JHCWh1EDxEa+ULAeaj16ZtRr2Df7zdwuWzCCKxXV6O9bPpElhxThK1+yO vQLxs02VR1+Rr2wyptyLZvDyBAsh2ODsKkwG8pONpYYoN7JFMLa/HtWdr GGjq2GTUPiaT22zKUDqAMpCqNEeWrDRUWVpSIxvNrBkMrGxMEdQMvzJ2P sQlt4zfSWWpXOue1vghqZq8HnAPwPe/ewjaUJctNgdwDB4VVWp6GhsICg Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10726"; a="420862809" X-IronPort-AV: E=Sophos;i="6.00,205,1681196400"; d="scan'208";a="420862809" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2023 18:39:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10726"; a="1036814196" X-IronPort-AV: E=Sophos;i="6.00,205,1681196400"; d="scan'208";a="1036814196" Received: from dpdk-wuwenjun-icelake-ii.sh.intel.com ([10.67.110.188]) by fmsmga005.fm.intel.com with ESMTP; 30 May 2023 18:39:15 -0700 From: Wenjun Wu To: dev@dpdk.org, jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com Cc: Wenjun Wu Subject: [PATCH v1] common/idpf: fix memory leak on AVX512 TX queue close Date: Wed, 31 May 2023 09:39:55 +0800 Message-Id: <20230531013955.1069485-1-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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 When releasing mbufs for TX queue software ring of AVX512, the mbuf in the range [i, tx_tail] should also be freed. The variable i refers to the index of the last mbuf released in the software ring. Signed-off-by: Wenjun Wu --- drivers/common/idpf/idpf_common_rxtx_avx512.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/common/idpf/idpf_common_rxtx_avx512.c b/drivers/common/idpf/idpf_common_rxtx_avx512.c index dffb11fcf2..81312617cc 100644 --- a/drivers/common/idpf/idpf_common_rxtx_avx512.c +++ b/drivers/common/idpf/idpf_common_rxtx_avx512.c @@ -1601,6 +1601,10 @@ idpf_tx_release_mbufs_avx512(struct idpf_tx_queue *txq) } i = 0; } + for (; i < txq->tx_tail; i++) { + rte_pktmbuf_free_seg(swr[i].mbuf); + swr[i].mbuf = NULL; + } } static const struct idpf_txq_ops avx512_tx_vec_ops = {