return mlx5dv_dr_rule_create(matcher, match_value, num_actions,
(struct mlx5dv_dr_action **)actions);
#else
+ size_t i;
struct mlx5dv_flow_action_attr actions_attr[8];
if (num_actions > 8)
return NULL;
- for (size_t i = 0; i < num_actions; i++)
+ for (i = 0; i < num_actions; i++)
actions_attr[i] =
*((struct mlx5dv_flow_action_attr *)(actions[i]));
return mlx5dv_create_flow(matcher, match_value,
#ifdef HAVE_IBV_FLOW_DV_SUPPORT
#ifdef HAVE_MLX5DV_DR
return mlx5dv_dr_action_create_tag(tag);
-#else
+#else /* HAVE_MLX5DV_DR */
struct mlx5dv_flow_action_attr *action;
action = malloc(sizeof(*action));
if (!action)
action->type = MLX5DV_FLOW_ACTION_TAG;
action->tag_value = tag;
return action;
-#endif
-#endif
+#endif /* HAVE_MLX5DV_DR */
+#else /* HAVE_IBV_FLOW_DV_SUPPORT */
(void)tag;
errno = ENOTSUP;
return NULL;
+#endif /* HAVE_IBV_FLOW_DV_SUPPORT */
}
static void *
#endif
}
-
static void
mlx5_glue_dr_reclaim_domain_memory(void *domain, uint32_t enable)
{
#endif
}
+static struct mlx5dv_pp *
+mlx5_glue_dv_alloc_pp(struct ibv_context *context,
+ size_t pp_context_sz,
+ const void *pp_context,
+ uint32_t flags)
+{
+#ifdef HAVE_MLX5DV_PP_ALLOC
+ return mlx5dv_pp_alloc(context, pp_context_sz, pp_context, flags);
+#else
+ RTE_SET_USED(context);
+ RTE_SET_USED(pp_context_sz);
+ RTE_SET_USED(pp_context);
+ RTE_SET_USED(flags);
+ errno = ENOTSUP;
+ return NULL;
+#endif
+}
+
+static void
+mlx5_glue_dv_free_pp(struct mlx5dv_pp *pp)
+{
+#ifdef HAVE_MLX5DV_PP_ALLOC
+ mlx5dv_pp_free(pp);
+#else
+ RTE_SET_USED(pp);
+#endif
+}
+
__rte_cache_aligned
const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) {
.version = MLX5_GLUE_VERSION,
.devx_free_uar = mlx5_glue_devx_free_uar,
.dv_alloc_var = mlx5_glue_dv_alloc_var,
.dv_free_var = mlx5_glue_dv_free_var,
+ .dv_alloc_pp = mlx5_glue_dv_alloc_pp,
+ .dv_free_pp = mlx5_glue_dv_free_pp,
};