mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
Merge branch 'net-mlx5e-psp-fixes'
Tariq Toukan says: ==================== net/mlx5e: PSP fixes This patchset provides bug fixes from Cosmin to the mlx5e PSP feature. ==================== Link: https://patch.msgid.link/20260504181100.269334-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
af0e9b26b9
|
|
@ -1070,29 +1070,37 @@ static struct psp_dev_ops mlx5_psp_ops = {
|
|||
|
||||
void mlx5e_psp_unregister(struct mlx5e_priv *priv)
|
||||
{
|
||||
if (!priv->psp || !priv->psp->psp)
|
||||
struct mlx5e_psp *psp = priv->psp;
|
||||
|
||||
if (!psp || !psp->psp)
|
||||
return;
|
||||
|
||||
psp_dev_unregister(priv->psp->psp);
|
||||
psp_dev_unregister(psp->psp);
|
||||
psp->psp = NULL;
|
||||
}
|
||||
|
||||
void mlx5e_psp_register(struct mlx5e_priv *priv)
|
||||
{
|
||||
struct mlx5e_psp *psp = priv->psp;
|
||||
struct psp_dev *psd;
|
||||
|
||||
/* FW Caps missing */
|
||||
if (!priv->psp)
|
||||
return;
|
||||
|
||||
priv->psp->caps.assoc_drv_spc = sizeof(u32);
|
||||
priv->psp->caps.versions = 1 << PSP_VERSION_HDR0_AES_GCM_128;
|
||||
psp->caps.assoc_drv_spc = sizeof(u32);
|
||||
psp->caps.versions = 1 << PSP_VERSION_HDR0_AES_GCM_128;
|
||||
if (MLX5_CAP_PSP(priv->mdev, psp_crypto_esp_aes_gcm_256_encrypt) &&
|
||||
MLX5_CAP_PSP(priv->mdev, psp_crypto_esp_aes_gcm_256_decrypt))
|
||||
priv->psp->caps.versions |= 1 << PSP_VERSION_HDR0_AES_GCM_256;
|
||||
psp->caps.versions |= 1 << PSP_VERSION_HDR0_AES_GCM_256;
|
||||
|
||||
priv->psp->psp = psp_dev_create(priv->netdev, &mlx5_psp_ops,
|
||||
&priv->psp->caps, NULL);
|
||||
if (IS_ERR(priv->psp->psp))
|
||||
psd = psp_dev_create(priv->netdev, &mlx5_psp_ops, &psp->caps, NULL);
|
||||
if (IS_ERR(psd)) {
|
||||
mlx5_core_err(priv->mdev, "PSP failed to register due to %pe\n",
|
||||
priv->psp->psp);
|
||||
psd);
|
||||
return;
|
||||
}
|
||||
psp->psp = psd;
|
||||
}
|
||||
|
||||
int mlx5e_psp_init(struct mlx5e_priv *priv)
|
||||
|
|
@ -1131,22 +1139,18 @@ int mlx5e_psp_init(struct mlx5e_priv *priv)
|
|||
if (!psp)
|
||||
return -ENOMEM;
|
||||
|
||||
priv->psp = psp;
|
||||
fs = mlx5e_accel_psp_fs_init(priv);
|
||||
if (IS_ERR(fs)) {
|
||||
err = PTR_ERR(fs);
|
||||
goto out_err;
|
||||
kfree(psp);
|
||||
return err;
|
||||
}
|
||||
|
||||
psp->fs = fs;
|
||||
priv->psp = psp;
|
||||
|
||||
mlx5_core_dbg(priv->mdev, "PSP attached to netdevice\n");
|
||||
return 0;
|
||||
|
||||
out_err:
|
||||
priv->psp = NULL;
|
||||
kfree(psp);
|
||||
return err;
|
||||
}
|
||||
|
||||
void mlx5e_psp_cleanup(struct mlx5e_priv *priv)
|
||||
|
|
|
|||
|
|
@ -6023,7 +6023,6 @@ static int mlx5e_nic_init(struct mlx5_core_dev *mdev,
|
|||
if (take_rtnl)
|
||||
rtnl_lock();
|
||||
|
||||
mlx5e_psp_register(priv);
|
||||
/* update XDP supported features */
|
||||
mlx5e_set_xdp_feature(priv);
|
||||
|
||||
|
|
@ -6036,7 +6035,6 @@ static int mlx5e_nic_init(struct mlx5_core_dev *mdev,
|
|||
static void mlx5e_nic_cleanup(struct mlx5e_priv *priv)
|
||||
{
|
||||
mlx5e_health_destroy_reporters(priv);
|
||||
mlx5e_psp_unregister(priv);
|
||||
mlx5e_ktls_cleanup(priv);
|
||||
mlx5e_psp_cleanup(priv);
|
||||
mlx5e_fs_cleanup(priv->fs);
|
||||
|
|
@ -6160,6 +6158,7 @@ static void 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_macsec_init(priv);
|
||||
if (err)
|
||||
|
|
@ -6230,6 +6229,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv)
|
|||
mlx5_lag_remove_netdev(mdev, priv->netdev);
|
||||
mlx5_vxlan_reset_to_default(mdev->vxlan);
|
||||
mlx5e_macsec_cleanup(priv);
|
||||
mlx5e_psp_unregister(priv);
|
||||
mlx5e_ipsec_cleanup(priv);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user