git: 8e5b07dd0885 - main - mlx5_ipsec: add enough #ifdef IPSEC_OFFLOAD to make LINT_NOIP compilable
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Oct 2024 13:19:40 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=8e5b07dd08853f5d910d826bf28d3ae5bccd5a63
commit 8e5b07dd08853f5d910d826bf28d3ae5bccd5a63
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-10-10 12:53:31 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-10-10 13:18:11 +0000
mlx5_ipsec: add enough #ifdef IPSEC_OFFLOAD to make LINT_NOIP compilable
Reported by: kp
Sponsored by: NVidia networking
Fixes: 2851aafe96c1e357971f2b331fff837ead20522b
---
sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
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)