• Petr Machata's avatar
    mlxsw: spectrum_buffers: Convert mlxsw_sp_port_headroom_init() · 0cda1a9b
    Petr Machata authored
    Currently mlxsw_sp_port_headroom_init() configures both priomap and buffers
    by hand. Additionally, for port buffers, it configures buffer 0 with a size
    that it will never again have if PFC configuration is touched.
    
    Rewrite the init code to become a client of the new hdroom code. The only
    difference in invocation is that the configuration is forced, so that it is
    issued even if the desired configuration happens to match what is contained
    in (hitherto not initialized with meaningful values) mlxsw_sp_port->hdroom.
    
    Since now mlxsw_sp_port_headroom_init() initializes all the PG buffers to
    meaningful values, mlxsw_sp_hdroom_configure_buffers() can avoid querying
    the current configuration, and can fill the whole PBMC itself.
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0cda1a9b
spectrum_buffers.c 46.4 KB