X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Flinux%2Fmlx5_flow_os.h;h=1926d26410d07776dbb28de5d9e58a1e91509f38;hb=39e4a2577fd05199f53182b7c8509aeed40dc07f;hp=7706b3be48cf9a6084f9210d45067d67294b86fa;hpb=14020ad53d4ebf1ae1c5cd4f971616e266b8e3cc;p=dpdk.git diff --git a/drivers/net/mlx5/linux/mlx5_flow_os.h b/drivers/net/mlx5/linux/mlx5_flow_os.h index 7706b3be48..1926d26410 100644 --- a/drivers/net/mlx5/linux/mlx5_flow_os.h +++ b/drivers/net/mlx5/linux/mlx5_flow_os.h @@ -225,7 +225,8 @@ mlx5_flow_os_create_flow_action_modify_header(void *ctx, void *domain, (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; } @@ -366,6 +367,79 @@ mlx5_flow_os_create_flow_action_default_miss(void **action) 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. * @@ -401,4 +475,10 @@ mlx5_os_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority, { 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_ */