• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2019 Mellanox Technologies. */
3 
4 #ifndef __MLX5_GENEVE_H__
5 #define __MLX5_GENEVE_H__
6 
7 #include <net/geneve.h>
8 #include <linux/mlx5/driver.h>
9 
10 struct mlx5_geneve;
11 
12 #ifdef CONFIG_MLX5_ESWITCH
13 
14 struct mlx5_geneve *mlx5_geneve_create(struct mlx5_core_dev *mdev);
15 void mlx5_geneve_destroy(struct mlx5_geneve *geneve);
16 
17 int mlx5_geneve_tlv_option_add(struct mlx5_geneve *geneve, struct geneve_opt *opt);
18 void mlx5_geneve_tlv_option_del(struct mlx5_geneve *geneve);
19 
20 #else /* CONFIG_MLX5_ESWITCH */
21 
22 static inline struct mlx5_geneve
mlx5_geneve_create(struct mlx5_core_dev * mdev)23 *mlx5_geneve_create(struct mlx5_core_dev *mdev) { return NULL; }
24 static inline void
mlx5_geneve_destroy(struct mlx5_geneve * geneve)25 mlx5_geneve_destroy(struct mlx5_geneve *geneve) {}
26 static inline int
mlx5_geneve_tlv_option_add(struct mlx5_geneve * geneve,struct geneve_opt * opt)27 mlx5_geneve_tlv_option_add(struct mlx5_geneve *geneve, struct geneve_opt *opt) { return 0; }
28 static inline void
mlx5_geneve_tlv_option_del(struct mlx5_geneve * geneve)29 mlx5_geneve_tlv_option_del(struct mlx5_geneve *geneve) {}
30 
31 #endif /* CONFIG_MLX5_ESWITCH */
32 
33 #endif /* __MLX5_GENEVE_H__ */
34