From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT:
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c

Change-Id: I2f6fbd2dbb446ba03a6f615ac0688536884be4c1
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
 /* Copyright (c) 2020, Mellanox Technologies inc. All rights reserved. */
 
+#ifdef CONFIG_MLX5_ESWITCH
 #include <linux/netdevice.h>
 #include "accel/ipsec_offload.h"
 #include "../esw/ipsec.h"
@@ -617,7 +618,6 @@ static int tx_add_rule_full(struct mlx5e
 	int err = 0;
 
 	esw = mdev->priv.eswitch;
-
 	if (esw->offloads.ipsec != DEVLINK_ESWITCH_IPSEC_MODE_FULL)
 		return -ENOTSUPP;
 
@@ -686,7 +686,6 @@ out:
 	kvfree(spec);
 	return err;
 }
-
 static int tx_add_rule(struct mlx5e_priv *priv,
 		       struct mlx5_accel_esp_xfrm_attrs *attrs,
 		       u32 ipsec_obj_id,
@@ -937,3 +936,4 @@ int mlx5e_accel_ipsec_fs_init(struct mlx
 
 	return err;
 }
+#endif /* CONFIG_MLX5_ESWITCH */
