Skip to content

Commit df29806

Browse files
committed
Merge branch 'mlx5-misc-fixes-2025-06-10'
Mark Bloch says: ==================== mlx5 misc fixes 2025-06-10 This patchset includes misc fixes from the team for the mlx5 core and Ethernet drivers. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents c7bdeed + 875d7c1 commit df29806

File tree

9 files changed

+40
-28
lines changed

9 files changed

+40
-28
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include "en/fs_ethtool.h"
4444

4545
#define LANES_UNKNOWN 0
46-
#define MAX_LANES 8
4746

4847
void mlx5e_ethtool_get_drvinfo(struct mlx5e_priv *priv,
4948
struct ethtool_drvinfo *drvinfo)
@@ -1098,10 +1097,8 @@ static void get_link_properties(struct net_device *netdev,
10981097
speed = info->speed;
10991098
lanes = info->lanes;
11001099
duplex = DUPLEX_FULL;
1101-
} else if (data_rate_oper) {
1100+
} else if (data_rate_oper)
11021101
speed = 100 * data_rate_oper;
1103-
lanes = MAX_LANES;
1104-
}
11051102

11061103
out:
11071104
link_ksettings->base.duplex = duplex;

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,9 +2028,8 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
20282028
return err;
20292029
}
20302030

2031-
static bool mlx5_flow_has_geneve_opt(struct mlx5e_tc_flow *flow)
2031+
static bool mlx5_flow_has_geneve_opt(struct mlx5_flow_spec *spec)
20322032
{
2033-
struct mlx5_flow_spec *spec = &flow->attr->parse_attr->spec;
20342033
void *headers_v = MLX5_ADDR_OF(fte_match_param,
20352034
spec->match_value,
20362035
misc_parameters_3);
@@ -2069,7 +2068,7 @@ static void mlx5e_tc_del_fdb_flow(struct mlx5e_priv *priv,
20692068
}
20702069
complete_all(&flow->del_hw_done);
20712070

2072-
if (mlx5_flow_has_geneve_opt(flow))
2071+
if (mlx5_flow_has_geneve_opt(&attr->parse_attr->spec))
20732072
mlx5_geneve_tlv_option_del(priv->mdev->geneve);
20742073

20752074
if (flow->decap_route)
@@ -2574,12 +2573,13 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv,
25742573

25752574
err = mlx5e_tc_tun_parse(filter_dev, priv, tmp_spec, f, match_level);
25762575
if (err) {
2577-
kvfree(tmp_spec);
25782576
NL_SET_ERR_MSG_MOD(extack, "Failed to parse tunnel attributes");
25792577
netdev_warn(priv->netdev, "Failed to parse tunnel attributes");
2580-
return err;
2578+
} else {
2579+
err = mlx5e_tc_set_attr_rx_tun(flow, tmp_spec);
25812580
}
2582-
err = mlx5e_tc_set_attr_rx_tun(flow, tmp_spec);
2581+
if (mlx5_flow_has_geneve_opt(tmp_spec))
2582+
mlx5_geneve_tlv_option_del(priv->mdev->geneve);
25832583
kvfree(tmp_spec);
25842584
if (err)
25852585
return err;

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,12 +1295,15 @@ mlx5_eswitch_enable_pf_vf_vports(struct mlx5_eswitch *esw,
12951295
ret = mlx5_eswitch_load_pf_vf_vport(esw, MLX5_VPORT_ECPF, enabled_events);
12961296
if (ret)
12971297
goto ecpf_err;
1298-
if (mlx5_core_ec_sriov_enabled(esw->dev)) {
1299-
ret = mlx5_eswitch_load_ec_vf_vports(esw, esw->esw_funcs.num_ec_vfs,
1300-
enabled_events);
1301-
if (ret)
1302-
goto ec_vf_err;
1303-
}
1298+
}
1299+
1300+
/* Enable ECVF vports */
1301+
if (mlx5_core_ec_sriov_enabled(esw->dev)) {
1302+
ret = mlx5_eswitch_load_ec_vf_vports(esw,
1303+
esw->esw_funcs.num_ec_vfs,
1304+
enabled_events);
1305+
if (ret)
1306+
goto ec_vf_err;
13041307
}
13051308

13061309
/* Enable VF vports */
@@ -1331,9 +1334,11 @@ void mlx5_eswitch_disable_pf_vf_vports(struct mlx5_eswitch *esw)
13311334
{
13321335
mlx5_eswitch_unload_vf_vports(esw, esw->esw_funcs.num_vfs);
13331336

1337+
if (mlx5_core_ec_sriov_enabled(esw->dev))
1338+
mlx5_eswitch_unload_ec_vf_vports(esw,
1339+
esw->esw_funcs.num_ec_vfs);
1340+
13341341
if (mlx5_ecpf_vport_exists(esw->dev)) {
1335-
if (mlx5_core_ec_sriov_enabled(esw->dev))
1336-
mlx5_eswitch_unload_ec_vf_vports(esw, esw->esw_funcs.num_vfs);
13371342
mlx5_eswitch_unload_pf_vf_vport(esw, MLX5_VPORT_ECPF);
13381343
}
13391344

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
22282228
struct mlx5_flow_handle *rule;
22292229
struct match_list *iter;
22302230
bool take_write = false;
2231+
bool try_again = false;
22312232
struct fs_fte *fte;
22322233
u64 version = 0;
22332234
int err;
@@ -2292,6 +2293,7 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
22922293
nested_down_write_ref_node(&g->node, FS_LOCK_PARENT);
22932294

22942295
if (!g->node.active) {
2296+
try_again = true;
22952297
up_write_ref_node(&g->node, false);
22962298
continue;
22972299
}
@@ -2313,7 +2315,8 @@ try_add_to_existing_fg(struct mlx5_flow_table *ft,
23132315
tree_put_node(&fte->node, false);
23142316
return rule;
23152317
}
2316-
rule = ERR_PTR(-ENOENT);
2318+
err = try_again ? -EAGAIN : -ENOENT;
2319+
rule = ERR_PTR(err);
23172320
out:
23182321
kmem_cache_free(steering->ftes_cache, fte);
23192322
return rule;

drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr, u32 function)
291291
static int alloc_system_page(struct mlx5_core_dev *dev, u32 function)
292292
{
293293
struct device *device = mlx5_core_dma_dev(dev);
294-
int nid = dev_to_node(device);
294+
int nid = dev->priv.numa_node;
295295
struct page *page;
296296
u64 zero_addr = 1;
297297
u64 addr;

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,8 +1370,8 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
13701370
struct mlx5hws_cmd_set_fte_attr fte_attr = {0};
13711371
struct mlx5hws_cmd_forward_tbl *fw_island;
13721372
struct mlx5hws_action *action;
1373-
u32 i /*, packet_reformat_id*/;
1374-
int ret;
1373+
int ret, last_dest_idx = -1;
1374+
u32 i;
13751375

13761376
if (num_dest <= 1) {
13771377
mlx5hws_err(ctx, "Action must have multiple dests\n");
@@ -1401,11 +1401,8 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
14011401
dest_list[i].destination_id = dests[i].dest->dest_obj.obj_id;
14021402
fte_attr.action_flags |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
14031403
fte_attr.ignore_flow_level = ignore_flow_level;
1404-
/* ToDo: In SW steering we have a handling of 'go to WIRE'
1405-
* destination here by upper layer setting 'is_wire_ft' flag
1406-
* if the destination is wire.
1407-
* This is because uplink should be last dest in the list.
1408-
*/
1404+
if (dests[i].is_wire_ft)
1405+
last_dest_idx = i;
14091406
break;
14101407
case MLX5HWS_ACTION_TYP_VPORT:
14111408
dest_list[i].destination_type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
@@ -1429,6 +1426,9 @@ mlx5hws_action_create_dest_array(struct mlx5hws_context *ctx,
14291426
}
14301427
}
14311428

1429+
if (last_dest_idx != -1)
1430+
swap(dest_list[last_dest_idx], dest_list[num_dest - 1]);
1431+
14321432
fte_attr.dests_num = num_dest;
14331433
fte_attr.dests = dest_list;
14341434

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/definer.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,9 @@ hws_definer_conv_outer(struct mlx5hws_definer_conv_data *cd,
785785
HWS_SET_HDR(fc, match_param, IP_PROTOCOL_O,
786786
outer_headers.ip_protocol,
787787
eth_l3_outer.protocol_next_header);
788+
HWS_SET_HDR(fc, match_param, IP_VERSION_O,
789+
outer_headers.ip_version,
790+
eth_l3_outer.ip_version);
788791
HWS_SET_HDR(fc, match_param, IP_TTL_O,
789792
outer_headers.ttl_hoplimit,
790793
eth_l3_outer.time_to_live_hop_limit);

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,9 @@ static int mlx5_fs_fte_get_hws_actions(struct mlx5_flow_root_namespace *ns,
966966
switch (attr->type) {
967967
case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE:
968968
dest_action = mlx5_fs_get_dest_action_ft(fs_ctx, dst);
969+
if (dst->dest_attr.ft->flags &
970+
MLX5_FLOW_TABLE_UPLINK_VPORT)
971+
dest_actions[num_dest_actions].is_wire_ft = true;
969972
break;
970973
case MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM:
971974
dest_action = mlx5_fs_get_dest_action_table_num(fs_ctx,
@@ -1357,6 +1360,7 @@ mlx5_cmd_hws_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns,
13571360
pkt_reformat->fs_hws_action.pr_data = pr_data;
13581361
}
13591362

1363+
mutex_init(&pkt_reformat->fs_hws_action.lock);
13601364
pkt_reformat->owner = MLX5_FLOW_RESOURCE_OWNER_HWS;
13611365
pkt_reformat->fs_hws_action.hws_action = hws_action;
13621366
return 0;
@@ -1503,7 +1507,6 @@ static int mlx5_cmd_hws_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
15031507
err = -ENOMEM;
15041508
goto release_mh;
15051509
}
1506-
mutex_init(&modify_hdr->fs_hws_action.lock);
15071510
modify_hdr->fs_hws_action.mh_data = mh_data;
15081511
modify_hdr->fs_hws_action.fs_pool = pool;
15091512
modify_hdr->owner = MLX5_FLOW_RESOURCE_OWNER_SW;

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ struct mlx5hws_action_dest_attr {
213213
struct mlx5hws_action *dest;
214214
/* Optional reformat action */
215215
struct mlx5hws_action *reformat;
216+
bool is_wire_ft;
216217
};
217218

218219
/**

0 commit comments

Comments
 (0)