MLXSW_SP_SB_CM(1500, 9, 4),
MLXSW_SP_SB_CM(1500, 9, 4),
MLXSW_SP_SB_CM(1500, 9, 4),
- MLXSW_SP_SB_CM(0, 140000, 8),
- MLXSW_SP_SB_CM(0, 140000, 8),
- MLXSW_SP_SB_CM(0, 140000, 8),
- MLXSW_SP_SB_CM(0, 140000, 8),
- MLXSW_SP_SB_CM(0, 140000, 8),
- MLXSW_SP_SB_CM(0, 140000, 8),
- MLXSW_SP_SB_CM(0, 140000, 8),
- MLXSW_SP_SB_CM(0, 140000, 8),
+ MLXSW_SP_SB_CM(0, 13440000, 8),
+ MLXSW_SP_SB_CM(0, 13440000, 8),
+ MLXSW_SP_SB_CM(0, 13440000, 8),
+ MLXSW_SP_SB_CM(0, 13440000, 8),
+ MLXSW_SP_SB_CM(0, 13440000, 8),
+ MLXSW_SP_SB_CM(0, 13440000, 8),
+ MLXSW_SP_SB_CM(0, 13440000, 8),
+ MLXSW_SP_SB_CM(0, 13440000, 8),
MLXSW_SP_SB_CM(1, 0xff, 4),
};
#define MLXSW_SP_CPU_PORT_SB_MCS_LEN \
ARRAY_SIZE(mlxsw_sp_cpu_port_sb_cms)
+static bool
+mlxsw_sp_sb_pool_is_static(struct mlxsw_sp *mlxsw_sp, u16 pool_index)
+{
+ struct mlxsw_sp_sb_pr *pr = mlxsw_sp_sb_pr_get(mlxsw_sp, pool_index);
+
+ return pr->mode == MLXSW_REG_SBPR_MODE_STATIC;
+}
+
static int __mlxsw_sp_sb_cms_init(struct mlxsw_sp *mlxsw_sp, u8 local_port,
enum mlxsw_reg_sbxx_dir dir,
const struct mlxsw_sp_sb_cm *cms,
for (i = 0; i < cms_len; i++) {
const struct mlxsw_sp_sb_cm *cm;
u32 min_buff;
+ u32 max_buff;
if (i == 8 && dir == MLXSW_REG_SBXX_DIR_INGRESS)
continue; /* PG number 8 does not exist, skip it */
if (WARN_ON(mlxsw_sp_sb_pool_dess[cm->pool_index].dir != dir))
continue;
- /* All pools are initialized using dynamic thresholds,
- * therefore 'max_buff' isn't specified in cells.
- */
min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, cm->min_buff);
- if (cm->max_buff == MLXSW_SP_SB_INFI)
+ max_buff = cm->max_buff;
+ if (max_buff == MLXSW_SP_SB_INFI) {
err = mlxsw_sp_sb_cm_write(mlxsw_sp, local_port, i,
min_buff, 0,
true, cm->pool_index);
- else
+ } else {
+ if (mlxsw_sp_sb_pool_is_static(mlxsw_sp,
+ cm->pool_index))
+ max_buff = mlxsw_sp_bytes_cells(mlxsw_sp,
+ max_buff);
err = mlxsw_sp_sb_cm_write(mlxsw_sp, local_port, i,
- min_buff, cm->max_buff,
+ min_buff, max_buff,
false, cm->pool_index);
+ }
if (err)
return err;
}
for (i = 0; i < MLXSW_SP_SB_PMS_LEN; i++) {
const struct mlxsw_sp_sb_pm *pm = &mlxsw_sp_sb_pms[i];
+ u32 max_buff;
u32 min_buff;
min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, pm->min_buff);
+ max_buff = pm->max_buff;
+ if (mlxsw_sp_sb_pool_is_static(mlxsw_sp, i))
+ max_buff = mlxsw_sp_bytes_cells(mlxsw_sp, max_buff);
err = mlxsw_sp_sb_pm_write(mlxsw_sp, mlxsw_sp_port->local_port,
- i, min_buff, pm->max_buff);
+ i, min_buff, max_buff);
if (err)
return err;
}
mc = &mlxsw_sp_sb_mms[i];
des = &mlxsw_sp_sb_pool_dess[mc->pool_index];
- /* All pools are initialized using dynamic thresholds,
- * therefore 'max_buff' isn't specified in cells.
+ /* All pools used by sb_mm's are initialized using dynamic
+ * thresholds, therefore 'max_buff' isn't specified in cells.
*/
min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, mc->min_buff);
mlxsw_reg_sbmm_pack(sbmm_pl, i, min_buff, mc->max_buff,