net/mlx5e: Configure PSP Rx flow steering rules

Set the Rx PSP flow steering rule where PSP packet is identified and
decrypted using the dedicated UDP destination port number 1000. If packet
is decrypted then a PSP marker and syndrome are added to metadata so SW can
use it later on in Rx data path.

The rule is set as part of init_rx netdev profile implementation.

Signed-off-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20250917000954.859376-17-daniel.zahka@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Raed Salem 2025-09-16 17:09:43 -07:00 committed by Paolo Abeni
parent 9536fbe10c
commit 2b6e450bfd
3 changed files with 60 additions and 7 deletions

View File

@ -237,12 +237,24 @@ static inline void mlx5e_accel_tx_finish(struct mlx5e_txqsq *sq,
static inline int mlx5e_accel_init_rx(struct mlx5e_priv *priv)
{
return mlx5e_ktls_init_rx(priv);
int err;
err = mlx5_accel_psp_fs_init_rx_tables(priv);
if (err)
goto out;
err = mlx5e_ktls_init_rx(priv);
if (err)
mlx5_accel_psp_fs_cleanup_rx_tables(priv);
out:
return err;
}
static inline void mlx5e_accel_cleanup_rx(struct mlx5e_priv *priv)
{
mlx5e_ktls_cleanup_rx(priv);
mlx5_accel_psp_fs_cleanup_rx_tables(priv);
}
static inline int mlx5e_accel_init_tx(struct mlx5e_priv *priv)

View File

@ -460,9 +460,6 @@ static void accel_psp_fs_cleanup_rx(struct mlx5e_psp_fs *fs)
if (!fs->rx_fs)
return;
for (i = 0; i < ACCEL_FS_PSP_NUM_TYPES; i++)
accel_psp_fs_rx_ft_put(fs, i);
accel_psp = fs->rx_fs;
for (i = 0; i < ACCEL_FS_PSP_NUM_TYPES; i++) {
fs_prot = &accel_psp->fs_prot[i];
@ -488,13 +485,49 @@ static int accel_psp_fs_init_rx(struct mlx5e_psp_fs *fs)
mutex_init(&fs_prot->prot_mutex);
}
for (i = 0; i < ACCEL_FS_PSP_NUM_TYPES; i++)
accel_psp_fs_rx_ft_get(fs, ACCEL_FS_PSP4);
fs->rx_fs = accel_psp;
return 0;
}
void mlx5_accel_psp_fs_cleanup_rx_tables(struct mlx5e_priv *priv)
{
int i;
if (!priv->psp)
return;
for (i = 0; i < ACCEL_FS_PSP_NUM_TYPES; i++)
accel_psp_fs_rx_ft_put(priv->psp->fs, i);
}
int mlx5_accel_psp_fs_init_rx_tables(struct mlx5e_priv *priv)
{
struct mlx5e_psp_fs *fs;
int err, i;
if (!priv->psp)
return 0;
fs = priv->psp->fs;
for (i = 0; i < ACCEL_FS_PSP_NUM_TYPES; i++) {
err = accel_psp_fs_rx_ft_get(fs, i);
if (err)
goto out_err;
}
return 0;
out_err:
i--;
while (i >= 0) {
accel_psp_fs_rx_ft_put(fs, i);
--i;
}
return err;
}
static int accel_psp_fs_tx_create_ft_table(struct mlx5e_psp_fs *fs)
{
int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);

View File

@ -27,6 +27,8 @@ static inline bool mlx5_is_psp_device(struct mlx5_core_dev *mdev)
return true;
}
int mlx5_accel_psp_fs_init_rx_tables(struct mlx5e_priv *priv);
void mlx5_accel_psp_fs_cleanup_rx_tables(struct mlx5e_priv *priv);
int mlx5_accel_psp_fs_init_tx_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);
@ -34,6 +36,12 @@ void mlx5e_psp_unregister(struct mlx5e_priv *priv);
int mlx5e_psp_init(struct mlx5e_priv *priv);
void mlx5e_psp_cleanup(struct mlx5e_priv *priv);
#else
static inline int mlx5_accel_psp_fs_init_rx_tables(struct mlx5e_priv *priv)
{
return 0;
}
static inline void mlx5_accel_psp_fs_cleanup_rx_tables(struct mlx5e_priv *priv) { }
static inline int mlx5_accel_psp_fs_init_tx_tables(struct mlx5e_priv *priv)
{
return 0;