Commit aa99bc70 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

mlxsw: spectrum_buffers: Rename "pool" to "pr" in initialization

Be consintent with rest of the registers (pm, cm) and use "pr" here.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b11c3b40
...@@ -128,75 +128,75 @@ static int mlxsw_sp_port_headroom_init(struct mlxsw_sp_port *mlxsw_sp_port) ...@@ -128,75 +128,75 @@ static int mlxsw_sp_port_headroom_init(struct mlxsw_sp_port *mlxsw_sp_port)
return mlxsw_sp_port_pb_prio_init(mlxsw_sp_port); return mlxsw_sp_port_pb_prio_init(mlxsw_sp_port);
} }
struct mlxsw_sp_sb_pool { struct mlxsw_sp_sb_pr {
enum mlxsw_reg_sbpr_mode mode; enum mlxsw_reg_sbpr_mode mode;
u32 size; u32 size;
}; };
#define MLXSW_SP_SB_POOL_INGRESS_SIZE \ #define MLXSW_SP_SB_PR_INGRESS_SIZE \
(15000000 - (2 * 20000 * MLXSW_PORT_MAX_PORTS)) (15000000 - (2 * 20000 * MLXSW_PORT_MAX_PORTS))
#define MLXSW_SP_SB_POOL_EGRESS_SIZE \ #define MLXSW_SP_SB_PR_EGRESS_SIZE \
(14000000 - (8 * 1500 * MLXSW_PORT_MAX_PORTS)) (14000000 - (8 * 1500 * MLXSW_PORT_MAX_PORTS))
#define MLXSW_SP_SB_POOL(_mode, _size) \ #define MLXSW_SP_SB_PR(_mode, _size) \
{ \ { \
.mode = _mode, \ .mode = _mode, \
.size = _size, \ .size = _size, \
} }
static const struct mlxsw_sp_sb_pool mlxsw_sp_sb_pools_ingress[] = { static const struct mlxsw_sp_sb_pr mlxsw_sp_sb_prs_ingress[] = {
MLXSW_SP_SB_POOL(MLXSW_REG_SBPR_MODE_DYNAMIC, MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_DYNAMIC,
MLXSW_SP_BYTES_TO_CELLS(MLXSW_SP_SB_POOL_INGRESS_SIZE)), MLXSW_SP_BYTES_TO_CELLS(MLXSW_SP_SB_PR_INGRESS_SIZE)),
MLXSW_SP_SB_POOL(MLXSW_REG_SBPR_MODE_DYNAMIC, 0), MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_DYNAMIC, 0),
MLXSW_SP_SB_POOL(MLXSW_REG_SBPR_MODE_DYNAMIC, 0), MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_DYNAMIC, 0),
MLXSW_SP_SB_POOL(MLXSW_REG_SBPR_MODE_DYNAMIC, 0), MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_DYNAMIC, 0),
}; };
#define MLXSW_SP_SB_POOLS_INGRESS_LEN ARRAY_SIZE(mlxsw_sp_sb_pools_ingress) #define MLXSW_SP_SB_PRS_INGRESS_LEN ARRAY_SIZE(mlxsw_sp_sb_prs_ingress)
static const struct mlxsw_sp_sb_pool mlxsw_sp_sb_pools_egress[] = { static const struct mlxsw_sp_sb_pr mlxsw_sp_sb_prs_egress[] = {
MLXSW_SP_SB_POOL(MLXSW_REG_SBPR_MODE_DYNAMIC, MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_DYNAMIC,
MLXSW_SP_BYTES_TO_CELLS(MLXSW_SP_SB_POOL_EGRESS_SIZE)), MLXSW_SP_BYTES_TO_CELLS(MLXSW_SP_SB_PR_EGRESS_SIZE)),
MLXSW_SP_SB_POOL(MLXSW_REG_SBPR_MODE_DYNAMIC, 0), MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_DYNAMIC, 0),
MLXSW_SP_SB_POOL(MLXSW_REG_SBPR_MODE_DYNAMIC, 0), MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_DYNAMIC, 0),
MLXSW_SP_SB_POOL(MLXSW_REG_SBPR_MODE_DYNAMIC, MLXSW_SP_SB_PR(MLXSW_REG_SBPR_MODE_DYNAMIC,
MLXSW_SP_BYTES_TO_CELLS(MLXSW_SP_SB_POOL_EGRESS_SIZE)), MLXSW_SP_BYTES_TO_CELLS(MLXSW_SP_SB_PR_EGRESS_SIZE)),
}; };
#define MLXSW_SP_SB_POOLS_EGRESS_LEN ARRAY_SIZE(mlxsw_sp_sb_pools_egress) #define MLXSW_SP_SB_PRS_EGRESS_LEN ARRAY_SIZE(mlxsw_sp_sb_prs_egress)
static int __mlxsw_sp_sb_pools_init(struct mlxsw_sp *mlxsw_sp, static int __mlxsw_sp_sb_prs_init(struct mlxsw_sp *mlxsw_sp,
enum mlxsw_reg_sbxx_dir dir, enum mlxsw_reg_sbxx_dir dir,
const struct mlxsw_sp_sb_pool *pools, const struct mlxsw_sp_sb_pr *prs,
size_t pools_len) size_t prs_len)
{ {
int i; int i;
int err; int err;
for (i = 0; i < pools_len; i++) { for (i = 0; i < prs_len; i++) {
const struct mlxsw_sp_sb_pool *pool; const struct mlxsw_sp_sb_pr *pr;
pool = &pools[i]; pr = &prs[i];
err = mlxsw_sp_sb_pr_write(mlxsw_sp, i, dir, err = mlxsw_sp_sb_pr_write(mlxsw_sp, i, dir,
pool->mode, pool->size); pr->mode, pr->size);
if (err) if (err)
return err; return err;
} }
return 0; return 0;
} }
static int mlxsw_sp_sb_pools_init(struct mlxsw_sp *mlxsw_sp) static int mlxsw_sp_sb_prs_init(struct mlxsw_sp *mlxsw_sp)
{ {
int err; int err;
err = __mlxsw_sp_sb_pools_init(mlxsw_sp, MLXSW_REG_SBXX_DIR_INGRESS, err = __mlxsw_sp_sb_prs_init(mlxsw_sp, MLXSW_REG_SBXX_DIR_INGRESS,
mlxsw_sp_sb_pools_ingress, mlxsw_sp_sb_prs_ingress,
MLXSW_SP_SB_POOLS_INGRESS_LEN); MLXSW_SP_SB_PRS_INGRESS_LEN);
if (err) if (err)
return err; return err;
return __mlxsw_sp_sb_pools_init(mlxsw_sp, MLXSW_REG_SBXX_DIR_EGRESS, return __mlxsw_sp_sb_prs_init(mlxsw_sp, MLXSW_REG_SBXX_DIR_EGRESS,
mlxsw_sp_sb_pools_egress, mlxsw_sp_sb_prs_egress,
MLXSW_SP_SB_POOLS_EGRESS_LEN); MLXSW_SP_SB_PRS_EGRESS_LEN);
} }
struct mlxsw_sp_sb_cm { struct mlxsw_sp_sb_cm {
...@@ -460,7 +460,7 @@ int mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp) ...@@ -460,7 +460,7 @@ int mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp)
{ {
int err; int err;
err = mlxsw_sp_sb_pools_init(mlxsw_sp); err = mlxsw_sp_sb_prs_init(mlxsw_sp);
if (err) if (err)
return err; return err;
err = mlxsw_sp_cpu_port_sb_cms_init(mlxsw_sp); err = mlxsw_sp_cpu_port_sb_cms_init(mlxsw_sp);
......
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