1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. */
3 
4 #ifndef __MLX5_LIB_IPSEC_H__
5 #define __MLX5_LIB_IPSEC_H__
6 
7 #include "lib/devcom.h"
8 
9 struct mlx5_ipsec_fs;
10 
11 struct mlx5_flow_table *
12 mlx5_ipsec_fs_roce_ft_get(struct mlx5_ipsec_fs *ipsec_roce, u32 family);
13 void mlx5_ipsec_fs_roce_rx_destroy(struct mlx5_ipsec_fs *ipsec_roce,
14 				   u32 family, struct mlx5_core_dev *mdev);
15 int mlx5_ipsec_fs_roce_rx_create(struct mlx5_core_dev *mdev,
16 				 struct mlx5_ipsec_fs *ipsec_roce,
17 				 struct mlx5_flow_namespace *ns,
18 				 struct mlx5_flow_destination *default_dst,
19 				 u32 family, u32 level, u32 prio);
20 void mlx5_ipsec_fs_roce_tx_destroy(struct mlx5_ipsec_fs *ipsec_roce,
21 				   struct mlx5_core_dev *mdev);
22 int mlx5_ipsec_fs_roce_tx_create(struct mlx5_core_dev *mdev,
23 				 struct mlx5_ipsec_fs *ipsec_roce,
24 				 struct mlx5_flow_table *pol_ft,
25 				 bool from_event);
26 void mlx5_ipsec_fs_roce_cleanup(struct mlx5_ipsec_fs *ipsec_roce);
27 struct mlx5_ipsec_fs *mlx5_ipsec_fs_roce_init(struct mlx5_core_dev *mdev,
28 					      struct mlx5_devcom_comp_dev **devcom);
29 bool mlx5_ipsec_fs_is_mpv_roce_supported(struct mlx5_core_dev *mdev);
30 
31 #endif /* __MLX5_LIB_IPSEC_H__ */
32