Debian Codegraph @

drivers/net/ethernet/mellanox/mlx5/core/en/dcbnl.h

raw
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 /* Upper limit for 100Mbps and 1Gbps in Kbps units */
34 u64 upper_limit_100mbps;
35 u64 upper_limit_gbps;
36 };
37
38 #define MLX5E_MAX_DSCP (64)
39
40 struct mlx5e_dcbx_dp {
41 u8 dscp2prio[MLX5E_MAX_DSCP];
42 u8 trust_state;
43 };
44
45 void mlx5e_dcbnl_build_netdev(struct net_device *netdev);
46 void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv);
47 void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv);
48 void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv);
49 #else
50 static inline void mlx5e_dcbnl_build_netdev(struct net_device *netdev) {}
51 static inline void mlx5e_dcbnl_initialize(struct mlx5e_priv *priv) {}
52 static inline void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv) {}
53 static inline void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv) {}
54 #endif
55
56 #endif /* __MLX5E_DCBNL_H__ */