From: Yongseok Koh <yskoh@mellanox.com>
To: Thomas Monjalon <thomas@monjalon.net>,
Shahaf Shuler <shahafs@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Ori Kam <orika@mellanox.com>
Subject: [dpdk-dev] [PATCH v2 09/11] net/mlx5: add Direct Verbs driver to glue
Date: Mon, 24 Sep 2018 19:50:23 +0000 [thread overview]
Message-ID: <20180924194951.18650-10-yskoh@mellanox.com> (raw)
In-Reply-To: <20180924194951.18650-1-yskoh@mellanox.com>
From: Ori Kam <orika@mellanox.com>
This commit adds all Direct Verbs required functions to the glue lib.
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
drivers/net/mlx5/Makefile | 2 +-
drivers/net/mlx5/meson.build | 2 +-
drivers/net/mlx5/mlx5_glue.c | 45 ++++++++++++++++++++++++++++++++++++++++++++
drivers/net/mlx5/mlx5_glue.h | 15 +++++++++++++++
4 files changed, 62 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index d510a4275..4243b37ca 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -8,7 +8,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
LIB = librte_pmd_mlx5.a
LIB_GLUE = $(LIB_GLUE_BASE).$(LIB_GLUE_VERSION)
LIB_GLUE_BASE = librte_pmd_mlx5_glue.so
-LIB_GLUE_VERSION = 18.05.0
+LIB_GLUE_VERSION = 18.11.0
# Sources.
SRCS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += mlx5.c
diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build
index 8075496f7..3d09ece4f 100644
--- a/drivers/net/mlx5/meson.build
+++ b/drivers/net/mlx5/meson.build
@@ -4,7 +4,7 @@
pmd_dlopen = get_option('enable_driver_mlx_glue')
LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so'
-LIB_GLUE_VERSION = '18.05.0'
+LIB_GLUE_VERSION = '18.11.0'
LIB_GLUE = LIB_GLUE_BASE + '.' + LIB_GLUE_VERSION
if pmd_dlopen
dpdk_conf.set('RTE_LIBRTE_MLX5_DLOPEN_DEPS', 1)
diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c
index 84f9492a7..48590df5b 100644
--- a/drivers/net/mlx5/mlx5_glue.c
+++ b/drivers/net/mlx5/mlx5_glue.c
@@ -346,6 +346,48 @@ mlx5_glue_dv_create_qp(struct ibv_context *context,
#endif
}
+static struct mlx5dv_flow_matcher *
+mlx5_glue_dv_create_flow_matcher(struct ibv_context *context,
+ struct mlx5dv_flow_matcher_attr *matcher_attr)
+{
+#ifdef HAVE_IBV_FLOW_DV_SUPPORT
+ return mlx5dv_create_flow_matcher(context, matcher_attr);
+#else
+ (void)context;
+ (void)matcher_attr;
+ return NULL;
+#endif
+}
+
+static struct ibv_flow *
+mlx5_glue_dv_create_flow(struct mlx5dv_flow_matcher *matcher,
+ struct mlx5dv_flow_match_parameters *match_value,
+ size_t num_actions,
+ struct mlx5dv_flow_action_attr *actions_attr)
+{
+#ifdef HAVE_IBV_FLOW_DV_SUPPORT
+ return mlx5dv_create_flow(matcher, match_value,
+ num_actions, actions_attr);
+#else
+ (void)matcher;
+ (void)match_value;
+ (void)num_actions;
+ (void)actions_attr;
+ return NULL;
+#endif
+}
+
+static int
+mlx5_glue_dv_destroy_flow_matcher(struct mlx5dv_flow_matcher *matcher)
+{
+#ifdef HAVE_IBV_FLOW_DV_SUPPORT
+ return mlx5dv_destroy_flow_matcher(matcher);
+#else
+ (void)matcher;
+ return 0;
+#endif
+}
+
alignas(RTE_CACHE_LINE_SIZE)
const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){
.version = MLX5_GLUE_VERSION,
@@ -392,4 +434,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){
.dv_set_context_attr = mlx5_glue_dv_set_context_attr,
.dv_init_obj = mlx5_glue_dv_init_obj,
.dv_create_qp = mlx5_glue_dv_create_qp,
+ .dv_create_flow_matcher = mlx5_glue_dv_create_flow_matcher,
+ .dv_destroy_flow_matcher = mlx5_glue_dv_destroy_flow_matcher,
+ .dv_create_flow = mlx5_glue_dv_create_flow,
};
diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h
index e584d3679..f6e4e3842 100644
--- a/drivers/net/mlx5/mlx5_glue.h
+++ b/drivers/net/mlx5/mlx5_glue.h
@@ -39,6 +39,13 @@ struct mlx5dv_qp_init_attr;
struct mlx5dv_wq_init_attr;
#endif
+#ifndef HAVE_IBV_FLOW_DV_SUPPORT
+struct mlx5dv_flow_matcher;
+struct mlx5dv_flow_matcher_attr;
+struct mlx5dv_flow_action_attr;
+struct mlx5dv_flow_match_parameters;
+#endif
+
/* LIB_GLUE_VERSION must be updated every time this structure is modified. */
struct mlx5_glue {
const char *version;
@@ -122,6 +129,14 @@ struct mlx5_glue {
(struct ibv_context *context,
struct ibv_qp_init_attr_ex *qp_init_attr_ex,
struct mlx5dv_qp_init_attr *dv_qp_init_attr);
+ struct mlx5dv_flow_matcher *(*dv_create_flow_matcher)
+ (struct ibv_context *context,
+ struct mlx5dv_flow_matcher_attr *matcher_attr);
+ int (*dv_destroy_flow_matcher)(struct mlx5dv_flow_matcher *matcher);
+ struct ibv_flow *(*dv_create_flow)(struct mlx5dv_flow_matcher *matcher,
+ struct mlx5dv_flow_match_parameters *match_value,
+ size_t num_actions,
+ struct mlx5dv_flow_action_attr *actions_attr);
};
const struct mlx5_glue *mlx5_glue;
--
2.11.0
next prev parent reply other threads:[~2018-09-24 19:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-19 6:48 [dpdk-dev] [PATCH 00/11] net/mlx5: add Direct Verbs flow driver support Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 01/11] net/mlx5: split flow validation to dedicated function Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 02/11] net/mlx5: add flow prepare function Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 03/11] net/mlx5: add flow translate function Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 04/11] net/mlx5: add support for multiple flow drivers Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 05/11] net/mlx5: add Direct Verbs validation function Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 06/11] net/mlx5: add Direct Verbs prepare function Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 07/11] net/mlx5: add Direct Verbs translate items Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 08/11] net/mlx5: add Direct Verbs translate actions Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 09/11] net/mlx5: add Direct Verbs driver to glue Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 10/11] net/mlx5: add Direct Verbs final functions Yongseok Koh
2018-09-19 6:48 ` [dpdk-dev] [PATCH 11/11] net/mlx5: add runtime parameter to enable Direct Verbs Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 00/11] net/mlx5: add Direct Verbs flow driver support Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 01/11] net/mlx5: split flow validation to dedicated function Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 02/11] net/mlx5: add flow prepare function Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 03/11] net/mlx5: add flow translate function Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 04/11] net/mlx5: add support for multiple flow drivers Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 05/11] net/mlx5: add Direct Verbs validation function Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 06/11] net/mlx5: add Direct Verbs prepare function Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 07/11] net/mlx5: add Direct Verbs translate items Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 08/11] net/mlx5: add Direct Verbs translate actions Yongseok Koh
2018-09-24 19:50 ` Yongseok Koh [this message]
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 10/11] net/mlx5: add Direct Verbs final functions Yongseok Koh
2018-09-24 19:50 ` [dpdk-dev] [PATCH v2 11/11] net/mlx5: add runtime parameter to enable Direct Verbs Yongseok Koh
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=20180924194951.18650-10-yskoh@mellanox.com \
--to=yskoh@mellanox.com \
--cc=dev@dpdk.org \
--cc=orika@mellanox.com \
--cc=shahafs@mellanox.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).