Skip to contentSkip to conversation

net/mlx5/hws: set ft_type on root matcher creation

PATCH In review Suanming Mou 2 participants 2 messages Oct 26, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/mlx5/hws/mlx5dr_matcher.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/mlx5/hws/mlx5dr_matcher.c +7 -3
index d1205c42fa..67adfeec6c 100644
@@ -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");
Signature · 1 line
2.25.1
#1 lore raw

Hi,

Quoted 14 lines

-----Original Message-----
From: Suanming Mou <[email protected]>
Sent: Wednesday, October 26, 2022 5:10 AM
To: Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Alex Vesker <[email protected]>
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.

Quoted 5 lines
Fixes ac7931dd1908 ("net/mlx5/hws: add HWS matcher object")

Squashed into relevant commit in next-net-mlx,

Kindest regards,
Raslan Darawsheh