diff options
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c index e324fad8b100..32a74cc3d6e4 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c | |||
| @@ -730,15 +730,21 @@ static const struct mlxsw_sp_sb_pm mlxsw_sp2_sb_pms[] = { | |||
| 730 | }; | 730 | }; |
| 731 | 731 | ||
| 732 | static int mlxsw_sp_sb_pms_init(struct mlxsw_sp *mlxsw_sp, u8 local_port, | 732 | static int mlxsw_sp_sb_pms_init(struct mlxsw_sp *mlxsw_sp, u8 local_port, |
| 733 | const struct mlxsw_sp_sb_pm *pms) | 733 | const struct mlxsw_sp_sb_pm *pms, |
| 734 | bool skip_ingress) | ||
| 734 | { | 735 | { |
| 735 | int i, err; | 736 | int i, err; |
| 736 | 737 | ||
| 737 | for (i = 0; i < mlxsw_sp->sb_vals->pool_count; i++) { | 738 | for (i = 0; i < mlxsw_sp->sb_vals->pool_count; i++) { |
| 738 | const struct mlxsw_sp_sb_pm *pm = &pms[i]; | 739 | const struct mlxsw_sp_sb_pm *pm = &pms[i]; |
| 740 | const struct mlxsw_sp_sb_pool_des *des; | ||
| 739 | u32 max_buff; | 741 | u32 max_buff; |
| 740 | u32 min_buff; | 742 | u32 min_buff; |
| 741 | 743 | ||
| 744 | des = &mlxsw_sp->sb_vals->pool_dess[i]; | ||
| 745 | if (skip_ingress && des->dir == MLXSW_REG_SBXX_DIR_INGRESS) | ||
| 746 | continue; | ||
| 747 | |||
| 742 | min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, pm->min_buff); | 748 | min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, pm->min_buff); |
| 743 | max_buff = pm->max_buff; | 749 | max_buff = pm->max_buff; |
| 744 | if (mlxsw_sp_sb_pool_is_static(mlxsw_sp, i)) | 750 | if (mlxsw_sp_sb_pool_is_static(mlxsw_sp, i)) |
| @@ -756,7 +762,7 @@ static int mlxsw_sp_port_sb_pms_init(struct mlxsw_sp_port *mlxsw_sp_port) | |||
| 756 | struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; | 762 | struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; |
| 757 | 763 | ||
| 758 | return mlxsw_sp_sb_pms_init(mlxsw_sp, mlxsw_sp_port->local_port, | 764 | return mlxsw_sp_sb_pms_init(mlxsw_sp, mlxsw_sp_port->local_port, |
| 759 | mlxsw_sp->sb_vals->pms); | 765 | mlxsw_sp->sb_vals->pms, false); |
| 760 | } | 766 | } |
| 761 | 767 | ||
| 762 | #define MLXSW_SP_SB_MM(_min_buff, _max_buff) \ | 768 | #define MLXSW_SP_SB_MM(_min_buff, _max_buff) \ |
