DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shiri Kuzin <shirik@mellanox.com>
To: dev@dpdk.org
Cc: matan@mellanox.com, rasland@mellanox.com, viacheslavo@mellanox.com
Subject: [dpdk-dev] [RFC 1/3] common/mlx5: add default miss action
Date: Tue,  2 Jun 2020 12:38:09 +0300	[thread overview]
Message-ID: <eea96d008cdc37bd8e79fdacf546745130a90ba6.1591088325.git.shirik@mellanox.com> (raw)
In-Reply-To: <cover.1591088325.git.shirik@mellanox.com>

Add dv_create_action_default_miss wrapper function
for the action added to the rdma-core
MLX5DV_FLOW_ACTION_DEFAULT_MISS.

When a packet matches MLX5DV_FLOW_ACTION_DEFAULT_MISS
action it is steered to the default miss of the verbs
steering domain.

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
---
 drivers/common/mlx5/Makefile    |  5 +++++
 drivers/common/mlx5/meson.build |  2 ++
 drivers/common/mlx5/mlx5_glue.c | 13 +++++++++++++
 drivers/common/mlx5/mlx5_glue.h |  1 +
 4 files changed, 21 insertions(+)

diff --git a/drivers/common/mlx5/Makefile b/drivers/common/mlx5/Makefile
index 0d8cc1b..c5c979a 100644
--- a/drivers/common/mlx5/Makefile
+++ b/drivers/common/mlx5/Makefile
@@ -153,6 +153,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 		enum MLX5DV_FLOW_ACTION_COUNTERS_DEVX \
 		$(AUTOCONF_OUTPUT)
 	$Q sh -- '$<' '$@' \
+		HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS \
+		infiniband/mlx5dv.h \
+		enum MLX5DV_FLOW_ACTION_DEFAULT_MISS \
+		$(AUTOCONF_OUTPUT)
+	$Q sh -- '$<' '$@' \
 		HAVE_IBV_DEVX_ASYNC \
 		infiniband/mlx5dv.h \
 		func mlx5dv_devx_obj_query_async \
diff --git a/drivers/common/mlx5/meson.build b/drivers/common/mlx5/meson.build
index 5a802ba..9ba90b7 100644
--- a/drivers/common/mlx5/meson.build
+++ b/drivers/common/mlx5/meson.build
@@ -120,6 +120,8 @@ has_sym_args = [
 	'mlx5dv_devx_obj_create' ],
 	[ 'HAVE_IBV_FLOW_DEVX_COUNTERS', 'infiniband/mlx5dv.h',
 	'MLX5DV_FLOW_ACTION_COUNTERS_DEVX' ],
+	[ 'HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS', 'infiniband/mlx5dv.h',
+	'MLX5DV_FLOW_ACTION_DEFAULT_MISS' ],
 	[ 'HAVE_IBV_DEVX_ASYNC', 'infiniband/mlx5dv.h',
 	'mlx5dv_devx_obj_query_async' ],
 	[ 'HAVE_IBV_DEVX_QP', 'infiniband/mlx5dv.h',
diff --git a/drivers/common/mlx5/mlx5_glue.c b/drivers/common/mlx5/mlx5_glue.c
index f270f67..62e15cb 100644
--- a/drivers/common/mlx5/mlx5_glue.c
+++ b/drivers/common/mlx5/mlx5_glue.c
@@ -795,6 +795,17 @@
 #endif
 }
 
+static void *
+mlx5_glue_dr_create_flow_action_default_miss(void)
+{
+#if defined(HAVE_MLXDV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_DEFAULT_MISS)
+	return mlx5dv_dr_action_create_default_miss();
+#else
+	errno = ENOTSUP;
+	return NULL;
+#endif
+}
+
 static int
 mlx5_glue_dv_destroy_flow(void *flow_id)
 {
@@ -1264,6 +1275,8 @@
 	.dv_create_flow_action_tag =  mlx5_glue_dv_create_flow_action_tag,
 	.dv_create_flow_action_meter = mlx5_glue_dv_create_flow_action_meter,
 	.dv_modify_flow_action_meter = mlx5_glue_dv_modify_flow_action_meter,
+	.dr_create_flow_action_default_miss = 
+		mlx5_glue_dr_create_flow_action_default_miss,
 	.dv_destroy_flow = mlx5_glue_dv_destroy_flow,
 	.dv_destroy_flow_matcher = mlx5_glue_dv_destroy_flow_matcher,
 	.dv_open_device = mlx5_glue_dv_open_device,
diff --git a/drivers/common/mlx5/mlx5_glue.h b/drivers/common/mlx5/mlx5_glue.h
index 81d6a22..f5bec6a 100644
--- a/drivers/common/mlx5/mlx5_glue.h
+++ b/drivers/common/mlx5/mlx5_glue.h
@@ -237,6 +237,7 @@ struct mlx5_glue {
 		(struct mlx5dv_dr_flow_meter_attr *attr);
 	int (*dv_modify_flow_action_meter)(void *action,
 		struct mlx5dv_dr_flow_meter_attr *attr, uint64_t modify_bits);
+	void *(*dr_create_flow_action_default_miss)();
 	int (*dv_destroy_flow)(void *flow);
 	int (*dv_destroy_flow_matcher)(void *matcher);
 	struct ibv_context *(*dv_open_device)(struct ibv_device *device);
-- 
1.8.3.1


  reply	other threads:[~2020-06-02  9:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02  9:38 [dpdk-dev] [RFC 0/3] mlx5: LACP handling for bonded devices Shiri Kuzin
2020-06-02  9:38 ` Shiri Kuzin [this message]
2020-06-02  9:38 ` [dpdk-dev] [RFC 2/3] net/mlx5: add default miss action to flow engine Shiri Kuzin
2020-06-02  9:38 ` [dpdk-dev] [RFC 3/3] net/mlx5: add new devarg dv_lacp_by_user Shiri Kuzin

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=eea96d008cdc37bd8e79fdacf546745130a90ba6.1591088325.git.shirik@mellanox.com \
    --to=shirik@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=rasland@mellanox.com \
    --cc=viacheslavo@mellanox.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).