net/mlx5/hws: set ft_type on root matcher creation
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.
--- drivers/net/mlx5/hws/mlx5dr_matcher.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/mlx5/hws/mlx5dr_matcher.c +7 -3
@@ -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
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: setft_typeon root matcher creationThe
ft_typeshould be provided tomlx5dv_create_flow_matcherif the matcher attributes exist, not only for FDB but for NIC as well. If theft_typeis not provided, matcher/rule creation might fail.
Quoted 5 lines
Fixes ac7931dd1908 ("net/mlx5/hws: add HWS matcher object")Signed-off-by Alex Vesker <[email protected]>Signed-off-by Suanming Mou <[email protected]>
Squashed into relevant commit in next-net-mlx,
Kindest regards,
Raslan Darawsheh