DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5/hws: set ft_type on root matcher creation
@ 2022-10-26  2:09 Suanming Mou
  2022-10-26  9:57 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Suanming Mou @ 2022-10-26  2:09 UTC (permalink / raw)
  To: Matan Azrad, Viacheslav Ovsiienko; +Cc: dev, rasland, Alex Vesker

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] net/mlx5/hws: set ft_type on root matcher creation
  2022-10-26  2:09 [PATCH] net/mlx5/hws: set ft_type on root matcher creation Suanming Mou
@ 2022-10-26  9:57 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2022-10-26  9:57 UTC (permalink / raw)
  To: Suanming Mou, Matan Azrad, Slava Ovsiienko; +Cc: dev, Alex Vesker

Hi,

> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Wednesday, October 26, 2022 5:10 AM
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Alex Vesker
> <valex@nvidia.com>
> Subject: [PATCH] net/mlx5/hws: set ft_type on root matcher creation
> 
> 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>

Squashed into relevant commit in next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-26  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26  2:09 [PATCH] net/mlx5/hws: set ft_type on root matcher creation Suanming Mou
2022-10-26  9:57 ` Raslan Darawsheh

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).