1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2019 Mellanox Technologies. */
4 #ifndef __MLX5_GENEVE_H__
5 #define __MLX5_GENEVE_H__
7 #include <net/geneve.h>
8 #include <linux/mlx5/driver.h>
12 #ifdef CONFIG_MLX5_ESWITCH
14 struct mlx5_geneve *mlx5_geneve_create(struct mlx5_core_dev *mdev);
15 void mlx5_geneve_destroy(struct mlx5_geneve *geneve);
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);
20 #else /* CONFIG_MLX5_ESWITCH */
22 static inline struct mlx5_geneve
23 *mlx5_geneve_create(struct mlx5_core_dev *mdev) { return NULL; }
25 mlx5_geneve_destroy(struct mlx5_geneve *geneve) {}
27 mlx5_geneve_tlv_option_add(struct mlx5_geneve *geneve, struct geneve_opt *opt) { return 0; }
29 mlx5_geneve_tlv_option_del(struct mlx5_geneve *geneve) {}
31 #endif /* CONFIG_MLX5_ESWITCH */
33 #endif /* __MLX5_GENEVE_H__ */