diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2024-10-10 12:53:31 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2024-10-10 13:18:11 +0000 |
commit | 8e5b07dd08853f5d910d826bf28d3ae5bccd5a63 (patch) | |
tree | 535c91754aa44a7c4bc84c3cf818d4a597400907 | |
parent | 0fbfb22a2d4d542e2f3d5d0eadd37e0d132a3884 (diff) | |
download | src-8e5b07dd0885.tar.gz src-8e5b07dd0885.zip |
mlx5_ipsec: add enough #ifdef IPSEC_OFFLOAD to make LINT_NOIP compilable
Reported by: kp
Sponsored by: NVidia networking
Fixes: 2851aafe96c1e357971f2b331fff837ead20522b
-rw-r--r-- | sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c index 95afec40d4f6..159c82500a9f 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c @@ -328,7 +328,9 @@ mlx5e_if_sa_newkey_onedir(struct ifnet *ifp, void *sav, int dir, u_int drv_spi, struct mlx5e_ipsec_sa_entry **privp, struct mlx5e_ipsec_priv_bothdir *pb, struct ifnet *ifpo) { +#ifdef IPSEC_OFFLOAD struct rm_priotracker tracker; +#endif struct mlx5e_ipsec_sa_entry *sa_entry = NULL; struct mlx5e_priv *priv = if_getsoftc(ifp); struct mlx5_core_dev *mdev = priv->mdev; @@ -342,9 +344,13 @@ mlx5e_if_sa_newkey_onedir(struct ifnet *ifp, void *sav, int dir, u_int drv_spi, if (if_gettype(ifpo) == IFT_L2VLAN) VLAN_TAG(ifpo, &vid); +#ifdef IPSEC_OFFLOAD ipsec_sahtree_rlock(&tracker); +#endif err = mlx5e_xfrm_validate_state(mdev, sav); +#ifdef IPSEC_OFFLOAD ipsec_sahtree_runlock(&tracker); +#endif if (err) return err; @@ -359,14 +365,20 @@ mlx5e_if_sa_newkey_onedir(struct ifnet *ifp, void *sav, int dir, u_int drv_spi, sa_entry->ipsec = ipsec; sa_entry->vid = vid; +#ifdef IPSEC_OFFLOAD ipsec_sahtree_rlock(&tracker); +#endif err = mlx5e_xfrm_validate_state(mdev, sav); if (err != 0) { +#ifdef IPSEC_OFFLOAD ipsec_sahtree_runlock(&tracker); +#endif goto err_xfrm; } mlx5e_ipsec_build_accel_xfrm_attrs(sa_entry, &sa_entry->attrs, dir); +#ifdef IPSEC_OFFLOAD ipsec_sahtree_runlock(&tracker); +#endif err = mlx5e_ipsec_create_dwork(sa_entry, pb); if (err) |