DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@nvidia.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: dev@dpdk.org, Dekel Peled <dekelp@nvidia.com>
Subject: [dpdk-dev] [PATCH 4/8] common/mlx5: add glue func create flow hit action
Date: Thu, 29 Oct 2020 21:57:57 +0000	[thread overview]
Message-ID: <1604008681-414157-5-git-send-email-matan@nvidia.com> (raw)
In-Reply-To: <1604008681-414157-1-git-send-email-matan@nvidia.com>

From: Dekel Peled <dekelp@nvidia.com>

Add glue function to create the flow hit action using DV API,
if rdma-core support exists.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
---
 drivers/common/mlx5/linux/meson.build |  2 ++
 drivers/common/mlx5/linux/mlx5_glue.c | 16 ++++++++++++++++
 drivers/common/mlx5/linux/mlx5_glue.h |  3 +++
 3 files changed, 21 insertions(+)

diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build
index 9ef8e18..7c552a3 100644
--- a/drivers/common/mlx5/linux/meson.build
+++ b/drivers/common/mlx5/linux/meson.build
@@ -179,6 +179,8 @@ has_sym_args = [
 	[ 'HAVE_MLX5_DR_CREATE_ACTION_DEST_ARRAY', 'infiniband/mlx5dv.h',
 	'mlx5dv_dr_action_create_dest_array'],
 	[ 'HAVE_DEVLINK', 'linux/devlink.h', 'DEVLINK_GENL_NAME' ],
+        [ 'HAVE_MLX5DV_DR_ACTION_FLOW_HIT', 'infiniband/mlx5dv.h',
+        'mlx5dv_dr_action_create_flow_hit'],
 ]
 config = configuration_data()
 foreach arg:has_sym_args
diff --git a/drivers/common/mlx5/linux/mlx5_glue.c b/drivers/common/mlx5/linux/mlx5_glue.c
index 4a76902..02007f6 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.c
+++ b/drivers/common/mlx5/linux/mlx5_glue.c
@@ -1283,6 +1283,21 @@
 #endif
 }
 
+static void *
+mlx5_glue_dr_action_create_flow_hit(struct mlx5dv_devx_obj *devx_obj,
+				    uint32_t offset, uint8_t reg_c_index)
+{
+#ifdef HAVE_MLX5DV_DR_ACTION_FLOW_HIT
+	return mlx5dv_dr_action_create_flow_hit(devx_obj, offset, reg_c_index);
+#else
+	(void)(devx_obj);
+	(void)(offset);
+	(void)(reg_c_index);
+	errno = ENOTSUP;
+	return NULL;
+#endif
+}
+
 __rte_cache_aligned
 const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) {
 	.version = MLX5_GLUE_VERSION,
@@ -1402,4 +1417,5 @@
 	.dv_free_var = mlx5_glue_dv_free_var,
 	.dv_alloc_pp = mlx5_glue_dv_alloc_pp,
 	.dv_free_pp = mlx5_glue_dv_free_pp,
+	.dr_action_create_flow_hit = mlx5_glue_dr_action_create_flow_hit,
 };
diff --git a/drivers/common/mlx5/linux/mlx5_glue.h b/drivers/common/mlx5/linux/mlx5_glue.h
index a5e7fb3..1a50e01 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.h
+++ b/drivers/common/mlx5/linux/mlx5_glue.h
@@ -345,6 +345,9 @@ struct mlx5_glue {
 			(void *domain,
 			 size_t num_dest,
 			 struct mlx5dv_dr_action_dest_attr *dests[]);
+	void *(*dr_action_create_flow_hit)(struct mlx5dv_devx_obj *devx_obj,
+					   uint32_t offset,
+					   uint8_t reg_c_index);
 };
 
 extern const struct mlx5_glue *mlx5_glue;
-- 
1.8.3.1


  parent reply	other threads:[~2020-10-29 21:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 21:57 [dpdk-dev] [PATCH 0/8] net/mlx5: support flow hit steering action Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 1/8] common/mlx5: add DevX API to create ASO flow hit object Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 2/8] common/mlx5: use general object type for cap index Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 3/8] common/mlx5: add read ASO flow hit HCA capability Matan Azrad
2020-10-29 21:57 ` Matan Azrad [this message]
2020-10-29 21:57 ` [dpdk-dev] [PATCH 5/8] common/mlx5: add definitions for ASO flow hit Matan Azrad
2020-10-29 21:57 ` [dpdk-dev] [PATCH 6/8] net/mlx5: support flow hit action for aging Matan Azrad
2020-10-29 21:58 ` [dpdk-dev] [PATCH 7/8] net/mlx5: optimize shared RSS action memory Matan Azrad
2020-10-29 21:58 ` [dpdk-dev] [PATCH 8/8] net/mlx5: support shared age action Matan Azrad
2020-11-01 17:57 ` [dpdk-dev] [PATCH v2 0/9] net/mlx5: support flow hit steering action Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 1/9] common/mlx5: add DevX API to create ASO flow hit object Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 2/9] common/mlx5: use general object type for cap index Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 3/9] common/mlx5: add read ASO flow hit HCA capability Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 4/9] common/mlx5: add glue func create flow hit action Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 5/9] common/mlx5: add definitions for ASO flow hit Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 6/9] net/mlx5: support flow hit action for aging Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 7/9] net/mlx5: optimize shared RSS action memory Matan Azrad
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 8/9] net/mlx5: support shared age action Matan Azrad
2020-11-02  6:16     ` Matan Azrad
2020-11-02  9:33       ` Raslan Darawsheh
2020-11-01 17:57   ` [dpdk-dev] [PATCH v2 9/9] net/mlx5: allow age modes combination Matan Azrad
2020-11-02 11:10   ` [dpdk-dev] [PATCH v2 0/9] net/mlx5: support flow hit steering action Raslan Darawsheh

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=1604008681-414157-5-git-send-email-matan@nvidia.com \
    --to=matan@nvidia.com \
    --cc=dekelp@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    /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).