]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mlxsw: spectrum: Add lowest_shaper_bs to struct mlxsw_sp
authorPetr Machata <petrm@mellanox.com>
Fri, 24 Jan 2020 13:23:12 +0000 (15:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 25 Jan 2020 09:56:31 +0000 (10:56 +0100)
Lower limit of burst size configuration is dependent on system type. Add a
datum to track the value. Initialize as appropriate in mlxsw_spX_init().

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h

index 9eb3ac7669f7d2560be611daf4dcca4359bd8a0e..72d24595df7a0a0572b42c403f12275e460ac18a 100644 (file)
@@ -5173,6 +5173,7 @@ static int mlxsw_sp1_init(struct mlxsw_core *mlxsw_core,
        mlxsw_sp->span_ops = &mlxsw_sp1_span_ops;
        mlxsw_sp->listeners = mlxsw_sp1_listener;
        mlxsw_sp->listeners_count = ARRAY_SIZE(mlxsw_sp1_listener);
+       mlxsw_sp->lowest_shaper_bs = MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP1;
 
        return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack);
 }
@@ -5197,6 +5198,7 @@ static int mlxsw_sp2_init(struct mlxsw_core *mlxsw_core,
        mlxsw_sp->port_type_speed_ops = &mlxsw_sp2_port_type_speed_ops;
        mlxsw_sp->ptp_ops = &mlxsw_sp2_ptp_ops;
        mlxsw_sp->span_ops = &mlxsw_sp2_span_ops;
+       mlxsw_sp->lowest_shaper_bs = MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP2;
 
        return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack);
 }
@@ -5219,6 +5221,7 @@ static int mlxsw_sp3_init(struct mlxsw_core *mlxsw_core,
        mlxsw_sp->port_type_speed_ops = &mlxsw_sp2_port_type_speed_ops;
        mlxsw_sp->ptp_ops = &mlxsw_sp2_ptp_ops;
        mlxsw_sp->span_ops = &mlxsw_sp2_span_ops;
+       mlxsw_sp->lowest_shaper_bs = MLXSW_REG_QEEC_LOWEST_SHAPER_BS_SP3;
 
        return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack);
 }
index 5f3b74360dc88b26febde93cafd11e9bb2cfc13f..bbc23939964e1eeb19ceccc7689da11cf7065973 100644 (file)
@@ -189,6 +189,7 @@ struct mlxsw_sp {
        const struct mlxsw_sp_span_ops *span_ops;
        const struct mlxsw_listener *listeners;
        size_t listeners_count;
+       u32 lowest_shaper_bs;
 };
 
 static inline struct mlxsw_sp_upper *