1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2 /* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. */ 3 4 #ifndef __MLX5_MACSEC_H__ 5 #define __MLX5_MACSEC_H__ 6 7 #include <net/macsec.h> 8 #include <rdma/ib_cache.h> 9 #include <rdma/ib_addr.h> 10 #include "mlx5_ib.h" 11 12 #ifdef CONFIG_MLX5_MACSEC 13 struct mlx5_reserved_gids; 14 15 int mlx5r_add_gid_macsec_operations(const struct ib_gid_attr *attr); 16 void mlx5r_del_gid_macsec_operations(const struct ib_gid_attr *attr); 17 int mlx5r_macsec_alloc_gids(struct mlx5_ib_dev *dev); 18 void mlx5r_macsec_dealloc_gids(struct mlx5_ib_dev *dev); 19 #else 20 static inline int mlx5r_add_gid_macsec_operations(const struct ib_gid_attr *attr) { return 0; } 21 static inline void mlx5r_del_gid_macsec_operations(const struct ib_gid_attr *attr) {} 22 static inline int mlx5r_macsec_alloc_gids(struct mlx5_ib_dev *dev) { return 0; } 23 static inline void mlx5r_macsec_dealloc_gids(struct mlx5_ib_dev *dev) {} 24 #endif 25 #endif /* __MLX5_MACSEC_H__ */ 26