[v2,1/2] common/mlx5: add glue function for duplicate rule ability
Checks
Commit Message
Add glue function to update the duplicate rule allow/disallow
through rdma-core DV API.
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/common/mlx5/linux/meson.build | 2 ++
drivers/common/mlx5/linux/mlx5_glue.c | 12 ++++++++++++
drivers/common/mlx5/linux/mlx5_glue.h | 1 +
3 files changed, 15 insertions(+)
@@ -195,6 +195,8 @@ has_sym_args = [
'mlx5dv_dump_dr_rule' ],
[ 'HAVE_MLX5_DR_ACTION_ASO_CT', 'infiniband/mlx5dv.h',
'MLX5DV_DR_ACTION_FLAGS_ASO_CT_DIRECTION_INITIATOR' ],
+ [ 'HAVE_MLX5_DR_ALLOW_DUPLICATE', 'infiniband/mlx5dv.h',
+ 'mlx5dv_dr_domain_allow_duplicate_rules' ],
]
config = configuration_data()
foreach arg:has_sym_args
@@ -1358,6 +1358,17 @@ mlx5_glue_dv_alloc_pp(struct ibv_context *context,
#endif
}
+static void
+mlx5_glue_dr_allow_duplicate_rules(void *domain, uint32_t allow)
+{
+#ifdef HAVE_MLX5_DR_ALLOW_DUPLICATE
+ mlx5dv_dr_domain_allow_duplicate_rules(domain, allow);
+#else
+ (void)(allow);
+ (void)(domain);
+#endif
+}
+
static void
mlx5_glue_dv_free_pp(struct mlx5dv_pp *pp)
{
@@ -1478,6 +1489,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) {
mlx5_glue_dr_create_flow_action_sampler,
.dr_create_flow_action_dest_array =
mlx5_glue_dr_action_create_dest_array,
+ .dr_allow_duplicate_rules = mlx5_glue_dr_allow_duplicate_rules,
.devx_query_eqn = mlx5_glue_devx_query_eqn,
.devx_create_event_channel = mlx5_glue_devx_create_event_channel,
.devx_destroy_event_channel = mlx5_glue_devx_destroy_event_channel,
@@ -350,6 +350,7 @@ struct mlx5_glue {
struct mlx5dv_devx_async_event_hdr *event_data,
size_t event_resp_len);
void (*dr_reclaim_domain_memory)(void *domain, uint32_t enable);
+ void (*dr_allow_duplicate_rules)(void *domain, uint32_t allow);
struct mlx5dv_pp *(*dv_alloc_pp)(struct ibv_context *context,
size_t pp_context_sz,
const void *pp_context,