patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@nvidia.com>
To: dev@dpdk.org, Raslan Darawsheh <rasland@nvidia.com>
Cc: Ophir Munk <ophirmu@nvidia.com>, Matan Azrad <matan@nvidia.com>,
	Tal Shnaiderman <talshn@nvidia.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	stable@dpdk.org
Subject: [dpdk-stable] [PATCH v1 62/72] net/mlx5/linux: fix add OS dest_devx_tir action
Date: Tue, 27 Oct 2020 23:23:25 +0000	[thread overview]
Message-ID: <20201027232335.31427-63-ophirmu@nvidia.com> (raw)
In-Reply-To: <20201027232335.31427-1-ophirmu@nvidia.com>

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 <ophirmu@nvidia.com>
---
 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


  parent reply	other threads:[~2020-10-27 23:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201027232335.31427-1-ophirmu@nvidia.com>
2020-10-27 23:22 ` [dpdk-stable] [PATCH v1 01/72] mlx5: fix relaxed ordering DevX flow Ophir Munk
     [not found]   ` <20201210150648.8784-1-talshn@nvidia.com>
2020-12-10 15:06     ` [dpdk-stable] [PATCH v2 01/33] net/mlx5: fix folding constant array error Tal Shnaiderman
     [not found]       ` <20201213102056.11380-1-talshn@nvidia.com>
2020-12-13 10:20         ` [dpdk-stable] [PATCH v3 01/32] " Tal Shnaiderman
     [not found]           ` <20201213205005.7300-1-talshn@nvidia.com>
2020-12-13 20:49             ` [dpdk-stable] [PATCH v4 " Tal Shnaiderman
     [not found]               ` <20201228095436.14996-1-talshn@nvidia.com>
2020-12-28  9:54                 ` [dpdk-stable] [PATCH v5 " Tal Shnaiderman
2020-12-28  9:54                 ` [dpdk-stable] [PATCH v5 04/32] net/mlx5: fix freeing packet pacing Tal Shnaiderman
2020-12-28  9:54                 ` [dpdk-stable] [PATCH v5 11/32] net/mlx5: fix adding destroy flow action wrapper Tal Shnaiderman
2020-12-13 20:49             ` [dpdk-stable] [PATCH v4 04/32] net/mlx5: fix freeing packet pacing Tal Shnaiderman
2020-12-13 20:49             ` [dpdk-stable] [PATCH v4 11/32] net/mlx5: fix adding destroy flow action wrapper Tal Shnaiderman
2020-12-13 10:20         ` [dpdk-stable] [PATCH v3 04/32] net/mlx5: fix freeing packet pacing Tal Shnaiderman
2020-12-13 10:20         ` [dpdk-stable] [PATCH v3 11/32] net/mlx5: fix adding destroy flow action wrapper Tal Shnaiderman
2020-12-10 15:06     ` [dpdk-stable] [PATCH v2 04/33] net/mlx5: fix freeing packet pacing Tal Shnaiderman
2020-12-10 15:06     ` [dpdk-stable] [PATCH v2 11/33] net/mlx5: fix adding destroy flow action wrapper Tal Shnaiderman
2020-10-27 23:22 ` [dpdk-stable] [PATCH v1 02/72] net/mlx5: fix flow sample definitions Ophir Munk
2020-10-27 23:22 ` [dpdk-stable] [PATCH v1 06/72] net/mlx5: fix freeing packet pacing Ophir Munk
2020-10-27 23:23 ` Ophir Munk [this message]
2020-10-27 23:23 ` [dpdk-stable] [PATCH v1 70/72] common/mlx5: fix Windows warnings on missing enum Ophir Munk
2020-10-27 23:23 ` [dpdk-stable] [PATCH v1 71/72] net/mlx5: fix Windows warnings on get_if_name Ophir Munk
2020-10-28  7:34   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201027232335.31427-63-ophirmu@nvidia.com \
    --to=ophirmu@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=talshn@nvidia.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).