From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1DCFA04B5; Wed, 28 Oct 2020 00:43:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 12D352DCC; Wed, 28 Oct 2020 00:25:44 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id E3F204C87 for ; Wed, 28 Oct 2020 00:24:02 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from ophirmu@nvidia.com) with SMTP; 28 Oct 2020 01:23:59 +0200 Received: from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09RNNrsI026642; Wed, 28 Oct 2020 01:23:58 +0200 From: Ophir Munk To: dev@dpdk.org, Raslan Darawsheh Cc: Ophir Munk , Matan Azrad , Tal Shnaiderman , Thomas Monjalon Date: Tue, 27 Oct 2020 23:23:29 +0000 Message-Id: <20201027232335.31427-67-ophirmu@nvidia.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20201027232335.31427-1-ophirmu@nvidia.com> References: <20201027232335.31427-1-ophirmu@nvidia.com> Subject: [dpdk-dev] [PATCH v1 66/72] net/mlx5/windows: create flow action dest TIR object X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/common/mlx5/windows/mlx5_win_defs.h | 16 ++++++++++++++++ drivers/net/mlx5/windows/mlx5_flow_os.c | 21 ++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/common/mlx5/windows/mlx5_win_defs.h b/drivers/common/mlx5/windows/mlx5_win_defs.h index f75329b..191f4b0 100644 --- a/drivers/common/mlx5/windows/mlx5_win_defs.h +++ b/drivers/common/mlx5/windows/mlx5_win_defs.h @@ -187,6 +187,16 @@ 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; @@ -231,4 +241,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__ */ diff --git a/drivers/net/mlx5/windows/mlx5_flow_os.c b/drivers/net/mlx5/windows/mlx5_flow_os.c index d572821..05010f4 100644 --- a/drivers/net/mlx5/windows/mlx5_flow_os.c +++ b/drivers/net/mlx5/windows/mlx5_flow_os.c @@ -132,10 +132,18 @@ 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; - return -rte_errno; + 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; } /** @@ -150,9 +158,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; } /** -- 2.8.4