DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tal Shnaiderman <talshn@nvidia.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, matan@nvidia.com, rasland@nvidia.com,
	ophirmu@nvidia.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 23/35] net/mlx5/linux: fix add OS dest_devx_tir action
Date: Mon, 28 Dec 2020 14:32:50 +0200	[thread overview]
Message-ID: <20201228123302.3608-24-talshn@nvidia.com> (raw)
In-Reply-To: <20201228123302.3608-1-talshn@nvidia.com>

From: Ophir Munk <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>
Acked-by: Matan Azrad <matan@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 7706b3be48..6f3b7324ff 100644
--- a/drivers/net/mlx5/linux/mlx5_flow_os.h
+++ b/drivers/net/mlx5/linux/mlx5_flow_os.h
@@ -366,6 +366,32 @@ mlx5_flow_os_create_flow_action_default_miss(void **action)
 	return (*action) ? 0 : -1;
 }
 
+/**
+ * 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.
  *
diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
index 84a5c55ee0..aa8ca7f401 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
@@ -942,9 +942,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.16.1.windows.4


  parent reply	other threads:[~2020-12-28 12:40 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 17:30 [dpdk-dev] [PATCH 00/35] mlx5 Windows support - part #6 Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 01/35] common/mlx5/windows: add missing DV and IBV definitions Tal Shnaiderman
2020-12-28 12:32   ` [dpdk-dev] [PATCH v2 00/35] mlx5 Windows support - part #6 Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 01/35] common/mlx5/windows: add missing DV and IBV definitions Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 02/35] mlx5/windows: add mlx5 macros for fs name and path Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 03/35] common/mlx5: add rte compatibility header file Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 04/35] common/mlx5/windows: add DevX UAR getters Tal Shnaiderman
2021-01-08 12:08       ` Ferruh Yigit
2021-01-08 16:08         ` Ophir Munk
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 05/35] common/mlx5/windows: wrap event channel APIs with OS calls Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 06/35] net/mlx5/windows: add memory region callbacks Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 07/35] net/mlx5/windows: add stubs for MP requests Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 08/35] net/mlx5/windows: support get mac Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 09/35] net/mlx5/windows: add ethdev stub operations Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 10/35] net/mlx5/windows: support link update Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 11/35] net/mlx5/windows: support read clock Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 12/35] net/mlx5/windows: support get mtu Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 13/35] net/mlx5/windows: support get interface name Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 14/35] net/mlx5/windows: support device removed query Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 15/35] net/mlx5/windws: add VLAN stubs Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 16/35] net/mlx5/windows: support get pdn Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 17/35] net/mlx5/windows: support open device Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 18/35] net/mlx5/windows: initial probing implementation Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 19/35] net/mlx5/windws: spawn eth devices Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 20/35] net/mlx5/windows: support VF PCI address Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 21/35] net/mlx5/linux: wrap adjust flow priority with OS calls Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 22/35] net/mlx5/linux: add OS default miss flow action Tal Shnaiderman
2020-12-28 12:32     ` Tal Shnaiderman [this message]
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 24/35] net/mlx5/windows: introduce flow support Tal Shnaiderman
2021-01-08 14:38       ` Ferruh Yigit
2021-01-08 14:55         ` Thomas Monjalon
2021-01-08 16:15           ` Ophir Munk
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 25/35] net/mlx5/windows: create flow matcher object Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 26/35] net/mlx5/windows: create flow action dest TIR object Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 27/35] net/mlx5/windows: create flow rule Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 28/35] net/mlx5: use HAVE_INFINIBAND_VERBS_H in shared code Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 29/35] net/mlx5: fix separating eth_dev_ops per OS Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 30/35] net/mlx5: define MLX5_NAMESIZE for device interface size Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 31/35] net/mlx5: use OS independent code in ASO feature Tal Shnaiderman
2020-12-28 12:32     ` [dpdk-dev] [PATCH v2 32/35] mlx5: use init function for ctx list mutex Tal Shnaiderman
2020-12-28 12:33     ` [dpdk-dev] [PATCH v2 33/35] mlx5: use OS function for dr_sync_domain Tal Shnaiderman
2020-12-28 12:33     ` [dpdk-dev] [PATCH v2 34/35] mlx5: do not fail on IPv6 broadcast flow creation failure Tal Shnaiderman
2020-12-28 12:33     ` [dpdk-dev] [PATCH v2 35/35] net/mlx5: fix warnings on comparison sign mismatch Tal Shnaiderman
2021-01-03  2:05     ` [dpdk-dev] [PATCH v2 00/35] mlx5 Windows support - part #6 Raslan Darawsheh
2020-12-17 17:30 ` [dpdk-dev] [PATCH 02/35] mlx5/windows: add mlx5 macros for fs name and path Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 03/35] common/mlx5: add rte compatibility header file Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 04/35] common/mlx5/windows: add DevX UAR getters Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 05/35] common/mlx5/windows: wrap event channel APIs with OS calls Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 06/35] net/mlx5/windows: add memory region callbacks Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 07/35] net/mlx5/windows: add stubs for MP requests Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 08/35] net/mlx5/windows: support get mac Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 09/35] net/mlx5/windows: add ethdev stub operations Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 10/35] net/mlx5/windows: support link update Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 11/35] net/mlx5/windows: support read clock Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 12/35] net/mlx5/windows: support get mtu Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 13/35] net/mlx5/windows: support get interface name Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 14/35] net/mlx5/windows: support device removed query Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 15/35] net/mlx5/windws: add VLAN stubs Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 16/35] net/mlx5/windows: support get pdn Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 17/35] net/mlx5/windows: support open device Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 18/35] net/mlx5/windows: initial probing implementation Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 19/35] net/mlx5/windws: spawn eth devices Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 20/35] net/mlx5/windows: support VF PCI address Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 21/35] net/mlx5/linux: wrap adjust flow priority with OS calls Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 22/35] net/mlx5/linux: add OS default miss flow action Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 23/35] net/mlx5/linux: fix add OS dest_devx_tir action Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 24/35] net/mlx5/windows: introduce flow support Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 25/35] net/mlx5/windows: create flow matcher object Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 26/35] net/mlx5/windows: create flow action dest TIR object Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 27/35] net/mlx5/windows: create flow rule Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 28/35] net/mlx5: use HAVE_INFINIBAND_VERBS_H in shared code Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 29/35] net/mlx5: fix separating eth_dev_ops per OS Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 30/35] net/mlx5: define MLX5_NAMESIZE for device interface size Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 31/35] net/mlx5: use OS independent code in ASO feature Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 32/35] mlx5: use init function for ctx list mutex Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 33/35] mlx5: use OS function for dr_sync_domain Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 34/35] mlx5: do not fail on IPv6 broadcast flow creation failure Tal Shnaiderman
2020-12-17 17:30 ` [dpdk-dev] [PATCH 35/35] net/mlx5: fix warnings on comparison sign mismatch Tal Shnaiderman

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=20201228123302.3608-24-talshn@nvidia.com \
    --to=talshn@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=ophirmu@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --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).