mbox series

[0/5] Fix IDXD PCI device close

Message ID 20220408141504.1319913-1-kevin.laatz@intel.com (mailing list archive)
Headers
Series Fix IDXD PCI device close |

Message

Kevin Laatz April 8, 2022, 2:14 p.m. UTC
  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(-)
  

Comments

Thomas Monjalon May 31, 2022, 4:17 p.m. UTC | #1
> 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

Any news about the v2?
  
Kevin Laatz May 31, 2022, 4:37 p.m. UTC | #2
On 31/05/2022 17:17, Thomas Monjalon wrote:
>> 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
> Any news about the v2?
>
Hi Thomas,

No v2 yet since we might be able to drop the application changes from 
this patchset - depending on the changes in the series adding bus 
cleanup to EAL cleanup [1].

Ideally I would like to rework this bug fix to utilize the changes 
proposed in [1], so there is a dependency there. That would allow us to 
fix this bug without adding dma_close() to all applications.

/Kevin

[1] https://patches.dpdk.org/project/dpdk/list/?series=23151
  
Kevin Laatz June 1, 2022, 5:10 p.m. UTC | #3
On 31/05/2022 17:37, Kevin Laatz wrote:
> On 31/05/2022 17:17, Thomas Monjalon wrote:
>>> 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
>> Any news about the v2?
>>
> Hi Thomas,
>
> No v2 yet since we might be able to drop the application changes from 
> this patchset - depending on the changes in the series adding bus 
> cleanup to EAL cleanup [1].
>
> Ideally I would like to rework this bug fix to utilize the changes 
> proposed in [1], so there is a dependency there. That would allow us 
> to fix this bug without adding dma_close() to all applications.
>
> /Kevin
>
> [1] https://patches.dpdk.org/project/dpdk/list/?series=23151

v6 of the EAL patch is up: 
https://patches.dpdk.org/project/dpdk/patch/20220601170234.11100-1-kevin.laatz@intel.com/

/Kevin