From: Jiawei Wang <jiaweiw@nvidia.com>
To: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
<thomas@monjalon.net>, Shahaf Shuler <shahafs@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>
Subject: [dpdk-dev] [PATCH 1/2] common/mlx5: add glue function for duplicate rule ability
Date: Fri, 28 May 2021 16:25:23 +0300 [thread overview]
Message-ID: <20210528132524.32451-1-jiaweiw@nvidia.com> (raw)
Add glue function to update the duplicate rule allow/disallow
through rdma-core DV API.
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
---
drivers/common/mlx5/linux/meson.build | 2 ++
drivers/common/mlx5/linux/mlx5_glue.c | 12 ++++++++++++
drivers/common/mlx5/linux/mlx5_glue.h | 1 +
3 files changed, 15 insertions(+)
diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build
index 007834a49b..c0bfab1f33 100644
--- a/drivers/common/mlx5/linux/meson.build
+++ b/drivers/common/mlx5/linux/meson.build
@@ -191,6 +191,8 @@ has_sym_args = [
'mlx5dv_dump_dr_rule' ],
[ 'HAVE_MLX5_DR_ACTION_ASO_CT', 'infiniband/mlx5dv.h',
'MLX5DV_DR_ACTION_FLAGS_ASO_CT_DIRECTION_INITIATOR' ],
+ [ 'HAVE_MLX5_DR_ALLOW_DUPLICATE', 'infiniband/mlx5dv.h',
+ 'mlx5dv_dr_domain_allow_duplicate_rules' ],
]
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 d3bd645a5b..145cf83fd9 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.c
+++ b/drivers/common/mlx5/linux/mlx5_glue.c
@@ -1321,6 +1321,17 @@ mlx5_glue_dv_alloc_pp(struct ibv_context *context,
#endif
}
+static void
+mlx5_glue_dr_allow_duplicate_rules(void *domain, uint32_t allow)
+{
+#ifdef HAVE_MLX5_DR_ALLOW_DUPLICATE
+ mlx5dv_dr_domain_allow_duplicate_rules(domain, allow);
+#else
+ (void)(allow);
+ (void)(domain);
+#endif
+}
+
static void
mlx5_glue_dv_free_pp(struct mlx5dv_pp *pp)
{
@@ -1441,6 +1452,7 @@ const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue) {
mlx5_glue_dr_create_flow_action_sampler,
.dr_create_flow_action_dest_array =
mlx5_glue_dr_action_create_dest_array,
+ .dr_allow_duplicate_rules = mlx5_glue_dr_allow_duplicate_rules,
.devx_query_eqn = mlx5_glue_devx_query_eqn,
.devx_create_event_channel = mlx5_glue_devx_create_event_channel,
.devx_destroy_event_channel = mlx5_glue_devx_destroy_event_channel,
diff --git a/drivers/common/mlx5/linux/mlx5_glue.h b/drivers/common/mlx5/linux/mlx5_glue.h
index 97462e9ab8..56246bca18 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.h
+++ b/drivers/common/mlx5/linux/mlx5_glue.h
@@ -336,6 +336,7 @@ struct mlx5_glue {
struct mlx5dv_devx_async_event_hdr *event_data,
size_t event_resp_len);
void (*dr_reclaim_domain_memory)(void *domain, uint32_t enable);
+ void (*dr_allow_duplicate_rules)(void *domain, uint32_t allow);
struct mlx5dv_pp *(*dv_alloc_pp)(struct ibv_context *context,
size_t pp_context_sz,
const void *pp_context,
--
2.18.1
next reply other threads:[~2021-05-28 13:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 13:25 Jiawei Wang [this message]
2021-05-28 13:25 ` [dpdk-dev] [PATCH 2/2] net/mlx5: control rules with identical pattern behavior Jiawei Wang
2021-07-06 8:12 ` [dpdk-dev] [PATCH v2 0/2] " Jiawei Wang
2021-07-06 8:12 ` [dpdk-dev] [PATCH v2 1/2] common/mlx5: add glue function for duplicate rule ability Jiawei Wang
2021-07-06 8:12 ` [dpdk-dev] [PATCH v2 2/2] net/mlx5: control rules with identical pattern behavior Jiawei Wang
2021-07-07 16:55 ` [dpdk-dev] [PATCH v2 0/2] " 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=20210528132524.32451-1-jiaweiw@nvidia.com \
--to=jiaweiw@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=shahafs@nvidia.com \
--cc=thomas@monjalon.net \
--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).