Commit 6d28725c authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: spectrum_buffers: Allow skipping ingress port quota configuration

The CPU port is used to transmit traffic that is trapped to the host
CPU. It is therefore irrelevant to define ingress quota for it.

Add a 'skip_ingress' argument to the function tasked with configuring
per-port quotas, so that ingress quotas could be skipped in case the
passed local port is the CPU port.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Reviewed-by: default avatarPetr Machata <petrm@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 24a7cc1e
...@@ -730,15 +730,21 @@ static const struct mlxsw_sp_sb_pm mlxsw_sp2_sb_pms[] = { ...@@ -730,15 +730,21 @@ static const struct mlxsw_sp_sb_pm mlxsw_sp2_sb_pms[] = {
}; };
static int mlxsw_sp_sb_pms_init(struct mlxsw_sp *mlxsw_sp, u8 local_port, static int mlxsw_sp_sb_pms_init(struct mlxsw_sp *mlxsw_sp, u8 local_port,
const struct mlxsw_sp_sb_pm *pms) const struct mlxsw_sp_sb_pm *pms,
bool skip_ingress)
{ {
int i, err; int i, err;
for (i = 0; i < mlxsw_sp->sb_vals->pool_count; i++) { for (i = 0; i < mlxsw_sp->sb_vals->pool_count; i++) {
const struct mlxsw_sp_sb_pm *pm = &pms[i]; const struct mlxsw_sp_sb_pm *pm = &pms[i];
const struct mlxsw_sp_sb_pool_des *des;
u32 max_buff; u32 max_buff;
u32 min_buff; u32 min_buff;
des = &mlxsw_sp->sb_vals->pool_dess[i];
if (skip_ingress && des->dir == MLXSW_REG_SBXX_DIR_INGRESS)
continue;
min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, pm->min_buff); min_buff = mlxsw_sp_bytes_cells(mlxsw_sp, pm->min_buff);
max_buff = pm->max_buff; max_buff = pm->max_buff;
if (mlxsw_sp_sb_pool_is_static(mlxsw_sp, i)) 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,7 +762,7 @@ static int mlxsw_sp_port_sb_pms_init(struct mlxsw_sp_port *mlxsw_sp_port)
struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
return mlxsw_sp_sb_pms_init(mlxsw_sp, mlxsw_sp_port->local_port, return mlxsw_sp_sb_pms_init(mlxsw_sp, mlxsw_sp_port->local_port,
mlxsw_sp->sb_vals->pms); mlxsw_sp->sb_vals->pms, false);
} }
#define MLXSW_SP_SB_MM(_min_buff, _max_buff) \ #define MLXSW_SP_SB_MM(_min_buff, _max_buff) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment