Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
0002 /* Copyright (c) 2019 Mellanox Technologies. */
0003 
0004 #ifndef __MLX5_GENEVE_H__
0005 #define __MLX5_GENEVE_H__
0006 
0007 #include <net/geneve.h>
0008 #include <linux/mlx5/driver.h>
0009 
0010 struct mlx5_geneve;
0011 
0012 #ifdef CONFIG_MLX5_ESWITCH
0013 
0014 struct mlx5_geneve *mlx5_geneve_create(struct mlx5_core_dev *mdev);
0015 void mlx5_geneve_destroy(struct mlx5_geneve *geneve);
0016 
0017 int mlx5_geneve_tlv_option_add(struct mlx5_geneve *geneve, struct geneve_opt *opt);
0018 void mlx5_geneve_tlv_option_del(struct mlx5_geneve *geneve);
0019 
0020 #else /* CONFIG_MLX5_ESWITCH */
0021 
0022 static inline struct mlx5_geneve
0023 *mlx5_geneve_create(struct mlx5_core_dev *mdev) { return NULL; }
0024 static inline void
0025 mlx5_geneve_destroy(struct mlx5_geneve *geneve) {}
0026 static inline int
0027 mlx5_geneve_tlv_option_add(struct mlx5_geneve *geneve, struct geneve_opt *opt) { return 0; }
0028 static inline void
0029 mlx5_geneve_tlv_option_del(struct mlx5_geneve *geneve) {}
0030 
0031 #endif /* CONFIG_MLX5_ESWITCH */
0032 
0033 #endif /* __MLX5_GENEVE_H__ */