net/mlx5e: psp: Report PSP dev registration errors

mlx5e_psp_register() was forced to eat PSP dev registration errors as
the caller was not propagating them. Change this so PSP dev registration
failures get reported back to the caller instead.

After the recent changes in the series, PSP dev registration failures
will just leave some data structs in priv->psp (mostly counters), with
no steering rules and no means to configure them. There's no point
actively cleaning those up on failure, as they'll get removed during
profile->cleanup.

Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260707130858.969928-16-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Cosmin Ratiu
2026-07-07 16:08:58 +03:00
committed by Jakub Kicinski
parent 13ae76a6a3
commit 676fe97d57
3 changed files with 14 additions and 6 deletions

View File

@@ -1028,14 +1028,14 @@ void mlx5e_psp_unregister(struct mlx5e_priv *priv)
psp->psd = NULL;
}
void mlx5e_psp_register(struct mlx5e_priv *priv)
int mlx5e_psp_register(struct mlx5e_priv *priv)
{
struct mlx5e_psp *psp = priv->psp;
struct psp_dev *psd;
/* FW Caps missing */
if (!priv->psp)
return;
return 0;
psp->caps.assoc_drv_spc = sizeof(u32);
psp->caps.versions = 1 << PSP_VERSION_HDR0_AES_GCM_128;
@@ -1047,9 +1047,11 @@ void mlx5e_psp_register(struct mlx5e_priv *priv)
if (IS_ERR(psd)) {
mlx5_core_err(priv->mdev, "PSP failed to register due to %pe\n",
psd);
return;
return PTR_ERR(psd);
}
psp->psd = psd;
return 0;
}
int mlx5e_psp_init(struct mlx5e_priv *priv)

View File

@@ -45,7 +45,7 @@ static inline bool mlx5_is_psp_device(struct mlx5_core_dev *mdev)
void mlx5_accel_psp_fs_cleanup_rx_tables(struct mlx5e_priv *priv);
void mlx5_accel_psp_fs_cleanup_tx_tables(struct mlx5e_priv *priv);
void mlx5e_psp_register(struct mlx5e_priv *priv);
int mlx5e_psp_register(struct mlx5e_priv *priv);
void mlx5e_psp_unregister(struct mlx5e_priv *priv);
int mlx5e_psp_init(struct mlx5e_priv *priv);
void mlx5e_psp_cleanup(struct mlx5e_priv *priv);
@@ -57,7 +57,7 @@ static inline bool mlx5_is_psp_device(struct mlx5_core_dev *mdev)
return false;
}
static inline void mlx5e_psp_register(struct mlx5e_priv *priv) { }
static inline int mlx5e_psp_register(struct mlx5e_priv *priv) { return 0; }
static inline void mlx5e_psp_unregister(struct mlx5e_priv *priv) { }
static inline int mlx5e_psp_init(struct mlx5e_priv *priv) { return 0; }
static inline void mlx5e_psp_cleanup(struct mlx5e_priv *priv) { }

View File

@@ -6201,7 +6201,9 @@ static int mlx5e_nic_enable(struct mlx5e_priv *priv)
mlx5e_fs_init_l2_addr(priv->fs, netdev);
mlx5e_ipsec_init(priv);
mlx5e_psp_register(priv);
err = mlx5e_psp_register(priv);
if (err)
goto out_ipsec_cleanup;
err = mlx5e_macsec_init(priv);
if (err)
@@ -6239,6 +6241,10 @@ static int mlx5e_nic_enable(struct mlx5e_priv *priv)
rtnl_unlock();
return 0;
out_ipsec_cleanup:
mlx5e_ipsec_cleanup(priv);
return err;
}
static void mlx5e_nic_disable(struct mlx5e_priv *priv)