Skip to content

Commit 43b1824

Browse files
committed
Merge branch 'mlx5-misc-fixes-2025-12-25'
Mark Bloch says: ==================== mlx5 misc fixes 2025-12-25 This patchset provides misc bug fixes from the team to the mlx5 core and Eth drivers. ==================== Link: https://patch.msgid.link/20251225132717.358820-1-mbloch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 02d1e1a + 0462a15 commit 43b1824

4 files changed

Lines changed: 29 additions & 12 deletions

File tree

drivers/net/ethernet/mellanox/mlx5/core/en_accel/psp.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct mlx5e_accel_fs_psp_prot {
4444
struct mlx5_flow_table *ft;
4545
struct mlx5_flow_group *miss_group;
4646
struct mlx5_flow_handle *miss_rule;
47+
struct mlx5_modify_hdr *rx_modify_hdr;
4748
struct mlx5_flow_destination default_dest;
4849
struct mlx5e_psp_rx_err rx_err;
4950
u32 refcnt;
@@ -286,13 +287,19 @@ static int accel_psp_fs_rx_err_create_ft(struct mlx5e_psp_fs *fs,
286287
return err;
287288
}
288289

289-
static void accel_psp_fs_rx_fs_destroy(struct mlx5e_accel_fs_psp_prot *fs_prot)
290+
static void accel_psp_fs_rx_fs_destroy(struct mlx5e_psp_fs *fs,
291+
struct mlx5e_accel_fs_psp_prot *fs_prot)
290292
{
291293
if (fs_prot->def_rule) {
292294
mlx5_del_flow_rules(fs_prot->def_rule);
293295
fs_prot->def_rule = NULL;
294296
}
295297

298+
if (fs_prot->rx_modify_hdr) {
299+
mlx5_modify_header_dealloc(fs->mdev, fs_prot->rx_modify_hdr);
300+
fs_prot->rx_modify_hdr = NULL;
301+
}
302+
296303
if (fs_prot->miss_rule) {
297304
mlx5_del_flow_rules(fs_prot->miss_rule);
298305
fs_prot->miss_rule = NULL;
@@ -396,6 +403,7 @@ static int accel_psp_fs_rx_create_ft(struct mlx5e_psp_fs *fs,
396403
modify_hdr = NULL;
397404
goto out_err;
398405
}
406+
fs_prot->rx_modify_hdr = modify_hdr;
399407

400408
flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
401409
MLX5_FLOW_CONTEXT_ACTION_CRYPTO_DECRYPT |
@@ -416,7 +424,7 @@ static int accel_psp_fs_rx_create_ft(struct mlx5e_psp_fs *fs,
416424
goto out;
417425

418426
out_err:
419-
accel_psp_fs_rx_fs_destroy(fs_prot);
427+
accel_psp_fs_rx_fs_destroy(fs, fs_prot);
420428
out:
421429
kvfree(flow_group_in);
422430
kvfree(spec);
@@ -433,7 +441,7 @@ static int accel_psp_fs_rx_destroy(struct mlx5e_psp_fs *fs, enum accel_fs_psp_ty
433441
/* The netdev unreg already happened, so all offloaded rule are already removed */
434442
fs_prot = &accel_psp->fs_prot[type];
435443

436-
accel_psp_fs_rx_fs_destroy(fs_prot);
444+
accel_psp_fs_rx_fs_destroy(fs, fs_prot);
437445

438446
accel_psp_fs_rx_err_destroy_ft(fs, &fs_prot->rx_err);
439447

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,12 +1608,13 @@ void mlx5e_stats_fec_get(struct mlx5e_priv *priv,
16081608
{
16091609
int mode = fec_active_mode(priv->mdev);
16101610

1611-
if (mode == MLX5E_FEC_NOFEC ||
1612-
!MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group))
1611+
if (mode == MLX5E_FEC_NOFEC)
16131612
return;
16141613

1615-
fec_set_corrected_bits_total(priv, fec_stats);
1616-
fec_set_block_stats(priv, mode, fec_stats);
1614+
if (MLX5_CAP_PCAM_FEATURE(priv->mdev, ppcnt_statistical_group)) {
1615+
fec_set_corrected_bits_total(priv, fec_stats);
1616+
fec_set_block_stats(priv, mode, fec_stats);
1617+
}
16171618

16181619
if (MLX5_CAP_PCAM_REG(priv->mdev, pphcr))
16191620
fec_set_histograms_stats(priv, mode, hist);

drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,15 @@ static void mlx5_lag_fib_route_event(struct mlx5_lag *ldev, unsigned long event,
173173
}
174174

175175
/* Handle multipath entry with lower priority value */
176-
if (mp->fib.mfi && mp->fib.mfi != fi &&
176+
if (mp->fib.mfi &&
177177
(mp->fib.dst != fen_info->dst || mp->fib.dst_len != fen_info->dst_len) &&
178-
fi->fib_priority >= mp->fib.priority)
178+
mp->fib.dst_len <= fen_info->dst_len &&
179+
!(mp->fib.dst_len == fen_info->dst_len &&
180+
fi->fib_priority < mp->fib.priority)) {
181+
mlx5_core_dbg(ldev->pf[idx].dev,
182+
"Multipath entry with lower priority was rejected\n");
179183
return;
184+
}
180185

181186
nh_dev0 = mlx5_lag_get_next_fib_dev(ldev, fi, NULL);
182187
nh_dev1 = mlx5_lag_get_next_fib_dev(ldev, fi, nh_dev0);

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,11 @@ static int mlx5_query_mcia(struct mlx5_core_dev *dev,
393393
if (err)
394394
return err;
395395

396-
*status = MLX5_GET(mcia_reg, out, status);
397-
if (*status)
396+
if (MLX5_GET(mcia_reg, out, status)) {
397+
if (status)
398+
*status = MLX5_GET(mcia_reg, out, status);
398399
return -EIO;
400+
}
399401

400402
ptr = MLX5_ADDR_OF(mcia_reg, out, dword_0);
401403
memcpy(data, ptr, size);
@@ -429,7 +431,8 @@ int mlx5_query_module_eeprom(struct mlx5_core_dev *dev,
429431
mlx5_qsfp_eeprom_params_set(&query.i2c_address, &query.page, &offset);
430432
break;
431433
default:
432-
mlx5_core_err(dev, "Module ID not recognized: 0x%x\n", module_id);
434+
mlx5_core_dbg(dev, "Module ID not recognized: 0x%x\n",
435+
module_id);
433436
return -EINVAL;
434437
}
435438

0 commit comments

Comments
 (0)