Skip to content

Commit 0462a15

Browse files
Cosmin Ratiukuba-moo
authored andcommitted
net/mlx5e: Dealloc forgotten PSP RX modify header
The commit which added RX steering rules for PSP forgot to free a modify header HW object on the cleanup path, which lead to health errors when reloading the driver and uninitializing the device: mlx5_core 0000:08:00.0: poll_health:803:(pid 3021): Fatal error 3 detected Fix that by saving the modify header pointer in the PSP steering struct and deallocating it after freeing the rule which references it. Fixes: 9536fbe ("net/mlx5e: Add PSP steering in local NIC RX") Signed-off-by: Cosmin Ratiu <[email protected]> Reviewed-by: Dragos Tatulea <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Mark Bloch <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 144297e commit 0462a15

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core/en_accel

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

0 commit comments

Comments
 (0)