Skip to contentSkip to conversation

net/mlx5: HW Steering cleanups

PATCH Applied Tariq Toukan 4 participants 7 messages Mar 12, 2025 – Mar 19, 2025

Subsystems (4)
lore
Share & tools
lore

Tariq Toukan

author maintainer
#0 lore raw

cover net/mlx5: HW Steering cleanups

This short series by Yevgeny contains several small HW Steering cleanups:

- Patch 1: removing unused FW commands
- Patch 2: using list_move() instead of list_del/add
- Patch 3: printing the unsupported combination of match fields

Regards,
Tariq

Yevgeny Kliteynik (3):
net/mlx5: HWS, remove unused code for alias flow tables net/mlx5: HWS, use list_move() instead of del/add net/mlx5: HWS, log the unsupported mask in definer

 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c  | 6 ------
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.h  | 3 ---
 .../net/ethernet/mellanox/mlx5/core/steering/hws/definer.c  | 6 +++---
 .../net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c  | 3 +--
 4 files changed, 4 insertions(+), 14 deletions(-)

base-commit: 0ea09cbf8350b70ad44d67a1dcb379008a356034

Signature · 1 line
2.31.1
author maintainer
#1 lore raw

PATCH 1/3 net/mlx5: HWS, remove unused code for alias flow tables

From: Yevgeny Kliteynik <[email protected]>

Alias flow tables are not in use by HWS - remove the unused code.

---
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c | 6 ------
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.h | 3 ---
 2 files changed, 9 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c +0 -6
index 487e75476b0a..e8f98c109b99 100644
@@ -130,12 +130,6 @@ int mlx5hws_cmd_flow_table_destroy(struct mlx5_core_dev *mdev,
 	return mlx5_cmd_exec_in(mdev, destroy_flow_table, in);
 }
 
-void mlx5hws_cmd_alias_flow_table_destroy(struct mlx5_core_dev *mdev,
-					  u32 table_id)
-{
-	hws_cmd_general_obj_destroy(mdev, MLX5_OBJ_TYPE_FT_ALIAS, table_id);
-}
-
 static int hws_cmd_flow_group_create(struct mlx5_core_dev *mdev,
 				     struct mlx5hws_cmd_fg_attr *fg_attr,
 				     u32 *group_id)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.h +0 -3
index 610c63d81ad9..51d9e0291ac1 100644
@@ -258,9 +258,6 @@ int mlx5hws_cmd_flow_table_query(struct mlx5_core_dev *mdev,
 int mlx5hws_cmd_flow_table_destroy(struct mlx5_core_dev *mdev,
 				   u8 fw_ft_type, u32 table_id);
 
-void mlx5hws_cmd_alias_flow_table_destroy(struct mlx5_core_dev *mdev,
-					  u32 table_id);
-
 int mlx5hws_cmd_rtc_create(struct mlx5_core_dev *mdev,
 			   struct mlx5hws_cmd_rtc_create_attr *rtc_attr,
 			   u32 *rtc_id);
Signature · 1 line
2.31.1
author maintainer
#2 lore raw

PATCH 2/3 net/mlx5: HWS, use list_move() instead of del/add

In reply to Tariq Toukan

From: Yevgeny Kliteynik <[email protected]>

Wherever applicable, use list_move function instead of list_del + list_add.

---
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c | 3 +--
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c +1 -2
index 10ece7df1cfa..c4851d5584b7 100644
@@ -1985,8 +1985,7 @@ int mlx5hws_definer_get_obj(struct mlx5hws_context *ctx,
 			continue;
 
 		/* Reuse definer and set LRU (move to be first in the list) */
-		list_del_init(&cached_definer->list_node);
-		list_add(&cached_definer->list_node, &cache->list_head);
+		list_move(&cached_definer->list_node, &cache->list_head);
 		cached_definer->refcount++;
 		return cached_definer->definer.obj_id;
 	}
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c +1 -2
index d9dc4f2d0dc6..f51ed24526b9 100644
@@ -153,8 +153,7 @@ mlx5hws_pat_get_existing_cached_pattern(struct mlx5hws_pattern_cache *cache,
 	cached_pattern = mlx5hws_pat_find_cached_pattern(cache, num_of_actions, actions);
 	if (cached_pattern) {
 		/* LRU: move it to be first in the list */
-		list_del_init(&cached_pattern->ptrn_list_node);
-		list_add(&cached_pattern->ptrn_list_node, &cache->ptrn_list);
+		list_move(&cached_pattern->ptrn_list_node, &cache->ptrn_list);
 		cached_pattern->refcount++;
 	}
 
Signature · 1 line
2.31.1
author maintainer
#3 lore raw

PATCH 3/3 net/mlx5: HWS, log the unsupported mask in definer

In reply to Tariq Toukan

From: Yevgeny Kliteynik <[email protected]>

If a user requested to match on an unsupported combination of fields, print the unsupported combination in the error message.

---
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c +2 -1
index c4851d5584b7..c8cc0c8115f5 100644
@@ -500,7 +500,8 @@ hws_definer_check_match_flags(struct mlx5hws_definer_conv_data *cd)
 	return 0;
 
 err_conflict:
-	mlx5hws_err(cd->ctx, "Invalid definer fields combination\n");
+	mlx5hws_err(cd->ctx, "Invalid definer fields combination: match_flags = 0x%08x\n",
+		    cd->match_flags);
 	return -EINVAL;
 }
 
Signature · 1 line
2.31.1
Reviewed-by on the v1 series
#4 lore raw
In reply to Tariq Toukan
Quoted 14 lines · Tariq Toukan

This short series by Yevgeny contains several small HW Steering cleanups:

- Patch 1: removing unused FW commands
- Patch 2: using list_move() instead of list_del/add
- Patch 3: printing the unsupported combination of match fields

Regards,
Tariq

Yevgeny Kliteynik (3):
net/mlx5: HWS, remove unused code for alias flow tables net/mlx5: HWS, use list_move() instead of del/add net/mlx5: HWS, log the unsupported mask in definer

Quoted 8 lines
  drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c  | 6 ------
  drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.h  | 3 ---
  .../net/ethernet/mellanox/mlx5/core/steering/hws/definer.c  | 6 +++---
  .../net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c  | 3 +--
  4 files changed, 4 insertions(+), 14 deletions(-)

base-commit: 0ea09cbf8350b70ad44d67a1dcb379008a356034

Hi, thanks for the submission!

for the whole series

Reviewed-by on the v1 series
#5 lore raw
In reply to Tariq Toukan
Quoted 14 lines · Tariq Toukan

This short series by Yevgeny contains several small HW Steering cleanups:

- Patch 1: removing unused FW commands
- Patch 2: using list_move() instead of list_del/add
- Patch 3: printing the unsupported combination of match fields

Regards,
Tariq

Yevgeny Kliteynik (3):
net/mlx5: HWS, remove unused code for alias flow tables net/mlx5: HWS, use list_move() instead of del/add net/mlx5: HWS, log the unsupported mask in definer

Quoted 12 lines
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.c  | 6 ------
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/cmd.h  | 3 ---
 .../net/ethernet/mellanox/mlx5/core/steering/hws/definer.c  | 6 +++---
 .../net/ethernet/mellanox/mlx5/core/steering/hws/pat_arg.c  | 3 +--
 4 files changed, 4 insertions(+), 14 deletions(-)

base-commit: 0ea09cbf8350b70ad44d67a1dcb379008a356034

Signature · 1 line
2.31.1

The series looks OK.

Thanks,
Michal

For the series:

#6 lore raw
In reply to Tariq Toukan
This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 10 lines · On Wed, 12 Mar 2025 13:49:51 +0200 you wrote:

This short series by Yevgeny contains several small HW Steering cleanups:

- Patch 1: removing unused FW commands
- Patch 2: using list_move() instead of list_del/add
- Patch 3: printing the unsupported combination of match fields

Regards,
Tariq

[...]

Here is the summary with links:
- [net-next,1/3] net/mlx5: HWS, remove unused code for alias flow tables

    https://git.kernel.org/netdev/net-next/c/eae1389ab2f5
  - [net-next,2/3] net/mlx5: HWS, use list_move() instead of del/add
    https://git.kernel.org/netdev/net-next/c/1a403ad383ab
  - [net-next,3/3] net/mlx5: HWS, log the unsupported mask in definer
    https://git.kernel.org/netdev/net-next/c/8389f2de903c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html