1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2020 Mellanox Technologies. */
4 #ifndef __MLX5E_DCBNL_H__
5 #define __MLX5E_DCBNL_H__
7 #ifdef CONFIG_MLX5_CORE_EN_DCB
9 #define MLX5E_MAX_PRIORITY (8)
11 struct mlx5e_cee_config {
12 /* bw pct for priority group */
13 u8 pg_bw_pct[CEE_DCBX_MAX_PGS];
14 u8 prio_to_pg_map[CEE_DCBX_MAX_PRIO];
15 bool pfc_setting[CEE_DCBX_MAX_PRIO];
20 enum mlx5_dcbx_oper_mode mode;
21 struct mlx5e_cee_config cee_cfg; /* pending configuration */
24 /* The only setting that cannot be read from FW */
25 u8 tc_tsa[IEEE_8021QAZ_MAX_TCS];
28 /* Buffer configuration */
32 u16 port_buff_cell_sz;
35 #define MLX5E_MAX_DSCP (64)
37 struct mlx5e_dcbx_dp {
38 u8 dscp2prio[MLX5E_MAX_DSCP];
42 void mlx5e_dcbnl_build_netdev(struct net_device *netdev);
43 void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv);
44 void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv);
45 void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv);
47 static inline void mlx5e_dcbnl_build_netdev(struct net_device *netdev) {}
48 static inline void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv) {}
49 static inline void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv) {}
50 static inline void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv) {}
53 #endif /* __MLX5E_DCBNL_H__ */