(struct mlx5_flow_dv_modify_hdr_resource *)resource;
*action = mlx5_glue->dv_create_flow_action_modify_header
- (ctx, res->ft_type, domain, res->flags,
+ (ctx, res->ft_type, domain, res->root ?
+ MLX5DV_DR_ACTION_FLAGS_ROOT_LEVEL : 0,
actions_len, (uint64_t *)res->actions);
return (*action) ? 0 : -1;
}
return (*action) ? 0 : -1;
}
+/**
+ * Create flow action: dest_devx_tir
+ *
+ * @param[in] tir
+ * Pointer to DevX tir object
+ * @param[out] action
+ * Pointer to a valid action on success, NULL otherwise.
+ *
+ * @return
+ * 0 on success, or -1 on failure and errno is set.
+ */
+static inline int
+mlx5_flow_os_create_flow_action_dest_devx_tir(struct mlx5_devx_obj *tir,
+ void **action)
+{
+#ifdef HAVE_IBV_FLOW_DV_SUPPORT
+ *action = mlx5_glue->dv_create_flow_action_dest_devx_tir(tir->obj);
+ return (*action) ? 0 : -1;
+#else
+ /* If no DV support - skip the operation and return success */
+ RTE_SET_USED(tir);
+ *action = 0;
+ return 0;
+#endif
+}
+
+/**
+ * Create flow action: sampler
+ *
+ * @param[in] attr
+ * Pointer to sampler attribute
+ * @param[out] action
+ * Pointer to a valid action on success, NULL otherwise.
+ *
+ * @return
+ * 0 on success, or -1 on failure and errno is set.
+ */
+static inline int
+mlx5_os_flow_dr_create_flow_action_sampler
+ (struct mlx5dv_dr_flow_sampler_attr *attr,
+ void **action)
+{
+ *action = mlx5_glue->dr_create_flow_action_sampler(attr);
+ return (*action) ? 0 : -1;
+}
+
+/**
+ * Create flow action: dest_array
+ *
+ * @param[in] domain
+ * Pointer to relevant domain.
+ * @param[in] num_dest
+ * Number of destinations array.
+ * @param[in] dests
+ * Array of destination attributes.
+ * @param[out] action
+ * Pointer to a valid action on success, NULL otherwise.
+ *
+ * @return
+ * 0 on success, or -1 on failure and errno is set.
+ */
+static inline int
+mlx5_os_flow_dr_create_flow_action_dest_array
+ (void *domain,
+ size_t num_dest,
+ struct mlx5dv_dr_action_dest_attr *dests[],
+ void **action)
+{
+ *action = mlx5_glue->dr_create_flow_action_dest_array(
+ domain, num_dest, dests);
+ return (*action) ? 0 : -1;
+}
+
/**
* Destroy flow action.
*
{
return mlx5_flow_adjust_priority(dev, priority, subpriority);
}
+
+static inline int
+mlx5_os_flow_dr_sync_domain(void *domain, uint32_t flags)
+{
+ return mlx5_glue->dr_sync_domain(domain, flags);
+}
#endif /* RTE_PMD_MLX5_FLOW_OS_H_ */