Commit 5589b8f1 authored by Raed Salem's avatar Raed Salem Committed by Saeed Mahameed

net/mlx5e: Add IPsec support to uplink representor

Add the xfrm xdo and ipsec_init/cleanup to uplink representor to
support IPsec in SRIOV switchdev mode.
Signed-off-by: default avatarRaed Salem <raeds@nvidia.com>
Signed-off-by: default avatarHuy Nguyen <huyn@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent e8c82761
...@@ -428,7 +428,6 @@ int mlx5e_ipsec_init(struct mlx5e_priv *priv) ...@@ -428,7 +428,6 @@ int mlx5e_ipsec_init(struct mlx5e_priv *priv)
spin_lock_init(&ipsec->sadb_rx_lock); spin_lock_init(&ipsec->sadb_rx_lock);
ida_init(&ipsec->halloc); ida_init(&ipsec->halloc);
ipsec->en_priv = priv; ipsec->en_priv = priv;
ipsec->en_priv->ipsec = ipsec;
ipsec->no_trailer = !!(mlx5_accel_ipsec_device_caps(priv->mdev) & ipsec->no_trailer = !!(mlx5_accel_ipsec_device_caps(priv->mdev) &
MLX5_ACCEL_IPSEC_CAP_RX_NO_TRAILER); MLX5_ACCEL_IPSEC_CAP_RX_NO_TRAILER);
ipsec->wq = alloc_ordered_workqueue("mlx5e_ipsec: %s", 0, ipsec->wq = alloc_ordered_workqueue("mlx5e_ipsec: %s", 0,
...@@ -438,6 +437,7 @@ int mlx5e_ipsec_init(struct mlx5e_priv *priv) ...@@ -438,6 +437,7 @@ int mlx5e_ipsec_init(struct mlx5e_priv *priv)
return -ENOMEM; return -ENOMEM;
} }
priv->ipsec = ipsec;
mlx5e_accel_ipsec_fs_init(priv); mlx5e_accel_ipsec_fs_init(priv);
netdev_dbg(priv->netdev, "IPSec attached to netdevice\n"); netdev_dbg(priv->netdev, "IPSec attached to netdevice\n");
return 0; return 0;
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include "lib/mlx5.h" #include "lib/mlx5.h"
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS
#include "diag/en_rep_tracepoint.h" #include "diag/en_rep_tracepoint.h"
#include "en_accel/ipsec.h"
#define MLX5E_REP_PARAMS_DEF_LOG_SQ_SIZE \ #define MLX5E_REP_PARAMS_DEF_LOG_SQ_SIZE \
max(0x7, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE) max(0x7, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)
...@@ -630,6 +631,11 @@ static int mlx5e_init_ul_rep(struct mlx5_core_dev *mdev, ...@@ -630,6 +631,11 @@ static int mlx5e_init_ul_rep(struct mlx5_core_dev *mdev,
struct net_device *netdev) struct net_device *netdev)
{ {
struct mlx5e_priv *priv = netdev_priv(netdev); struct mlx5e_priv *priv = netdev_priv(netdev);
int err;
err = mlx5e_ipsec_init(priv);
if (err)
mlx5_core_err(mdev, "Uplink rep IPsec initialization failed, %d\n", err);
mlx5e_vxlan_set_netdev_info(priv); mlx5e_vxlan_set_netdev_info(priv);
return mlx5e_init_rep(mdev, netdev); return mlx5e_init_rep(mdev, netdev);
...@@ -637,6 +643,7 @@ static int mlx5e_init_ul_rep(struct mlx5_core_dev *mdev, ...@@ -637,6 +643,7 @@ static int mlx5e_init_ul_rep(struct mlx5_core_dev *mdev,
static void mlx5e_cleanup_rep(struct mlx5e_priv *priv) static void mlx5e_cleanup_rep(struct mlx5e_priv *priv)
{ {
mlx5e_ipsec_cleanup(priv);
} }
static int mlx5e_create_rep_ttc_table(struct mlx5e_priv *priv) static int mlx5e_create_rep_ttc_table(struct mlx5e_priv *priv)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment