{net,IB}/mlx5: Add ipsec helper
authorAviad Yehezkel <aviadye@mellanox.com>
Wed, 28 Mar 2018 06:27:52 +0000 (09:27 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 4 Apr 2018 18:06:27 +0000 (12:06 -0600)
Simple wrapper to understand if we are dealing with IPsec flow.

Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
include/linux/mlx5/fs_helpers.h

index 7b476bbae73120a3bc31927041dd1ab77a2b819e..9db21cd0e92c4a1f334f4a8d7c90b4a29ecee7fa 100644 (file)
 #define MLX5_FS_IPV4_VERSION 4
 #define MLX5_FS_IPV6_VERSION 6
 
+static inline bool mlx5_fs_is_ipsec_flow(const u32 *match_c)
+{
+       void *misc_params_c = MLX5_ADDR_OF(fte_match_param, match_c,
+                                          misc_parameters);
+
+       return MLX5_GET(fte_match_set_misc, misc_params_c, outer_esp_spi);
+}
+
 static inline bool _mlx5_fs_is_outer_ipproto_flow(const u32 *match_c,
                                                  const u32 *match_v, u8 match)
 {