DPDK patches and discussions
 help / color / mirror / Atom feed
From: Haifei Luo <haifeil@nvidia.com>
To: ferruh.yigit@intel.com, viacheslavo@nvidia.com, matan@nvidia.com,
	xiaoyun.li@intel.com, thomas@monjalon.net, orika@nvidia.com
Cc: dev@dpdk.org, rasland@nvidia.com, xuemingl@nvidia.com,
	haifeil@nvidia.com
Subject: [dpdk-dev] [PATCH 1/2] common/mlx5: add mlx5 APIs for single flow dump feature
Date: Wed, 14 Apr 2021 10:22:31 +0300	[thread overview]
Message-ID: <1618384952-179763-2-git-send-email-haifeil@nvidia.com> (raw)
In-Reply-To: <1618384952-179763-1-git-send-email-haifeil@nvidia.com>

add mlx5 APIs for single flow dump feature

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/common/mlx5/linux/meson.build |  6 ++++--
 drivers/common/mlx5/linux/mlx5_glue.c | 13 +++++++++++++
 drivers/common/mlx5/linux/mlx5_glue.h |  1 +
 drivers/common/mlx5/mlx5_devx_cmds.c  | 14 ++++++++++++++
 drivers/common/mlx5/mlx5_devx_cmds.h  |  2 ++
 drivers/common/mlx5/version.map       |  1 +
 6 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build
index 5d6a861..e8fcbd9 100644
--- a/drivers/common/mlx5/linux/meson.build
+++ b/drivers/common/mlx5/linux/meson.build
@@ -186,8 +186,10 @@ has_sym_args = [
 	'mlx5dv_dr_action_create_aso' ],
 	[ 'HAVE_INFINIBAND_VERBS_H', 'infiniband/verbs.h',
 	'INFINIBAND_VERBS_H' ],
-        [ 'HAVE_MLX5_UMR_IMKEY', 'infiniband/mlx5dv.h',
-        'MLX5_WQE_UMR_CTRL_FLAG_INLINE' ],
+	[ 'HAVE_MLX5_UMR_IMKEY', 'infiniband/mlx5dv.h',
+	'MLX5_WQE_UMR_CTRL_FLAG_INLINE' ],
+	[ 'HAVE_MLX5_DR_FLOW_DUMP_RULE', 'infiniband/mlx5dv.h',
+	'mlx5dv_dump_dr_rule' ],
 ]
 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 964f7e7..d3bd645 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.c
+++ b/drivers/common/mlx5/linux/mlx5_glue.c
@@ -1101,6 +1101,18 @@
 }
 
 static int
+mlx5_glue_dr_dump_single_rule(FILE *file, void *rule)
+{
+#ifdef HAVE_MLX5_DR_FLOW_DUMP_RULE
+	return mlx5dv_dump_dr_rule(file, rule);
+#else
+	RTE_SET_USED(file);
+	RTE_SET_USED(rule);
+	return -ENOTSUP;
+#endif
+}
+
+static int
 mlx5_glue_dr_dump_domain(FILE *file, void *domain)
 {
 #ifdef HAVE_MLX5_DR_FLOW_DUMP
@@ -1423,6 +1435,7 @@
 	.devx_wq_query = mlx5_glue_devx_wq_query,
 	.devx_port_query = mlx5_glue_devx_port_query,
 	.dr_dump_domain = mlx5_glue_dr_dump_domain,
+	.dr_dump_rule = mlx5_glue_dr_dump_single_rule,
 	.dr_reclaim_domain_memory = mlx5_glue_dr_reclaim_domain_memory,
 	.dr_create_flow_action_sampler =
 		mlx5_glue_dr_create_flow_action_sampler,
diff --git a/drivers/common/mlx5/linux/mlx5_glue.h b/drivers/common/mlx5/linux/mlx5_glue.h
index 9e385be..97462e9 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.h
+++ b/drivers/common/mlx5/linux/mlx5_glue.h
@@ -313,6 +313,7 @@ struct mlx5_glue {
 			       uint32_t port_num,
 			       struct mlx5dv_devx_port *mlx5_devx_port);
 	int (*dr_dump_domain)(FILE *file, void *domain);
+	int (*dr_dump_rule)(FILE *file, void *rule);
 	int (*devx_query_eqn)(struct ibv_context *context, uint32_t cpus,
 			      uint32_t *eqn);
 	struct mlx5dv_devx_event_channel *(*devx_create_event_channel)
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 268bcd0..ec6069b 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -1584,6 +1584,20 @@ struct mlx5_devx_obj *
 	return -ret;
 }
 
+int
+mlx5_devx_cmd_flow_single_dump(void *rule_info __rte_unused,
+			FILE *file __rte_unused)
+{
+	int ret = 0;
+#ifdef HAVE_MLX5_DR_FLOW_DUMP_RULE
+	if (rule_info)
+		ret = mlx5_glue->dr_dump_rule(file, rule_info);
+#else
+	ret = ENOTSUP;
+#endif
+	return -ret;
+}
+
 /*
  * Create CQ using DevX API.
  *
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 67b5f77..209e7da 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -477,6 +477,8 @@ struct mlx5_devx_obj *mlx5_devx_cmd_create_tis(void *ctx,
 int mlx5_devx_cmd_flow_dump(void *fdb_domain, void *rx_domain, void *tx_domain,
 			    FILE *file);
 __rte_internal
+int mlx5_devx_cmd_flow_single_dump(void *rule, FILE *file);
+__rte_internal
 struct mlx5_devx_obj *mlx5_devx_cmd_create_cq(void *ctx,
 					      struct mlx5_devx_cq_attr *attr);
 __rte_internal
diff --git a/drivers/common/mlx5/version.map b/drivers/common/mlx5/version.map
index 8b196a4..d2037bd 100644
--- a/drivers/common/mlx5/version.map
+++ b/drivers/common/mlx5/version.map
@@ -30,6 +30,7 @@ INTERNAL {
 	mlx5_devx_cmd_flow_counter_alloc;
 	mlx5_devx_cmd_flow_counter_query;
 	mlx5_devx_cmd_flow_dump;
+	mlx5_devx_cmd_flow_single_dump;
 	mlx5_devx_cmd_mkey_create;
 	mlx5_devx_cmd_modify_qp_state;
 	mlx5_devx_cmd_modify_rq;
-- 
1.8.3.1


  reply	other threads:[~2021-04-14  7:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  7:22 [dpdk-dev] [PATCH 0/2] support single flow dump on MLX5 PMD Haifei Luo
2021-04-14  7:22 ` Haifei Luo [this message]
2021-04-14  7:22 ` [dpdk-dev] [PATCH 2/2] net/mlx5: add mlx5 APIs for single flow dump feature Haifei Luo
2021-04-14  8:56 ` [dpdk-dev] [PATCH v2 0/2] support single flow dump on MLX5 PMD Haifei Luo
2021-04-14  8:56   ` [dpdk-dev] [PATCH v2 1/2] common/mlx5: add mlx5 APIs for single flow dump feature Haifei Luo
2021-04-14  8:56   ` [dpdk-dev] [PATCH v2 2/2] net/mlx5: " Haifei Luo
2021-04-15 11:19 ` [dpdk-dev] [PATCH v3 0/2] support single flow dump on MLX5 PMD Haifei Luo
2021-04-15 11:19   ` [dpdk-dev] [PATCH v3 1/2] common/mlx5: add mlx5 APIs for single flow dump feature Haifei Luo
2021-04-15 11:19   ` [dpdk-dev] [PATCH v3 2/2] net/mlx5: " Haifei Luo
2021-04-15 11:28     ` Slava Ovsiienko
2021-04-19  9:31 ` [dpdk-dev] [PATCH 0/2] support single flow dump on MLX5 PMD 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=1618384952-179763-2-git-send-email-haifeil@nvidia.com \
    --to=haifeil@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    --cc=xiaoyun.li@intel.com \
    --cc=xuemingl@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).