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 2D0A9A04B5; Wed, 28 Oct 2020 00:47:17 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C543C974; Wed, 28 Oct 2020 00:26:05 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C55864C96 for ; Wed, 28 Oct 2020 00:24:03 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from ophirmu@nvidia.com) with SMTP; 28 Oct 2020 01:23:58 +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 09RNNrsE026642; 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 , stable@dpdk.org Date: Tue, 27 Oct 2020 23:23:25 +0000 Message-Id: <20201027232335.31427-63-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 62/72] net/mlx5/linux: fix add OS dest_devx_tir 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" Wrap glue call dv_create_flow_action_dest_devx_tir() with an OS API. Fixes: b293fbf9672b ("net/mlx5: add OS specific flow actions operations") Cc: stable@dpdk.org Signed-off-by: Ophir Munk --- drivers/net/mlx5/linux/mlx5_flow_os.h | 26 ++++++++++++++++++++++++++ drivers/net/mlx5/mlx5_devx.c | 7 +++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_flow_os.h b/drivers/net/mlx5/linux/mlx5_flow_os.h index 7706b3b..6f3b732 100644 --- a/drivers/net/mlx5/linux/mlx5_flow_os.h +++ b/drivers/net/mlx5/linux/mlx5_flow_os.h @@ -367,6 +367,32 @@ mlx5_flow_os_create_flow_action_default_miss(void **action) } /** + * 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 +} + +/** * Destroy flow action. * * @param[in] action diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c index 23d4190..1aff17c 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -23,7 +23,7 @@ #include "mlx5_utils.h" #include "mlx5_devx.h" #include "mlx5_flow.h" - +#include "mlx5_flow_os.h" /** * Modify RQ vlan stripping offload @@ -855,9 +855,8 @@ mlx5_devx_hrxq_new(struct rte_eth_dev *dev, struct mlx5_hrxq *hrxq, goto error; } #ifdef HAVE_IBV_FLOW_DV_SUPPORT - hrxq->action = mlx5_glue->dv_create_flow_action_dest_devx_tir - (hrxq->tir->obj); - if (!hrxq->action) { + if (mlx5_flow_os_create_flow_action_dest_devx_tir(hrxq->tir, + &hrxq->action)) { rte_errno = errno; goto error; } -- 2.8.4