dmaengine: sdxi: add userspace control and management support
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest44 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/44 | dmaengine: sdxi: cache hardware version for feature gatingdrivers/ drivers/ drivers/ | +47 | 0 replies | |
| 2/44 | dmaengine: sdxi: define key and error MMIO registersdrivers/ | +18 | 0 replies | |
| 3/44 | dmaengine: sdxi: define SDXI hardware layoutsdrivers/ | +80 | 0 replies | |
| 4/44 | dmaengine: sdxi: encode admin descriptorsdrivers/ drivers/ drivers/ | +266 | 0 replies | |
| 5/44 | dmaengine: sdxi: support timeout-aware completion waitsdrivers/ drivers/ | +34 | 0 replies | |
| 6/44 | dmaengine: sdxi: support the full context table hierarchydrivers/ drivers/ drivers/ | +84 | 0 replies | |
| 7/44 | dmaengine: sdxi: implement synchronous admin operationsdrivers/ drivers/ drivers/ +6 more | +402 | 0 replies | |
| 8/44 | dmaengine: sdxi: add core RKey table managementdrivers/ drivers/ drivers/ +2 more | +106 | 0 replies | |
| 9/44 | dmaengine: sdxi: handle hardware error logsdrivers/ drivers/ drivers/ +3 more | +281 | 0 replies | |
| 10/44 | dmaengine: sdxi: separate context and submission resourcesdrivers/ drivers/ drivers/ +2 more | +91 | 0 replies | |
| 11/44 | dmaengine: sdxi: support userspace context lifetimesdrivers/ drivers/ drivers/ +7 more | +971 | 0 replies | |
| 12/44 | dmaengine: sdxi: route context interrupts to eventfddrivers/ drivers/ drivers/ +2 more | +359 | 0 replies | |
| 13/44 | dmaengine: sdxi: kill user contexts on fatal errorsdrivers/ drivers/ drivers/ +2 more | +96 | 0 replies | |
| 14/44 | dmaengine: sdxi: define the ioctl UAPI surfaceinclude/ | +569 | 0 replies | |
| 15/44 | dmaengine: sdxi: add internal ioctl definitionsdrivers/ | +79 | 0 replies | |
| 16/44 | dmaengine: sdxi: register core character devicesdrivers/ drivers/ drivers/ +6 more | +340 | 0 replies | |
| 17/44 | dmaengine: sdxi: implement fixed-size ioctl dispatchdrivers/ drivers/ drivers/ +2 more | +420 | 0 replies | |
| 18/44 | dmaengine: sdxi: implement userspace context file operationsdrivers/ drivers/ drivers/ +3 more | +475 | 0 replies | |
| 19/44 | dmaengine: sdxi: validate and copy key ioctl payloadsdrivers/ | +150 | 0 replies | |
| 20/44 | dmaengine: sdxi: implement RKey management ioctlsdrivers/ drivers/ drivers/ | +281 | 0 replies | |
| 21/44 | dmaengine: sdxi: implement AKey management ioctlsdrivers/ drivers/ drivers/ | +243 | 0 replies | |
| 22/44 | dmaengine: sdxi: expose operation-group discoverydrivers/ drivers/ drivers/ | +186 | 0 replies | |
| 23/44 | dmaengine: sdxi: implement typed vendor admin transportdrivers/ drivers/ drivers/ +1 more | +270 | 0 replies | |
| 24/44 | dmaengine: sdxi: expose character device attributesdrivers/ drivers/ drivers/ +5 more | +98 | 0 replies | |
| 25/44 | dmaengine: sdxi: add PF and VF device namingdrivers/ drivers/ drivers/ +1 more | +55 | 0 replies | |
| 26/44 | dmaengine: sdxi: add SDXI trace eventsdrivers/ drivers/ drivers/ +2 more | +173 | 0 replies | |
| 27/44 | dmaengine: sdxi: support suspend and resumedrivers/ drivers/ drivers/ +6 more | +284 | 0 replies | |
| 28/44 | dmaengine: sdxi: amd: define QoS request formatsdrivers/ | +95 | 0 replies | |
| 29/44 | dmaengine: sdxi: amd: add QoS validation scaffoldingdrivers/ drivers/ | +268 | 0 replies | |
| 30/44 | dmaengine: sdxi: amd: build QoS admin descriptorsdrivers/ | +326 | 0 replies | |
| 31/44 | dmaengine: sdxi: amd: prevalidate QoS operationsdrivers/ | +174 | 0 replies | |
| 32/44 | dmaengine: sdxi: amd: execute QoS vendor operationsdrivers/ | +320 | 0 replies | |
| 33/44 | dmaengine: sdxi: amd: register QoS vendor handlerdrivers/ drivers/ drivers/ +1 more | +71 | 0 replies | |
| 34/44 | dmaengine: sdxi: amd: test QoS validation with KUnitdrivers/ drivers/ drivers/ | +187 | 0 replies | |
| 35/44 | selftests: sdxi: add build scaffoldtools/ tools/ tools/ | +8 | 0 replies | |
| 36/44 | selftests: sdxi: add shared descriptor and context helperstools/ tools/ tools/ +4 more | +715 | 0 replies | |
| 37/44 | selftests: sdxi: test context creationtools/ tools/ tools/ | +346 | 0 replies | |
| 38/44 | selftests: sdxi: test NOP descriptor submissiontools/ tools/ tools/ | +32 | 0 replies | |
| 39/44 | selftests: sdxi: test copy submission and ring wraptools/ tools/ tools/ | +42 | 0 replies | |
| 40/44 | selftests: sdxi: exercise dataplane error pathstools/ tools/ tools/ | +26 | 0 replies | |
| 41/44 | selftests: sdxi: test device ioctlstools/ tools/ tools/ | +247 | 0 replies | |
| 42/44 | selftests: sdxi: test vendor admin ioctlstools/ tools/ tools/ | +106 | 0 replies | |
| 43/44 | selftests: sdxi: test RKey ioctlstools/ tools/ tools/ | +415 | 0 replies | |
| 44/44 | MAINTAINERS: cover SDXI UAPI, vendor files, and selftestsMAINTAINERS | +3 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH v1 00/44] dmaengine: sdxi: add userspace control and management support
This series extends the existing SDXI phase 1 "base" driver with versioned userspace-facing interfaces for the native SDXI software stack: device discovery and management, process-owned execution contexts, and a constrained vendor-extension framework.
This series applies on top of Nathan Lynch's phase 1 "base" v4 patchset, ending at commit b8b01d7ab1e5 ("dmaengine: sdxi: Add DMA engine provider"). This series is available at:
https://github.com/AMDESE/linux-sdxi/tree/sdxi-phase2-upstream-v1
At a high level, this new series adds:
- A versioned ioctl UAPI and character-device interface for discovery and management.
- Userspace contexts with process-bound context fds, SVA-backed rings, per-context doorbell mappings, and eventfd interrupt delivery.
- A typed vendor-extension path that accepts structured requests rather than raw descriptors, plus an AMD QoS implementation.
- Test coverage (KUnit + kselftests) and MAINTAINERS updates.
Patch map:
- Patches 1-9: hardware and admin groundwork (feature gating, hardware layouts, admin operations, context hierarchy, RKey setup, error logs).
- Patches 10-13: userspace-context foundations (resource separation, process/SVA and context lifetimes, eventfd delivery, and fatal-error cleanup).
- Patches 14-27: versioned ioctl UAPI + character device (discovery and management, context-fd operations, vendor plumbing, tracing, suspend/resume).
- Patches 28-34: AMD QoS vendor feature (capabilities, configuration, assignment, telemetry), with KUnit coverage.
- Patches 35-44: kselftests (context creation, dataplane basics, error paths, ioctls), plus MAINTAINERS updates.
The interface is structured to separate management from the dataplane. A device fd represents one SDXI function and is used for discovery and function-wide management. SDXI_CREATE_CXT binds the caller's mm through IOMMU SVA, programs userspace-owned ring state, and returns a process-bound context fd for context-scoped control and mapping only that context's doorbell. Userspace submits native descriptors through the SVA-backed ring and mapped doorbell; context interrupts are delivered through a bound eventfd. The kernel owns and validates context and key tables and issues administrative operations for lifecycle and management requests.
Function-wide mutation and RKey management require CAP_SYS_ADMIN. Context ioctls and doorbell mappings are restricted to the creating thread group and mm. AKeys written by non-admin callers are limited to the local function and bound PASID. Vendor handlers authorize typed requests. AMD QoS composes descriptors on the kernel-owned admin context and is PF-only and CAP_SYS_ADMIN-gated.
Companion userspace projects are available at:
- libsdxi: userspace library
https://github.com/AMDESE/libsdxi/tree/sdxi-phase2-upstream-v1
- sdxi-cli: command-line tool
https://github.com/AMDESE/sdxi-cli/tree/sdxi-phase2-upstream-v1
libsdxi wraps the UAPI and provides device discovery, context lifecycle, key management, event handling, and vendor helpers. Sample programs provide quick tests:
$ ./samples/memcopy --dev /dev/sdxi0 $ ./samples/cxt_intr --dev sdxi1
sdxi-cli is an SDXI management tool built on libsdxi. Representative device inspection commands are:
$ sdxi devices $ sdxi show sdxi0 --verbose $ sdxi attrs sdxi0
SDXI supports vendor-specific extensions. This patchset adds AMD QoS management through a separate vendor handler (sdxi-amd-qos when built as a module). AMD QoS userspace management is provided in sdxi-cli under a vendor namespace:
$ sdxi amd qos cap sdxi0 $ sdxi amd qos status sdxi0 $ sdxi amd qos assign sdxi0 --pool 1 --cxt 1
This patchset has been tested on both bare metal and virtual machines with a passed-through VF, with the SDXI core, PCI driver, and KUnit tests built as modules.
SDXI (Smart Data Accelerator Interface) is a SNIA standard for a memory-to-memory data mover and acceleration interface, developed by industry contributors including Dell, AMD, VMware, etc. The SDXI specifications and related material are available at:
- SDXI v1.0a and v1.1 specifications: https://www.snia.org/sdxi
Thanks,
-Wei
Wei Huang (44):
dmaengine: sdxi: cache hardware version for feature gating
dmaengine: sdxi: define key and error MMIO registers
dmaengine: sdxi: define SDXI hardware layouts
dmaengine: sdxi: encode admin descriptors
dmaengine: sdxi: support timeout-aware completion waits
dmaengine: sdxi: support the full context table hierarchy
dmaengine: sdxi: implement synchronous admin operations
dmaengine: sdxi: add core RKey table management
dmaengine: sdxi: handle hardware error logs
dmaengine: sdxi: separate context and submission resources
dmaengine: sdxi: support userspace context lifetimes
dmaengine: sdxi: route context interrupts to eventfd
dmaengine: sdxi: kill user contexts on fatal errors
dmaengine: sdxi: define the ioctl UAPI surface
dmaengine: sdxi: add internal ioctl definitions
dmaengine: sdxi: register core character devices
dmaengine: sdxi: implement fixed-size ioctl dispatch
dmaengine: sdxi: implement userspace context file operations
dmaengine: sdxi: validate and copy key ioctl payloads
dmaengine: sdxi: implement RKey management ioctls
dmaengine: sdxi: implement AKey management ioctls
dmaengine: sdxi: expose operation-group discovery
dmaengine: sdxi: implement typed vendor admin transport
dmaengine: sdxi: expose character device attributes
dmaengine: sdxi: add PF and VF device naming
dmaengine: sdxi: add SDXI trace events
dmaengine: sdxi: support suspend and resume
dmaengine: sdxi: amd: define QoS request formats
dmaengine: sdxi: amd: add QoS validation scaffolding
dmaengine: sdxi: amd: build QoS admin descriptors
dmaengine: sdxi: amd: prevalidate QoS operations
dmaengine: sdxi: amd: execute QoS vendor operations
dmaengine: sdxi: amd: register QoS vendor handler
dmaengine: sdxi: amd: test QoS validation with KUnit
selftests: sdxi: add build scaffold
selftests: sdxi: add shared descriptor and context helpers
selftests: sdxi: test context creation
selftests: sdxi: test NOP descriptor submission
selftests: sdxi: test copy submission and ring wrap
selftests: sdxi: exercise dataplane error paths
selftests: sdxi: test device ioctls
selftests: sdxi: test vendor admin ioctls
selftests: sdxi: test RKey ioctls
MAINTAINERS: cover SDXI UAPI, vendor files, and selftests
MAINTAINERS | 3 + drivers/dma/sdxi/.kunitconfig | 1 + drivers/dma/sdxi/Kconfig | 25 +- drivers/dma/sdxi/Makefile | 13 +- drivers/dma/sdxi/admin.c | 290 ++++ drivers/dma/sdxi/admin.h | 45 + drivers/dma/sdxi/amd/Makefile | 6 + drivers/dma/sdxi/amd/qos.c | 1135 ++++++++++++++ drivers/dma/sdxi/amd/qos.h | 95 ++ drivers/dma/sdxi/amd/qos_kunit.c | 180 +++ drivers/dma/sdxi/completion.c | 37 +- drivers/dma/sdxi/completion.h | 4 + drivers/dma/sdxi/context.c | 980 ++++++++++-- drivers/dma/sdxi/context.h | 74 +- drivers/dma/sdxi/descriptor.c | 89 ++ drivers/dma/sdxi/descriptor.h | 27 + drivers/dma/sdxi/descriptor_kunit.c | 150 ++ drivers/dma/sdxi/device.c | 423 +++++- drivers/dma/sdxi/dma.c | 22 +- drivers/dma/sdxi/error.c | 371 +++++ drivers/dma/sdxi/error.h | 18 + drivers/dma/sdxi/hw.h | 80 + drivers/dma/sdxi/intr.c | 320 ++++ drivers/dma/sdxi/intr.h | 21 + drivers/dma/sdxi/ioctl.c | 1331 +++++++++++++++++ drivers/dma/sdxi/ioctl.h | 78 + drivers/dma/sdxi/keys.c | 577 +++++++ drivers/dma/sdxi/keys.h | 29 + drivers/dma/sdxi/mmio.h | 27 +- drivers/dma/sdxi/pci.c | 91 +- drivers/dma/sdxi/process.c | 200 +++ drivers/dma/sdxi/process.h | 43 + drivers/dma/sdxi/sdxi.h | 96 +- drivers/dma/sdxi/sysfs.c | 70 + drivers/dma/sdxi/sysfs.h | 13 + drivers/dma/sdxi/trace.c | 9 + drivers/dma/sdxi/trace.h | 137 ++ drivers/dma/sdxi/vendor.c | 138 ++ drivers/dma/sdxi/vendor.h | 42 + drivers/dma/sdxi/version.h | 32 + include/uapi/linux/sdxi.h | 569 +++++++ tools/testing/selftests/Makefile | 1 + tools/testing/selftests/sdxi/.gitignore | 7 + tools/testing/selftests/sdxi/Makefile | 35 + tools/testing/selftests/sdxi/admin_cmd.c | 104 ++ tools/testing/selftests/sdxi/config | 2 + tools/testing/selftests/sdxi/context.c | 343 +++++ tools/testing/selftests/sdxi/copy.c | 40 + tools/testing/selftests/sdxi/device.c | 245 +++ tools/testing/selftests/sdxi/error.c | 24 + tools/testing/selftests/sdxi/lib/context.c | 195 +++ tools/testing/selftests/sdxi/lib/descriptor.h | 55 + .../selftests/sdxi/lib/fixture-context.h | 126 ++ .../selftests/sdxi/lib/fixture-device.h | 44 + tools/testing/selftests/sdxi/lib/lib.c | 206 +++ tools/testing/selftests/sdxi/lib/lib.h | 61 + tools/testing/selftests/sdxi/nop.c | 30 + tools/testing/selftests/sdxi/rkey.c | 413 +++++ 58 files changed, 9603 insertions(+), 219 deletions(-) create mode 100644 drivers/dma/sdxi/admin.c create mode 100644 drivers/dma/sdxi/admin.h create mode 100644 drivers/dma/sdxi/amd/Makefile create mode 100644 drivers/dma/sdxi/amd/qos.c create mode 100644 drivers/dma/sdxi/amd/qos.h create mode 100644 drivers/dma/sdxi/amd/qos_kunit.c create mode 100644 drivers/dma/sdxi/error.c create mode 100644 drivers/dma/sdxi/error.h create mode 100644 drivers/dma/sdxi/intr.c create mode 100644 drivers/dma/sdxi/intr.h create mode 100644 drivers/dma/sdxi/ioctl.c create mode 100644 drivers/dma/sdxi/ioctl.h create mode 100644 drivers/dma/sdxi/keys.c create mode 100644 drivers/dma/sdxi/keys.h create mode 100644 drivers/dma/sdxi/process.c create mode 100644 drivers/dma/sdxi/process.h create mode 100644 drivers/dma/sdxi/sysfs.c create mode 100644 drivers/dma/sdxi/sysfs.h create mode 100644 drivers/dma/sdxi/trace.c create mode 100644 drivers/dma/sdxi/trace.h create mode 100644 drivers/dma/sdxi/vendor.c create mode 100644 drivers/dma/sdxi/vendor.h create mode 100644 drivers/dma/sdxi/version.h create mode 100644 include/uapi/linux/sdxi.h create mode 100644 tools/testing/selftests/sdxi/.gitignore create mode 100644 tools/testing/selftests/sdxi/Makefile create mode 100644 tools/testing/selftests/sdxi/admin_cmd.c create mode 100644 tools/testing/selftests/sdxi/config create mode 100644 tools/testing/selftests/sdxi/context.c create mode 100644 tools/testing/selftests/sdxi/copy.c create mode 100644 tools/testing/selftests/sdxi/device.c create mode 100644 tools/testing/selftests/sdxi/error.c create mode 100644 tools/testing/selftests/sdxi/lib/context.c create mode 100644 tools/testing/selftests/sdxi/lib/descriptor.h create mode 100644 tools/testing/selftests/sdxi/lib/fixture-context.h create mode 100644 tools/testing/selftests/sdxi/lib/fixture-device.h create mode 100644 tools/testing/selftests/sdxi/lib/lib.c create mode 100644 tools/testing/selftests/sdxi/lib/lib.h create mode 100644 tools/testing/selftests/sdxi/nop.c create mode 100644 tools/testing/selftests/sdxi/rkey.c
Signature · 1 line
2.56.1