Skip to content

efa: Add Completion Actions support - #1854

Open
ikolomi wants to merge 9 commits into
linux-rdma:masterfrom
amzn:comp-actions
Open

ikolomi wants to merge 9 commits into
linux-rdma:masterfrom
amzn:comp-actions

Conversation

@ikolomi

@ikolomi ikolomi commented Nov 11, 2026

Copy link
Copy Markdown

EFA completion actions let an application observe work request completions
without polling a completion queue: when a work request completes, locally or
at the remote side, the device performs an action that the work request names,
such as writing a value to a user buffer.

This series adds the user space side:

  • the efadv completion action interface: efadv_create_mem_comp_action(),
    efadv_destroy_comp_action(), the WR setters for local and remote actions
    with an optional data operand, and the QP creation flags for the action
    descriptor block (man pages included);
  • the efa provider implementation: control path over the new kernel uverbs
    object, the wide WQE with the action descriptor block, the capability,
    limit and supported-operation reporting in efadv_query_device(), and the
    efadv_get_max_inline_data() and efadv_query_qp_wqs() additions that expose
    the WQE layout;
  • pyverbs bindings and tests (API and traffic), skipped on devices without
    the capability.

The kernel side is on the list:
https://lore.kernel.org/linux-rdma/20261109081349.27316-1-ikolomin@amazon.com/
(RDMA/efa: Add Completion Actions support, 3 patches, for-next).

mrgolin and others added 9 commits November 11, 2026 13:39
Add EFA Direct Verbs API for completion actions. Completion actions
allow work requests to trigger predefined operations upon local or
remote completion, providing an alternative to CQ-based completion
processing. As first stage introduce Memory Completion Actions that
can perform modifications on a provided memory.

Add man pages for all new interfaces.

Reviewed-by: Ilia Kolominsky <ikolomin@amazon.com>
Signed-off-by: Michael Margolin <mrgolin@amazon.com>
To commit: ?? ("RDMA/efa: Add Completion Actions support").

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Ilia Kolominsky <ikolomin@amazon.com>
Implement the control path of the Completion Actions interface. A
memory completion action registers a caller-provided buffer (VA or
dmabuf) on a protection domain as a device write target and returns an
efadv_mem_comp_action whose embedded efadv_comp_action carries the action
id that work requests use; on each completion the device
modifies mem_modify_size bytes (1, 2 or 4) of the buffer with the
operand the work request supplies.

The object is exposed through EFA direct verbs and implemented over the
driver-private uverbs object ioctls. Action support is reported through
the device capabilities and the maximum number of memory completion
actions is exposed in the device attributes. The provider passes the
buffer geometry to the device, which accepts what it supports: today a
single-entry target whose size equals the modify size.

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Ilia Kolominsky <ikolomin@amazon.com>
Implement the work request setters that attach completion actions to
send queue work requests. A QP created with completion action wr_flags
uses the wide WQE format and carries the action block at a fixed offset
at the tail of the WQE. The offset is communicated to the device through
the WQE feature blocks configuration on QP creation and used by the
setters to locate the block.

The setters without a data argument trigger the action with a data
operand of 0. Enabling actions reduces the maximum send queue depth and
the maximum inline data length by the space the block takes;
efadv_get_max_sq_depth() takes an EFADV_SQ_DEPTH_ATTR_COMP_ACTION_WITH_DATA
flag so that the reported depth matches what efadv_create_qp_ex()
accepts for such a QP.

The new completion statuses map to verbs statuses: an invalid local
action is a local QP operation error and an invalid remote action is a
remote invalid request error.

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Ilia Kolominsky <ikolomin@amazon.com>
Completion actions reserve part of the inline space of the wide WQE for
the action block, so the maximum inline data a QP accepts depends on
whether actions are enabled. Add efadv_get_max_inline_data(), which
reports the maximum inline data size for a QP created with or without
completion actions, so that applications can size their inline writes
without knowing the WQE layout.

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Ilia Kolominsky <ikolomin@amazon.com>
…qs()

Providers that build work queue entries directly need to know whether
the send queue entries carry the completion action with data block and
where it sits. Report the enabled blocks through a new wqe_blocks bitmap
(EFADV_WQE_BLOCK_COMP_ACTION_WITH_DATA) together with the block offset,
in the formerly reserved bytes of struct efadv_wq_attr. The existing
caps field keeps its own compatibility condition, so callers built
against the previous layout still get the capability bits.

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Ilia Kolominsky <ikolomin@amazon.com>
Add pyverbs bindings for the EFA Completion Actions interface: the
EfaCompAction object with its EfaMemCompActionInitAttr attributes, the
work request setters on EfaQPEx and the new device capability and
attribute.

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Ilia Kolominsky <ikolomin@amazon.com>
Add lifecycle tests for the EFA Completion Actions control path to the
EFA direct verbs test module:
- capability consistency and skip machinery
- action create/destroy per supported entry size, distinct ids
- negatives: bad op type, unknown flags and comp_mask, missing PD, zero
  entry size
- reference protection: PD destroy while referenced by a live action
  fails with EBUSY
- action exhaustion up to the reported device limit

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Signed-off-by: Ilia Kolominsky <ikolomin@amazon.com>
Add the traffic tier of the EFA completion action tests to the SRD test
module: RDMA WRITE work requests carrying local and remote actions, with
and without an explicit data operand, across the supported entry sizes.
The action targets are polled independently of the initiator completion
since action-vs-CQE ordering is unspecified, and the whole target is
compared so that a store wider than the entry is caught as well. Both
players hold an address handle, since the device resolves an incoming
RDMA WRITE through an address handle on the receiving QP's protection
domain too.

Add the negative tier alongside: an action the device cannot execute
completes the work request with an error at the initiator, and the QP
keeps serving valid traffic afterwards. Covered are a destroyed action,
a destroyed action whose slot has been recycled by a new one, an action
registered on another protection domain than the QP's, made-up action
ids, and destroying an action while work requests referencing it are in
flight. Local actions fail with a local QP operation error and remote
actions with a remote invalid request error, carrying the device's
invalid-action status as the vendor error.

Plumb wr_flags through the SRD test resources to allow enabling the
completion action work request setters on the test QPs.

Reviewed-by: Michael Margolin <mrgolin@amazon.com>
Signed-off-by: Ilia Kolominsky <ikolomin@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants