• Petr Machata's avatar
    mlxsw: spectrum_buffers: Allow configuration of static pools · 5be3637e
    Petr Machata authored
    Some pools configured through the sb_pm entries may have by default
    static size. The MC pool is now not explicitly configured, however it
    gets configured as static implicitly by 0-initializing sb->prs, and a
    follow-up patch adds an explicit configuration to the same effect.
    
    To support this, pass max_buff taken from sb_pm and sb_cm entries
    through cell conversion before handing it to mlxsw_sp_sb_pm_write(), if
    the pool that the sb_pm entry configures is statically-sized.
    
    To keep current behavior, update mlxsw_sp_sb_cms_egress[] to denote
    buffer sizes in bytes (assuming Spectrum 1 cell sizes, which the
    original code assumed as well) instead of cells. Note that a follow-up
    patch changes this to infinite size.
    
    Also tweak a comment at SBMM configuration to remain true now that
    statically-sized pools exist.
    Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
    Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5be3637e
spectrum_buffers.c 28.8 KB