1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ 2 /* Copyright (c) 2020 Mellanox Technologies. */ 3 4 #ifndef __MLX5E_DCBNL_H__ 5 #define __MLX5E_DCBNL_H__ 6 7 #ifdef CONFIG_MLX5_CORE_EN_DCB 8 9 #define MLX5E_MAX_PRIORITY (8) 10 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]; 16 bool pfc_enable; 17 }; 18 19 struct mlx5e_dcbx { 20 enum mlx5_dcbx_oper_mode mode; 21 struct mlx5e_cee_config cee_cfg; /* pending configuration */ 22 u8 dscp_app_cnt; 23 24 /* The only setting that cannot be read from FW */ 25 u8 tc_tsa[IEEE_8021QAZ_MAX_TCS]; 26 u8 cap; 27 28 /* Buffer configuration */ 29 u32 cable_len; 30 u32 xoff; 31 u16 port_buff_cell_sz; 32 }; 33 34 #define MLX5E_MAX_DSCP (64) 35 36 struct mlx5e_dcbx_dp { 37 u8 dscp2prio[MLX5E_MAX_DSCP]; 38 u8 trust_state; 39 }; 40 41 void mlx5e_dcbnl_build_netdev(struct net_device *netdev); 42 void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv); 43 void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv); 44 void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv); 45 #else mlx5e_dcbnl_build_netdev(struct net_device * netdev)46static inline void mlx5e_dcbnl_build_netdev(struct net_device *netdev) {} mlx5e_dcbnl_initialize(struct mlx5e_priv * priv)47static inline void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv) {} mlx5e_dcbnl_init_app(struct mlx5e_priv * priv)48static inline void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv) {} mlx5e_dcbnl_delete_app(struct mlx5e_priv * priv)49static inline void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv) {} 50 #endif 51 52 #endif /* __MLX5E_DCBNL_H__ */ 53