From: Suanming Mou <suanmingm@nvidia.com>
To: Matan Azrad <matan@nvidia.com>,
Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>, Alex Vesker <valex@nvidia.com>
Subject: [PATCH] net/mlx5/hws: set ft_type on root matcher creation
Date: Wed, 26 Oct 2022 05:09:43 +0300 [thread overview]
Message-ID: <20221026020943.4643-1-suanmingm@nvidia.com> (raw)
The ft_type should be provided to mlx5dv_create_flow_matcher
if the matcher attributes exist, not only for FDB but for NIC
as well. If the ft_type is not provided, matcher/rule creation
might fail.
Fixes: ac7931dd1908 ("net/mlx5/hws: add HWS matcher object")
Signed-off-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_matcher.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/mlx5/hws/mlx5dr_matcher.c b/drivers/net/mlx5/hws/mlx5dr_matcher.c
index d1205c42fa..67adfeec6c 100644
--- a/drivers/net/mlx5/hws/mlx5dr_matcher.c
+++ b/drivers/net/mlx5/hws/mlx5dr_matcher.c
@@ -679,20 +679,24 @@ static int mlx5dr_matcher_init_root(struct mlx5dr_matcher *matcher)
uint8_t match_criteria;
int ret;
+#ifdef HAVE_MLX5DV_FLOW_MATCHER_FT_TYPE
+ attr.comp_mask = MLX5DV_FLOW_MATCHER_MASK_FT_TYPE;
+
switch (type) {
case MLX5DR_TABLE_TYPE_NIC_RX:
+ attr.ft_type = MLX5DV_FLOW_TABLE_TYPE_NIC_RX;
+ break;
case MLX5DR_TABLE_TYPE_NIC_TX:
+ attr.ft_type = MLX5DV_FLOW_TABLE_TYPE_NIC_TX;
break;
-#ifdef HAVE_MLX5DV_FLOW_MATCHER_FT_TYPE
case MLX5DR_TABLE_TYPE_FDB:
- attr.comp_mask = MLX5DV_FLOW_MATCHER_MASK_FT_TYPE;
attr.ft_type = MLX5DV_FLOW_TABLE_TYPE_FDB;
break;
-#endif
default:
assert(0);
break;
}
+#endif
if (matcher->attr.priority > UINT16_MAX) {
DR_LOG(ERR, "Root matcher priority exceeds allowed limit");
--
2.25.1
next reply other threads:[~2022-10-26 2:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-26 2:09 Suanming Mou [this message]
2022-10-26 9:57 ` 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=20221026020943.4643-1-suanmingm@nvidia.com \
--to=suanmingm@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=rasland@nvidia.com \
--cc=valex@nvidia.com \
--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).