Skip to content

mlx5: Misc. improvements #1636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

yishaih
Copy link
Member

@yishaih yishaih commented Aug 17, 2025

This series for the mlx5 provider introduces the below 2 improvements:

  • Add support for bulk flow counters in mlx5dv_create_flow().
  • Implement UAR fallback for TD allocation.

Additional details can be found in the corresponding commit logs.

Extend the mlx5dv_create_flow API to support bulk counter operations by
introducing a new action type MLX5DV_FLOW_ACTION_COUNTERS_DEVX_WITH_OFFSET.
This allows users to specify an offset within DEVX counter objects for
more granular bulk counter object management.

The implementation removes the previous auxiliary array approach
(_mlx5dv_create_flow with actions_attr_aux parameter) in favor of a
cleaner design that embeds offset information directly within the flow
action structure. The mlx5dv_flow_action_attr union is extended with a
bulk_obj member containing both the DEVX object and an offset, allowing
also external rdma-core applications to use DEVX bulk counter via the
offset.

Existing applications using MLX5DV_FLOW_ACTION_COUNTERS_DEVX continue to
work unchanged, while new applications can use the enhanced
MLX5DV_FLOW_ACTION_COUNTERS_DEVX_WITH_OFFSET for bulk counter scenarios.

Note that no kernel changes needed, since DEVX bulk counter object with
offset is already supported.

Signed-off-by: Maher Sanalla <[email protected]>
Signed-off-by: Alex Vesker <[email protected]>
Signed-off-by: Yishai Hadas <[email protected]>
In mlx5_alloc_td(), check if blueflame is supported by examining
ctx->bf_reg_size before attempting UAR allocation. When blueflame is not
supported (bf_reg_size == 0), fallback to using the shared nc
(non-cached) UAR instead of trying to allocate a dedicated UAR.

This prevents unnecessary dedicated UAR allocation attempts on devices
that don't support blueflame, while ensuring td allocation succeeds by
using the available non-cached singleton UAR.

In mlx5_dealloc_td(), only detach dedicated UARs by checking the
singleton flag to avoid incorrectly freeing the shared nc_uar.

Signed-off-by: Maher Sanalla <[email protected]>
Signed-off-by: Yishai Hadas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants