forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/ethernet/mellanox/mlx5/core/lib/vxlan.h
....@@ -37,6 +37,11 @@
3737 struct mlx5_vxlan;
3838 struct mlx5_vxlan_port;
3939
40
+static inline u8 mlx5_vxlan_max_udp_ports(struct mlx5_core_dev *mdev)
41
+{
42
+ return MLX5_CAP_ETH(mdev, max_vxlan_udp_ports) ?: 4;
43
+}
44
+
4045 static inline bool mlx5_vxlan_allowed(struct mlx5_vxlan *vxlan)
4146 {
4247 /* not allowed reason is encoded in vxlan pointer as error,
....@@ -50,15 +55,16 @@
5055 void mlx5_vxlan_destroy(struct mlx5_vxlan *vxlan);
5156 int mlx5_vxlan_add_port(struct mlx5_vxlan *vxlan, u16 port);
5257 int mlx5_vxlan_del_port(struct mlx5_vxlan *vxlan, u16 port);
53
-struct mlx5_vxlan_port *mlx5_vxlan_lookup_port(struct mlx5_vxlan *vxlan, u16 port);
58
+bool mlx5_vxlan_lookup_port(struct mlx5_vxlan *vxlan, u16 port);
59
+void mlx5_vxlan_reset_to_default(struct mlx5_vxlan *vxlan);
5460 #else
5561 static inline struct mlx5_vxlan*
5662 mlx5_vxlan_create(struct mlx5_core_dev *mdev) { return ERR_PTR(-EOPNOTSUPP); }
5763 static inline void mlx5_vxlan_destroy(struct mlx5_vxlan *vxlan) { return; }
5864 static inline int mlx5_vxlan_add_port(struct mlx5_vxlan *vxlan, u16 port) { return -EOPNOTSUPP; }
5965 static inline int mlx5_vxlan_del_port(struct mlx5_vxlan *vxlan, u16 port) { return -EOPNOTSUPP; }
60
-static inline struct mx5_vxlan_port*
61
-mlx5_vxlan_lookup_port(struct mlx5_vxlan *vxlan, u16 port) { return NULL; }
66
+static inline bool mlx5_vxlan_lookup_port(struct mlx5_vxlan *vxlan, u16 port) { return false; }
67
+static inline void mlx5_vxlan_reset_to_default(struct mlx5_vxlan *vxlan) { return; }
6268 #endif
6369
6470 #endif /* __MLX5_VXLAN_H__ */