Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
0002 /* Copyright (c) 2020 Mellanox Technologies. */
0003 
0004 #ifndef __MLX5E_DCBNL_H__
0005 #define __MLX5E_DCBNL_H__
0006 
0007 #ifdef CONFIG_MLX5_CORE_EN_DCB
0008 
0009 #define MLX5E_MAX_PRIORITY (8)
0010 
0011 struct mlx5e_cee_config {
0012     /* bw pct for priority group */
0013     u8                         pg_bw_pct[CEE_DCBX_MAX_PGS];
0014     u8                         prio_to_pg_map[CEE_DCBX_MAX_PRIO];
0015     bool                       pfc_setting[CEE_DCBX_MAX_PRIO];
0016     bool                       pfc_enable;
0017 };
0018 
0019 struct mlx5e_dcbx {
0020     enum mlx5_dcbx_oper_mode   mode;
0021     struct mlx5e_cee_config    cee_cfg; /* pending configuration */
0022     u8                         dscp_app_cnt;
0023 
0024     /* The only setting that cannot be read from FW */
0025     u8                         tc_tsa[IEEE_8021QAZ_MAX_TCS];
0026     u8                         cap;
0027 
0028     /* Buffer configuration */
0029     bool                       manual_buffer;
0030     u32                        cable_len;
0031     u32                        xoff;
0032     u16                        port_buff_cell_sz;
0033 };
0034 
0035 #define MLX5E_MAX_DSCP (64)
0036 
0037 struct mlx5e_dcbx_dp {
0038     u8                         dscp2prio[MLX5E_MAX_DSCP];
0039     u8                         trust_state;
0040 };
0041 
0042 void mlx5e_dcbnl_build_netdev(struct net_device *netdev);
0043 void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv);
0044 void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv);
0045 void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv);
0046 #else
0047 static inline void mlx5e_dcbnl_build_netdev(struct net_device *netdev) {}
0048 static inline void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv) {}
0049 static inline void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv) {}
0050 static inline void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv) {}
0051 #endif
0052 
0053 #endif /* __MLX5E_DCBNL_H__ */