Skip to content

Commit

Permalink
mlx5: Add new DM type, encap-sw
Browse files Browse the repository at this point in the history
Add a new DM type for the SW encap action creation.

Currently the encap action creation is through DevX, whose max amount of
actions can be created is small. The new SW encap type can increase the
max amount of actions.

Signed-off-by: Shun Hao <[email protected]>
Reviewed-by: Yevgeny Kliteynik <[email protected]>
Signed-off-by: Yishai Hadas <[email protected]>
  • Loading branch information
Shun-Hao authored and Yishai Hadas committed Dec 14, 2023
1 parent 40bf3c4 commit e7c2d17
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions providers/mlx5/man/mlx5dv_alloc_dm.3.md
Expand Up @@ -67,6 +67,11 @@ struct mlx5dv_alloc_dm_attr {
patterns/templates. Can be used for direct table and header modification
rules creation when allocated by a privileged user.

MLX5DV_DM_TYPE_ENCAP_SW_ICM
Device memory of type PACKET ENCAP SW ICM - This memory
is used by the device to store packet encap data.
Can be used for packet encap reformat rules creation
when allocated by a privileged user.

*comp_mask*
: Bitmask specifying what fields in the structure are valid:
Expand Down
1 change: 1 addition & 0 deletions providers/mlx5/mlx5_api.h
Expand Up @@ -55,6 +55,7 @@
#define MLX5DV_DM_TYPE_STEERING_SW_ICM MLX5_IB_UAPI_DM_TYPE_STEERING_SW_ICM
#define MLX5DV_DM_TYPE_HEADER_MODIFY_SW_ICM MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_SW_ICM
#define MLX5DV_DM_TYPE_HEADER_MODIFY_PATTERN_SW_ICM MLX5_IB_UAPI_DM_TYPE_HEADER_MODIFY_PATTERN_SW_ICM
#define MLX5DV_DM_TYPE_ENCAP_SW_ICM MLX5_IB_UAPI_DM_TYPE_ENCAP_SW_ICM
#define mlx5dv_devx_create_event_channel_flags mlx5_ib_uapi_devx_create_event_channel_flags
#define MLX5DV_DEVX_CREATE_EVENT_CHANNEL_FLAGS_OMIT_EV_DATA MLX5_IB_UAPI_DEVX_CR_EV_CH_FLAGS_OMIT_DATA
#define MLX5DV_PP_ALLOC_FLAGS_DEDICATED_INDEX MLX5_IB_UAPI_PP_ALLOC_FLAGS_DEDICATED_INDEX
Expand Down
1 change: 1 addition & 0 deletions providers/mlx5/verbs.c
Expand Up @@ -5009,6 +5009,7 @@ _mlx5dv_alloc_dm(struct ibv_context *context,
int err;

if ((mlx5_dm_attr->type != MLX5DV_DM_TYPE_MEMIC) &&
(mlx5_dm_attr->type != MLX5DV_DM_TYPE_ENCAP_SW_ICM) &&
(mlx5_dm_attr->type != MLX5DV_DM_TYPE_STEERING_SW_ICM) &&
(mlx5_dm_attr->type != MLX5DV_DM_TYPE_HEADER_MODIFY_SW_ICM) &&
(mlx5_dm_attr->type != MLX5DV_DM_TYPE_HEADER_MODIFY_PATTERN_SW_ICM)) {
Expand Down

0 comments on commit e7c2d17

Please sign in to comment.