1/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2/* Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
3
4#ifndef __MLX5_ESW_IPSEC_FS_H__
5#define __MLX5_ESW_IPSEC_FS_H__
6
7struct mlx5e_ipsec;
8struct mlx5e_ipsec_sa_entry;
9
10#ifdef CONFIG_MLX5_ESWITCH
11void mlx5_esw_ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec,
12 struct mlx5e_ipsec_rx_create_attr *attr);
13int mlx5_esw_ipsec_rx_status_pass_dest_get(struct mlx5e_ipsec *ipsec,
14 struct mlx5_flow_destination *dest);
15int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
16 struct mlx5_flow_act *flow_act);
17void mlx5_esw_ipsec_rx_id_mapping_remove(struct mlx5e_ipsec_sa_entry *sa_entry);
18int mlx5_esw_ipsec_rx_ipsec_obj_id_search(struct mlx5e_priv *priv, u32 id,
19 u32 *ipsec_obj_id);
20void mlx5_esw_ipsec_tx_create_attr_set(struct mlx5e_ipsec *ipsec,
21 struct mlx5e_ipsec_tx_create_attr *attr);
22void mlx5_esw_ipsec_restore_dest_uplink(struct mlx5_core_dev *mdev);
23#else
24static inline void mlx5_esw_ipsec_rx_create_attr_set(struct mlx5e_ipsec *ipsec,
25 struct mlx5e_ipsec_rx_create_attr *attr) {}
26
27static inline int mlx5_esw_ipsec_rx_status_pass_dest_get(struct mlx5e_ipsec *ipsec,
28 struct mlx5_flow_destination *dest)
29{
30 return -EINVAL;
31}
32
33static inline int mlx5_esw_ipsec_rx_setup_modify_header(struct mlx5e_ipsec_sa_entry *sa_entry,
34 struct mlx5_flow_act *flow_act)
35{
36 return -EINVAL;
37}
38
39static inline void mlx5_esw_ipsec_rx_id_mapping_remove(struct mlx5e_ipsec_sa_entry *sa_entry) {}
40
41static inline int mlx5_esw_ipsec_rx_ipsec_obj_id_search(struct mlx5e_priv *priv, u32 id,
42 u32 *ipsec_obj_id)
43{
44 return -EINVAL;
45}
46
47static inline void mlx5_esw_ipsec_tx_create_attr_set(struct mlx5e_ipsec *ipsec,
48 struct mlx5e_ipsec_tx_create_attr *attr) {}
49
50static inline void mlx5_esw_ipsec_restore_dest_uplink(struct mlx5_core_dev *mdev) {}
51#endif /* CONFIG_MLX5_ESWITCH */
52#endif /* __MLX5_ESW_IPSEC_FS_H__ */
53

source code of linux/drivers/net/ethernet/mellanox/mlx5/core/esw/ipsec_fs.h