43 struct ieee_ets *my_ets = &priv->ets;
66 en_err(priv,
"Bad priority in UP <=> TC mapping. TC: %d, UP: %d\n",
79 en_err(priv,
"TC[%d]: Not supported TSA: %d\n",
85 if (has_ets_tc && total_ets_bw != MLX4_EN_BW_MAX) {
86 en_err(priv,
"Bad ETS BW sum: %d. Should be exactly 100%%\n",
94 static int mlx4_en_config_port_scheduler(
struct mlx4_en_priv *priv,
103 ets = ets ?: &priv->ets;
104 ratelimit = ratelimit ?: priv->maxrate;
107 for (i = IEEE_8021QAZ_MAX_TCS - 1; i >= 0; i--) {
110 pg[
i] = num_strict++;
111 tc_tx_bw[
i] = MLX4_EN_BW_MAX;
114 pg[
i] = MLX4_EN_TC_ETS;
115 tc_tx_bw[
i] = ets->
tc_tx_bw[
i] ?: MLX4_EN_BW_MIN;
131 err = mlx4_en_ets_validate(priv, ets);
139 err = mlx4_en_config_port_scheduler(priv, ets,
NULL);
143 memcpy(&priv->ets, ets,
sizeof(priv->ets));
148 static int mlx4_en_dcbnl_ieee_getpfc(
struct net_device *dev,
159 static int mlx4_en_dcbnl_ieee_setpfc(
struct net_device *dev,
166 en_dbg(DRV, priv,
"cap: 0x%x en: 0x%x mbc: 0x%x delay: %d\n",
177 priv->
prof->tx_pause,
179 priv->
prof->rx_pause,
182 en_err(priv,
"Failed setting pause params\n");
203 #define MLX4_RATELIMIT_UNITS_IN_KB 100000
204 static int mlx4_en_dcbnl_ieee_getmaxrate(
struct net_device *dev,
220 static int mlx4_en_dcbnl_ieee_setmaxrate(
struct net_device *dev,
236 err = mlx4_en_config_port_scheduler(priv,
NULL, tmp);
240 memcpy(priv->maxrate, tmp,
sizeof(priv->maxrate));
246 .ieee_getets = mlx4_en_dcbnl_ieee_getets,
247 .ieee_setets = mlx4_en_dcbnl_ieee_setets,
248 .ieee_getmaxrate = mlx4_en_dcbnl_ieee_getmaxrate,
249 .ieee_setmaxrate = mlx4_en_dcbnl_ieee_setmaxrate,
250 .ieee_getpfc = mlx4_en_dcbnl_ieee_getpfc,
251 .ieee_setpfc = mlx4_en_dcbnl_ieee_setpfc,
253 .getdcbx = mlx4_en_dcbnl_getdcbx,
254 .setdcbx = mlx4_en_dcbnl_setdcbx,