* [PATCH net-next 1/4] net/mlx5: HWS, fix missing ip_version handling in definer
2025-05-25 11:15 [PATCH net-next 0/4] net/mlx5: HWS, more fixes and adjustments Tariq Toukan
@ 2025-05-25 11:15 ` Tariq Toukan
2025-05-25 11:15 ` [PATCH net-next 2/4] net/mlx5: HWS, make sure the uplink is the last destination Tariq Toukan
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Tariq Toukan @ 2025-05-25 11:15 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
Andrew Lunn
Cc: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, netdev, linux-rdma,
linux-kernel, Moshe Shemesh, Mark Bloch, Vlad Dogaru,
Yevgeny Kliteynik, Gal Pressman
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
Fix missing field handling in definer - outer IP version.
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Vlad Dogaru <vdogaru@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c
index 5cc0dc002ac1..d45e1145d197 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c
@@ -785,6 +785,9 @@ hws_definer_conv_outer(struct mlx5hws_definer_conv_data *cd,
HWS_SET_HDR(fc, match_param, IP_PROTOCOL_O,
outer_headers.ip_protocol,
eth_l3_outer.protocol_next_header);
+ HWS_SET_HDR(fc, match_param, IP_VERSION_O,
+ outer_headers.ip_version,
+ eth_l3_outer.ip_version);
HWS_SET_HDR(fc, match_param, IP_TTL_O,
outer_headers.ttl_hoplimit,
eth_l3_outer.time_to_live_hop_limit);
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 2/4] net/mlx5: HWS, make sure the uplink is the last destination
2025-05-25 11:15 [PATCH net-next 0/4] net/mlx5: HWS, more fixes and adjustments Tariq Toukan
2025-05-25 11:15 ` [PATCH net-next 1/4] net/mlx5: HWS, fix missing ip_version handling in definer Tariq Toukan
@ 2025-05-25 11:15 ` Tariq Toukan
2025-05-26 6:39 ` Paolo Abeni
2025-05-25 11:15 ` [PATCH net-next 3/4] net/mlx5: HWS, remove unused create_dest_array parameter Tariq Toukan
2025-05-25 11:15 ` [PATCH net-next 4/4] net/mlx5: HWS, remove incorrect comment Tariq Toukan
3 siblings, 1 reply; 7+ messages in thread
From: Tariq Toukan @ 2025-05-25 11:15 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
Andrew Lunn
Cc: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, netdev, linux-rdma,
linux-kernel, Moshe Shemesh, Mark Bloch, Vlad Dogaru,
Yevgeny Kliteynik, Gal Pressman
From: Vlad Dogaru <vdogaru@nvidia.com>
If a destination array action contains a wire destination, it has
to be the last one in the array. Replicate the check we had for
software steering to avoid a firmware error.
Signed-off-by: Vlad Dogaru <vdogaru@nvidia.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
.../mellanox/mlx5/core/steering/hws/action.c | 19 ++++++++++++-------
.../mellanox/mlx5/core/steering/hws/fs_hws.c | 3 +++
.../mellanox/mlx5/core/steering/hws/mlx5hws.h | 1 +
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
index fb62f3bc4bd4..592f3a2ede2e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
@@ -1370,8 +1370,8 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
struct mlx5hws_cmd_set_fte_attr fte_attr = {0};
struct mlx5hws_cmd_forward_tbl *fw_island;
struct mlx5hws_action *action;
- u32 i /*, packet_reformat_id*/;
- int ret;
+ int ret, last_dest_idx = -1;
+ u32 i;
if (num_dest <= 1) {
mlx5hws_err(ctx, "Action must have multiple dests\n");
@@ -1401,11 +1401,8 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
dest_list[i].destination_id = dests[i].dest->dest_obj.obj_id;
fte_attr.action_flags |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
fte_attr.ignore_flow_level = ignore_flow_level;
- /* ToDo: In SW steering we have a handling of 'go to WIRE'
- * destination here by upper layer setting 'is_wire_ft' flag
- * if the destination is wire.
- * This is because uplink should be last dest in the list.
- */
+ if (dests[i].is_wire_ft)
+ last_dest_idx = i;
break;
case MLX5HWS_ACTION_TYP_VPORT:
dest_list[i].destination_type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
@@ -1429,6 +1426,14 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
}
}
+ if (last_dest_idx != -1) {
+ struct mlx5hws_cmd_set_fte_dest tmp;
+
+ tmp = dest_list[last_dest_idx];
+ dest_list[last_dest_idx] = dest_list[num_dest - 1];
+ dest_list[num_dest - 1] = tmp;
+ }
+
fte_attr.dests_num = num_dest;
fte_attr.dests = dest_list;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
index 9d1c0e4b224a..ab1a4c7f1813 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
@@ -966,6 +966,9 @@ static int mlx5_fs_fte_get_hws_actions(struct mlx5_flow_root_namespace *ns,
switch (attr->type) {
case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE:
dest_action = mlx5_fs_get_dest_action_ft(fs_ctx, dst);
+ if (dst->dest_attr.ft->flags &
+ MLX5_FLOW_TABLE_UPLINK_VPORT)
+ dest_actions[num_dest_actions].is_wire_ft = true;
break;
case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM:
dest_action = mlx5_fs_get_dest_action_table_num(fs_ctx,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h
index 9bbadc4d8a0b..d8ac6c196211 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h
@@ -213,6 +213,7 @@ struct mlx5hws_action_dest_attr {
struct mlx5hws_action *dest;
/* Optional reformat action */
struct mlx5hws_action *reformat;
+ bool is_wire_ft;
};
/**
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH net-next 2/4] net/mlx5: HWS, make sure the uplink is the last destination
2025-05-25 11:15 ` [PATCH net-next 2/4] net/mlx5: HWS, make sure the uplink is the last destination Tariq Toukan
@ 2025-05-26 6:39 ` Paolo Abeni
2025-05-26 23:11 ` Yevgeny Kliteynik
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Abeni @ 2025-05-26 6:39 UTC (permalink / raw)
To: Tariq Toukan, David S. Miller, Jakub Kicinski, Eric Dumazet,
Andrew Lunn
Cc: Saeed Mahameed, Leon Romanovsky, netdev, linux-rdma, linux-kernel,
Moshe Shemesh, Mark Bloch, Vlad Dogaru, Yevgeny Kliteynik,
Gal Pressman
On 5/25/25 1:15 PM, Tariq Toukan wrote:
> @@ -1429,6 +1426,14 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
> }
> }
>
> + if (last_dest_idx != -1) {
> + struct mlx5hws_cmd_set_fte_dest tmp;
> +
> + tmp = dest_list[last_dest_idx];
> + dest_list[last_dest_idx] = dest_list[num_dest - 1];
> + dest_list[num_dest - 1] = tmp;
Here you can use swap()
/P
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net-next 2/4] net/mlx5: HWS, make sure the uplink is the last destination
2025-05-26 6:39 ` Paolo Abeni
@ 2025-05-26 23:11 ` Yevgeny Kliteynik
0 siblings, 0 replies; 7+ messages in thread
From: Yevgeny Kliteynik @ 2025-05-26 23:11 UTC (permalink / raw)
To: Paolo Abeni, Tariq Toukan, David S. Miller, Jakub Kicinski,
Eric Dumazet, Andrew Lunn
Cc: Saeed Mahameed, Leon Romanovsky, netdev, linux-rdma, linux-kernel,
Moshe Shemesh, Mark Bloch, Vlad Dogaru, Gal Pressman
On 26-May-25 09:39, Paolo Abeni wrote:
> On 5/25/25 1:15 PM, Tariq Toukan wrote:
>> @@ -1429,6 +1426,14 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
>> }
>> }
>>
>> + if (last_dest_idx != -1) {
>> + struct mlx5hws_cmd_set_fte_dest tmp;
>> +
>> + tmp = dest_list[last_dest_idx];
>> + dest_list[last_dest_idx] = dest_list[num_dest - 1];
>> + dest_list[num_dest - 1] = tmp;
>
> Here you can use swap()
Indeed, thanks.
-- YK
> /P
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next 3/4] net/mlx5: HWS, remove unused create_dest_array parameter
2025-05-25 11:15 [PATCH net-next 0/4] net/mlx5: HWS, more fixes and adjustments Tariq Toukan
2025-05-25 11:15 ` [PATCH net-next 1/4] net/mlx5: HWS, fix missing ip_version handling in definer Tariq Toukan
2025-05-25 11:15 ` [PATCH net-next 2/4] net/mlx5: HWS, make sure the uplink is the last destination Tariq Toukan
@ 2025-05-25 11:15 ` Tariq Toukan
2025-05-25 11:15 ` [PATCH net-next 4/4] net/mlx5: HWS, remove incorrect comment Tariq Toukan
3 siblings, 0 replies; 7+ messages in thread
From: Tariq Toukan @ 2025-05-25 11:15 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
Andrew Lunn
Cc: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, netdev, linux-rdma,
linux-kernel, Moshe Shemesh, Mark Bloch, Vlad Dogaru,
Yevgeny Kliteynik, Gal Pressman
From: Vlad Dogaru <vdogaru@nvidia.com>
`flow_source` is not used anywhere in mlx5hws_action_create_dest_array.
Signed-off-by: Vlad Dogaru <vdogaru@nvidia.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
.../mellanox/mlx5/core/steering/hws/action.c | 7 ++-----
.../mellanox/mlx5/core/steering/hws/fs_hws.c | 15 ++++++---------
.../mellanox/mlx5/core/steering/hws/mlx5hws.h | 8 ++------
3 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
index 592f3a2ede2e..106dc416beec 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c
@@ -1358,12 +1358,9 @@ mlx5hws_action_create_modify_header(struct mlx5hws_context *ctx,
}
struct mlx5hws_action *
-mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
- size_t num_dest,
+mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx, size_t num_dest,
struct mlx5hws_action_dest_attr *dests,
- bool ignore_flow_level,
- u32 flow_source,
- u32 flags)
+ bool ignore_flow_level, u32 flags)
{
struct mlx5hws_cmd_set_fte_dest *dest_list = NULL;
struct mlx5hws_cmd_ft_create_attr ft_attr = {0};
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
index ab1a4c7f1813..eb7802bec615 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c
@@ -571,14 +571,12 @@ static void mlx5_fs_put_dest_action_sampler(struct mlx5_fs_hws_context *fs_ctx,
static struct mlx5hws_action *
mlx5_fs_create_action_dest_array(struct mlx5hws_context *ctx,
struct mlx5hws_action_dest_attr *dests,
- u32 num_of_dests, bool ignore_flow_level,
- u32 flow_source)
+ u32 num_of_dests, bool ignore_flow_level)
{
u32 flags = MLX5HWS_ACTION_FLAG_HWS_FDB | MLX5HWS_ACTION_FLAG_SHARED;
return mlx5hws_action_create_dest_array(ctx, num_of_dests, dests,
- ignore_flow_level,
- flow_source, flags);
+ ignore_flow_level, flags);
}
static struct mlx5hws_action *
@@ -1015,7 +1013,6 @@ static int mlx5_fs_fte_get_hws_actions(struct mlx5_flow_root_namespace *ns,
}
(*ractions)[num_actions++].action = dest_actions->dest;
} else if (num_dest_actions > 1) {
- u32 flow_source = fte->act_dests.flow_context.flow_source;
bool ignore_flow_level;
if (num_actions == MLX5_FLOW_CONTEXT_ACTION_MAX ||
@@ -1025,10 +1022,10 @@ static int mlx5_fs_fte_get_hws_actions(struct mlx5_flow_root_namespace *ns,
}
ignore_flow_level =
!!(fte_action->flags & FLOW_ACT_IGNORE_FLOW_LEVEL);
- tmp_action = mlx5_fs_create_action_dest_array(ctx, dest_actions,
- num_dest_actions,
- ignore_flow_level,
- flow_source);
+ tmp_action =
+ mlx5_fs_create_action_dest_array(ctx, dest_actions,
+ num_dest_actions,
+ ignore_flow_level);
if (!tmp_action) {
err = -EOPNOTSUPP;
goto free_actions;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h
index d8ac6c196211..a1295a311b70 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h
@@ -727,18 +727,14 @@ mlx5hws_action_create_push_vlan(struct mlx5hws_context *ctx, u32 flags);
* @dests: The destination array. Each contains a destination action and can
* have additional actions.
* @ignore_flow_level: Whether to turn on 'ignore_flow_level' for this dest.
- * @flow_source: Source port of the traffic for this actions.
* @flags: Action creation flags (enum mlx5hws_action_flags).
*
* Return: pointer to mlx5hws_action on success NULL otherwise.
*/
struct mlx5hws_action *
-mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
- size_t num_dest,
+mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx, size_t num_dest,
struct mlx5hws_action_dest_attr *dests,
- bool ignore_flow_level,
- u32 flow_source,
- u32 flags);
+ bool ignore_flow_level, u32 flags);
/**
* mlx5hws_action_create_insert_header - Create insert header action.
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH net-next 4/4] net/mlx5: HWS, remove incorrect comment
2025-05-25 11:15 [PATCH net-next 0/4] net/mlx5: HWS, more fixes and adjustments Tariq Toukan
` (2 preceding siblings ...)
2025-05-25 11:15 ` [PATCH net-next 3/4] net/mlx5: HWS, remove unused create_dest_array parameter Tariq Toukan
@ 2025-05-25 11:15 ` Tariq Toukan
3 siblings, 0 replies; 7+ messages in thread
From: Tariq Toukan @ 2025-05-25 11:15 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet,
Andrew Lunn
Cc: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, netdev, linux-rdma,
linux-kernel, Moshe Shemesh, Mark Bloch, Vlad Dogaru,
Yevgeny Kliteynik, Gal Pressman
From: Yevgeny Kliteynik <kliteyn@nvidia.com>
Removing incorrect comment section that is probably some
copy-paste artifact.
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Vlad Dogaru <vdogaru@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c
index 9e057f808ea5..665e6e285db5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/bwc.c
@@ -876,8 +876,6 @@ int mlx5hws_bwc_rule_create_simple(struct mlx5hws_bwc_rule *bwc_rule,
/* At this point the rule wasn't added.
* It could be because there was collision, or some other problem.
- * If we don't dive deeper than API, the only thing we know is that
- * the status of completion is RTE_FLOW_OP_ERROR.
* Try rehash by size and insert rule again - last chance.
*/
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread