hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/ethernet/mellanox/mlx5/core/accel/ipsec.h
....@@ -48,13 +48,30 @@
4848
4949 void *mlx5_accel_esp_create_hw_context(struct mlx5_core_dev *mdev,
5050 struct mlx5_accel_esp_xfrm *xfrm,
51
- const __be32 saddr[4],
52
- const __be32 daddr[4],
53
- const __be32 spi, bool is_ipv6);
54
-void mlx5_accel_esp_free_hw_context(void *context);
51
+ u32 *sa_handle);
52
+void mlx5_accel_esp_free_hw_context(struct mlx5_core_dev *mdev, void *context);
5553
56
-int mlx5_accel_ipsec_init(struct mlx5_core_dev *mdev);
54
+void mlx5_accel_ipsec_init(struct mlx5_core_dev *mdev);
5755 void mlx5_accel_ipsec_cleanup(struct mlx5_core_dev *mdev);
56
+
57
+struct mlx5_accel_ipsec_ops {
58
+ u32 (*device_caps)(struct mlx5_core_dev *mdev);
59
+ unsigned int (*counters_count)(struct mlx5_core_dev *mdev);
60
+ int (*counters_read)(struct mlx5_core_dev *mdev, u64 *counters, unsigned int count);
61
+ void* (*create_hw_context)(struct mlx5_core_dev *mdev,
62
+ struct mlx5_accel_esp_xfrm *xfrm,
63
+ const __be32 saddr[4], const __be32 daddr[4],
64
+ const __be32 spi, bool is_ipv6, u32 *sa_handle);
65
+ void (*free_hw_context)(void *context);
66
+ int (*init)(struct mlx5_core_dev *mdev);
67
+ void (*cleanup)(struct mlx5_core_dev *mdev);
68
+ struct mlx5_accel_esp_xfrm* (*esp_create_xfrm)(struct mlx5_core_dev *mdev,
69
+ const struct mlx5_accel_esp_xfrm_attrs *attrs,
70
+ u32 flags);
71
+ int (*esp_modify_xfrm)(struct mlx5_accel_esp_xfrm *xfrm,
72
+ const struct mlx5_accel_esp_xfrm_attrs *attrs);
73
+ void (*esp_destroy_xfrm)(struct mlx5_accel_esp_xfrm *xfrm);
74
+};
5875
5976 #else
6077
....@@ -63,26 +80,17 @@
6380 static inline void *
6481 mlx5_accel_esp_create_hw_context(struct mlx5_core_dev *mdev,
6582 struct mlx5_accel_esp_xfrm *xfrm,
66
- const __be32 saddr[4],
67
- const __be32 daddr[4],
68
- const __be32 spi, bool is_ipv6)
83
+ u32 *sa_handle)
6984 {
7085 return NULL;
7186 }
7287
73
-static inline void mlx5_accel_esp_free_hw_context(void *context)
74
-{
75
-}
88
+static inline void mlx5_accel_esp_free_hw_context(struct mlx5_core_dev *mdev, void *context) {}
7689
77
-static inline int mlx5_accel_ipsec_init(struct mlx5_core_dev *mdev)
78
-{
79
- return 0;
80
-}
90
+static inline void mlx5_accel_ipsec_init(struct mlx5_core_dev *mdev) {}
8191
82
-static inline void mlx5_accel_ipsec_cleanup(struct mlx5_core_dev *mdev)
83
-{
84
-}
92
+static inline void mlx5_accel_ipsec_cleanup(struct mlx5_core_dev *mdev) {}
8593
86
-#endif
94
+#endif /* CONFIG_MLX5_ACCEL */
8795
8896 #endif /* __MLX5_ACCEL_IPSEC_H__ */