Skip to contentSkip to conversation

net/mlx5: HWS: Reject unsupported remove-header action

PATCH Applied Prathamesh Deshpande 6 participants 6 messages May 6 – May 25

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: HWS: Reject unsupported remove-header action

mlx5_cmd_hws_packet_reformat_alloc() handles MLX5_REFORMAT_TYPE_REMOVE_HDR by looking up a matching HWS remove-header action.

If mlx5_fs_get_action_remove_header_vlan() returns NULL, the code only logs an error and continues. The function then returns success with a NULL HWS action stored in the packet-reformat object.

Return an error when no matching remove-header action is available.

Fixes aecd9d1020e3 ("net/mlx5: fs, add HWS packet reformat API function")
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c +3 -1
index aca77853abb8..5a172c572a68 100644
@@ -1320,8 +1320,10 @@ mlx5_cmd_hws_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns,
 		break;
 	case MLX5_REFORMAT_TYPE_REMOVE_HDR:
 		hws_action = mlx5_fs_get_action_remove_header_vlan(fs_ctx, params);
-		if (!hws_action)
+		if (!hws_action) {
 			mlx5_core_err(dev, "Only vlan remove header supported\n");
+			return -EOPNOTSUPP;
+		}
 		break;
 	default:
 		mlx5_core_err(ns->dev, "Packet-reformat not supported(%d)\n",
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Prathamesh Deshpande

mlx5_cmd_hws_packet_reformat_alloc() handles MLX5_REFORMAT_TYPE_REMOVE_HDR by looking up a matching HWS remove-header action.

Quoted 8 lines

If mlx5_fs_get_action_remove_header_vlan() returns NULL, the code only logs an error and continues. The function then returns success with a NULL HWS action stored in the packet-reformat object.

Return an error when no matching remove-header action is available.

Fixes aecd9d1020e3 ("net/mlx5: fs, add HWS packet reformat API function")
Reviewed-by
#2 lore raw
Quoted 9 lines · Simon Horman
Quoted 8 lines · Prathamesh Deshpande

mlx5_cmd_hws_packet_reformat_alloc() handles MLX5_REFORMAT_TYPE_REMOVE_HDR by looking up a matching HWS remove-header action.

If mlx5_fs_get_action_remove_header_vlan() returns NULL, the code only logs an error and continues. The function then returns success with a NULL HWS action stored in the packet-reformat object.

Quoted 6 lines
Quoted 4 lines

Return an error when no matching remove-header action is available.

Fixes aecd9d1020e3 ("net/mlx5: fs, add HWS packet reformat API function")
maintainer Acked-by
#3 lore raw
Quoted 10 lines · Yevgeny Kliteynik
Quoted 9 lines · Simon Horman
Quoted 8 lines · Prathamesh Deshpande

mlx5_cmd_hws_packet_reformat_alloc() handles MLX5_REFORMAT_TYPE_REMOVE_HDR by looking up a matching HWS remove-header action.

If mlx5_fs_get_action_remove_header_vlan() returns NULL, the code only logs an error and continues. The function then returns success with a NULL HWS action stored in the packet-reformat object.

Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

Return an error when no matching remove-header action is available.

Fixes aecd9d1020e3 ("net/mlx5: fs, add HWS packet reformat API function")

I guess this is still pending my ack after Yevgeny's review?

Here:

Thanks.

maintainer
#4 lore raw
Quoted 11 lines · On Mon, 25 May 2026 13:34:32 +0300 Tariq Toukan wrote:
Quoted 5 lines · Yevgeny Kliteynik
Quoted 2 lines · Simon Horman

On Wed, May 06, 2026 at 01:00:31AM +0100, Prathamesh Deshpande wrote:

I guess this is still pending my ack after Yevgeny's review?

Here:

Yes, for us to apply directly we need an ack from the person who sends us the company PR. Too many false positive otherwise. Even people listed in MAINTAINERS are not considered sufficient by other companies so we play it safe :|

#5 lore raw
In reply to Prathamesh Deshpande
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Wed, 6 May 2026 01:00:31 +0100 you wrote:

mlx5_cmd_hws_packet_reformat_alloc() handles MLX5_REFORMAT_TYPE_REMOVE_HDR by looking up a matching HWS remove-header action.

If mlx5_fs_get_action_remove_header_vlan() returns NULL, the code only logs an error and continues. The function then returns success with a NULL HWS action stored in the packet-reformat object.

[...]

Here is the summary with links:
- [net,v1] net/mlx5: HWS: Reject unsupported remove-header action

    https://git.kernel.org/netdev/net/c/86f1d0f063e4

You are awesome, thank you!

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