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 91DAAA050B; Fri, 8 Apr 2022 16:15:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3296040689; Fri, 8 Apr 2022 16:15:00 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 3DC5D4003F for ; Fri, 8 Apr 2022 16:14:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649427298; x=1680963298; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Q+jAOLFD7Zj9r2mD5Fh5xKGg7zI8iMVfbd7OpBeAk9s=; b=hVDk2uBpZn+h4sdWd6XsAvzWrshJz+tlPQounFmCJ12A0rrB2YgYe1BM vfx3lUPddr1TnBrZZQCfV+SKOmV8SGbbJt3jXy/TrxWBzo6CKZ6ow/9Au E6FYSwqtUhFzh5tVSMS8lopXd0mqwZqFV6Q3AFwneQaqoH6evNxFDkaaU nRLZnEjFJGFsIShnT1ZIbUXC+jFDc0Ygs7tagnl8ECgNSEkwfNuRyIfxW S2EerTegbPWF69+LSDE8rxCwMN14iJ3zcjIyxCXLmW75cKfIQ0DenETfC F/EKMatTLtGY0wH4F/ZiLl79D/LDfHMrGZGO5A2z1FDAojPd2IKRZ/ExG w==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="324762462" X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="324762462" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 07:14:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="852083808" Received: from silpixa00401122.ir.intel.com ([10.55.128.10]) by fmsmga005.fm.intel.com with ESMTP; 08 Apr 2022 07:14:55 -0700 From: Kevin Laatz To: dev@dpdk.org Cc: Kevin Laatz Subject: [PATCH 0/5] Fix IDXD PCI device close Date: Fri, 8 Apr 2022 15:14:59 +0100 Message-Id: <20220408141504.1319913-1-kevin.laatz@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This patchset addresses the device close for IDXD PCI devices. Initially, there was a memory leak reported by ASAN for the 'pci' member of the 'idxd_dmadev' struct due to a missing free. In addition, this patch set corrects the behaviour of the device close function to ensure the cleanup is completed as expected. Applications which use DMA devices should call rte_dma_close() for each device probed in order to ensure proper cleanup of the devices. This has been added to applications where DMA devices are commonly used. Kevin Laatz (5): dma/idxd: fix memory leak in pci close dma/idxd: fix memory leak due to free on incorrect pointer app/test: close dma devices during cleanup app/testpmd: stop and close dmadevs at exit examples/dma: fix missing dma close app/test-pmd/testpmd.c | 9 ++++++++ app/test/test.c | 6 ++++++ drivers/dma/idxd/idxd_common.c | 1 + drivers/dma/idxd/idxd_internal.h | 2 ++ drivers/dma/idxd/idxd_pci.c | 36 +++++++++++++++++++++++++------- examples/dma/dmafwd.c | 6 ++++++ 6 files changed, 52 insertions(+), 8 deletions(-) -- 2.31.1