Merge tag 'for-5.13-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
[linux-2.6-microblaze.git] / drivers / net / ethernet / mellanox / mlx5 / core / lib / geneve.h
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
23 *mlx5_geneve_create(struct mlx5_core_dev *mdev) { return NULL; }
24 static inline void
25 mlx5_geneve_destroy(struct mlx5_geneve *geneve) {}
26 static inline int
27 mlx5_geneve_tlv_option_add(struct mlx5_geneve *geneve, struct geneve_opt *opt) { return 0; }
28 static inline void
29 mlx5_geneve_tlv_option_del(struct mlx5_geneve *geneve) {}
30
31 #endif /* CONFIG_MLX5_ESWITCH */
32
33 #endif /* __MLX5_GENEVE_H__ */