Skip to content

Device unplug and bus cleanup refactoring for NXP

David Marchand dpdk-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest16 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16drivers/bus: cleanup device freeing in NXP bus scandrivers/bus/dpaa/dpaa_bus.c drivers/bus/fslmc/fslmc_bus.c+8 -290 replies
2/16drivers/bus: fix FD leak during scan in NXP driversdrivers/bus/dpaa/dpaa_bus.c drivers/bus/fslmc/fslmc_vfio.c+17 -120 replies
3/16bus/dpaa: allocate interrupt during probingdrivers/bus/dpaa/dpaa_bus.c+47 -400 replies
4/16bus/dpaa: support unplug and use generic cleanupdoc/guides/rel_notes/release_26_11.rst drivers/bus/dpaa/dpaa_bus.c+37 -230 replies
5/16bus/fslmc: fix device name leakdrivers/bus/fslmc/bus_fslmc_driver.h drivers/bus/fslmc/fslmc_bus.c+5 -70 replies
6/16bus/fslmc: fix memory leaks in scandrivers/bus/fslmc/fslmc_bus.c drivers/bus/fslmc/fslmc_vfio.c drivers/bus/fslmc/private.h+29 -290 replies
7/16bus/fslmc: fix per type device countdrivers/bus/fslmc/fslmc_bus.c+5 -30 replies
8/16bus/fslmc: fix some VFIO device FD and memory leaksdrivers/bus/fslmc/fslmc_vfio.c+30 -150 replies
9/16bus/fslmc: fix interrupt leak in DPIO cleanupdrivers/bus/fslmc/portal/dpaa2_hw_dpio.c+1 -00 replies
10/16bus/fslmc: simplify device parsing in scandrivers/bus/fslmc/fslmc_bus.c+39 -480 replies
11/16bus/fslmc: release resources on probe failuredrivers/bus/fslmc/fslmc_bus.c drivers/bus/fslmc/fslmc_vfio.c drivers/bus/fslmc/fslmc_vfio.h+57 -100 replies
12/16bus/fslmc: refactor device filtering for multiprocessdrivers/bus/fslmc/fslmc_bus.c drivers/bus/fslmc/fslmc_vfio.c drivers/bus/fslmc/private.h+250 -1620 replies
13/16bus/fslmc: move unplug for some device out of VFIOdrivers/bus/fslmc/fslmc_bus.c drivers/bus/fslmc/fslmc_vfio.c+10 -140 replies
14/16bus/fslmc: call VFIO setup for some device from bus layerdrivers/bus/fslmc/fslmc_bus.c drivers/bus/fslmc/fslmc_vfio.c drivers/bus/fslmc/fslmc_vfio.h+83 -180 replies
15/16bus/fslmc: allocate interrupt during probingdrivers/bus/fslmc/fslmc_bus.c+22 -300 replies
16/16bus/fslmc: use generic cleanupdrivers/bus/fslmc/fslmc_bus.c+14 -110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/16] Device unplug and bus cleanup refactoring for NXP

Hello Hemant,

This is a followup to the refactoring started in 26.07.

I took some time with my best AI friend to cleanup DPAA and FSLMC bus drivers.

Like the last time, only compilation has been checked. I have no hardware to test runtime.

One thing that could be broken is either the order of devices initialisation, or bugs in the device filtering that I tried to simplify.

I went with the approach of splitting the device list between internal bus object (that I called "control" devices, maybe a better name can be found), and normal bus device object for which DPDK has a driver.

I think it is worth testing and fixing, as it will make the two NXP bus drivers similar to other bus drivers (but keep the special IO devices handling internal to the FSLMC bus for example).

Signature · 45 lines
David Marchand

Changes since RFC v2:
- rebased,
- fixed interrupt closing,

Changes since RFC v1:
- fixed FD leak in bus/dpaa pre existing code,
- fixed device name leak in bus/fslmc pre existing code,
- fixed other leaks found by AI review,
- split DPAA2 devices in two list:
  - one list in the bus object for devices for which a driver exists,
  - one list local to the fslmc bus code for internal resources that
    are initialised out of the EAL / bus framework,

David Marchand (16):
  drivers/bus: cleanup device freeing in NXP bus scan
  drivers/bus: fix FD leak during scan in NXP drivers
  bus/dpaa: allocate interrupt during probing
  bus/dpaa: support unplug and use generic cleanup
  bus/fslmc: fix device name leak
  bus/fslmc: fix memory leaks in scan
  bus/fslmc: fix per type device count
  bus/fslmc: fix some VFIO device FD and memory leaks
  bus/fslmc: fix interrupt leak in DPIO cleanup
  bus/fslmc: simplify device parsing in scan
  bus/fslmc: release resources on probe failure
  bus/fslmc: refactor device filtering for multiprocess
  bus/fslmc: move unplug for some device out of VFIO
  bus/fslmc: call VFIO setup for some device from bus layer
  bus/fslmc: allocate interrupt during probing
  bus/fslmc: use generic cleanup

 doc/guides/rel_notes/release_26_11.rst   |   4 +
 drivers/bus/dpaa/dpaa_bus.c              | 149 +++++----
 drivers/bus/fslmc/bus_fslmc_driver.h     |   4 +-
 drivers/bus/fslmc/fslmc_bus.c            | 404 ++++++++++++++++------
 drivers/bus/fslmc/fslmc_vfio.c           | 407 +++++++++++------------
 drivers/bus/fslmc/fslmc_vfio.h           |   6 +
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c |   1 +
 drivers/bus/fslmc/private.h              |   6 +
 8 files changed, 592 insertions(+), 389 deletions(-)

-- 
2.54.0