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 7ED58A09FF; Mon, 28 Dec 2020 13:41:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68B94CB7F; Mon, 28 Dec 2020 13:34:14 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 69E97CA56 for ; Mon, 28 Dec 2020 13:33:37 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from talshn@nvidia.com) with SMTP; 28 Dec 2020 14:33:34 +0200 Received: from nvidia.com (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0BSCXWnb001295; Mon, 28 Dec 2020 14:33:34 +0200 From: Tal Shnaiderman To: dev@dpdk.org Cc: thomas@monjalon.net, matan@nvidia.com, rasland@nvidia.com, ophirmu@nvidia.com Date: Mon, 28 Dec 2020 14:32:49 +0200 Message-Id: <20201228123302.3608-23-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20201228123302.3608-1-talshn@nvidia.com> References: <20201217173037.11396-2-talshn@nvidia.com> <20201228123302.3608-1-talshn@nvidia.com> Subject: [dpdk-dev] [PATCH v2 22/35] net/mlx5/linux: add OS default miss flow action 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" From: Ophir Munk Wrap glue call dr_create_flow_action_default_miss() with an OS API. This commit is a follow up on [1]. [1] commit d4d85aa6f13a ("common/mlx5: add default miss action") commit b293fbf9672b ("net/mlx5: add OS specific flow actions operations") Signed-off-by: Ophir Munk Acked-by: Matan Azrad --- drivers/net/mlx5/linux/mlx5_flow_os.h | 16 ++++++++++++++++ drivers/net/mlx5/mlx5_flow_dv.c | 8 +++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_flow_os.h b/drivers/net/mlx5/linux/mlx5_flow_os.h index c7003a194e..7706b3be48 100644 --- a/drivers/net/mlx5/linux/mlx5_flow_os.h +++ b/drivers/net/mlx5/linux/mlx5_flow_os.h @@ -350,6 +350,22 @@ mlx5_flow_os_create_flow_action_drop(void **action) return (*action) ? 0 : -1; } +/** + * Create flow action: default miss. + * + * @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_default_miss(void **action) +{ + *action = mlx5_glue->dr_create_flow_action_default_miss(); + return (*action) ? 0 : -1; +} + /** * Destroy flow action. * diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 40c8e54a09..6d377b6dab 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -8763,11 +8763,13 @@ flow_dv_sample_create_cb(struct mlx5_cache_list *list __rte_unused, "for sample"); goto error; } + int ret; + cache_resource->normal_path_tbl = tbl; if (resource->ft_type == MLX5DV_FLOW_TABLE_TYPE_FDB) { - cache_resource->default_miss = - mlx5_glue->dr_create_flow_action_default_miss(); - if (!cache_resource->default_miss) { + ret = mlx5_flow_os_create_flow_action_default_miss + (&cache_resource->default_miss); + if (!ret) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, -- 2.16.1.windows.4