net/mlx5: create flow action dest TIR object on Windows

This commit implements mlx5_flow_os_create_flow_action_dest_devx_tir()
API as the Linux rdma-core equivalent. Missing rdma-core parameters are
added to file mlx5_win_defs.h. The action TIR id and type
(MLX5_FLOW_CONTEXT_DEST_TYPE_TIR) are saved in the action struct.  The
action struct will be added to array of actions and will be used later
by the flow creation API.

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
This commit is contained in:
Ophir Munk 2020-12-28 14:32:53 +02:00 committed by Ferruh Yigit
parent 03e1f7f760
commit 68e28591ee
2 changed files with 32 additions and 7 deletions

View File

@ -189,6 +189,17 @@ struct mlx5_matcher {
uint64_t match_buf[];
};
/*
* Windows mlx5_action. This struct is the
* equivalent of rdma-core struct mlx5dv_dr_action.
*/
struct mlx5_action {
int type;
struct {
uint32_t id;
} dest_tir;
};
struct mlx5_err_cqe {
uint8_t rsvd0[32];
uint32_t srqn;
@ -233,4 +244,10 @@ enum {
MLX5_FLOW_CONTEXT_DEST_TYPE_TIR = 0x2,
MLX5_FLOW_CONTEXT_DEST_TYPE_QP = 0x3,
};
enum {
MLX5_MATCH_OUTER_HEADERS = 1 << 0,
MLX5_MATCH_MISC_PARAMETERS = 1 << 1,
MLX5_MATCH_INNER_HEADERS = 1 << 2,
};
#endif /* __MLX5_WIN_DEFS_H__ */

View File

@ -134,11 +134,20 @@ int
mlx5_flow_os_create_flow_action_dest_devx_tir(struct mlx5_devx_obj *tir,
void **action)
{
RTE_SET_USED(tir);
*action = NULL;
rte_errno = ENOTSUP;
struct mlx5_action *mlx5_action =
mlx5_malloc(MLX5_MEM_ZERO,
sizeof(struct mlx5_action),
0, SOCKET_ID_ANY);
if (!mlx5_action) {
rte_errno = ENOMEM;
return -rte_errno;
}
mlx5_action->type = MLX5_FLOW_CONTEXT_DEST_TYPE_TIR;
mlx5_action->dest_tir.id = tir->id;
*action = mlx5_action;
return 0;
}
/**
* Destroy flow action.
@ -152,9 +161,8 @@ mlx5_flow_os_create_flow_action_dest_devx_tir(struct mlx5_devx_obj *tir,
int
mlx5_flow_os_destroy_flow_action(void *action)
{
RTE_SET_USED(action);
rte_errno = ENOTSUP;
return -rte_errno;
mlx5_free(action);
return 0;
}
/**