• Petr Machata's avatar
    mlxsw: spectrum: Track lossiness in struct mlxsw_sp_hdroom · ca21e84e
    Petr Machata authored
    Client-side configuration has lossiness as an attribute of a priority.
    Therefore add a "lossy" attribute to struct mlxsw_sp_hdroom_prio.
    
    To a Spectrum ASIC, lossiness is a feature of a port buffer. Therefore add
    struct mlxsw_sp_hdroom_buf, which in the following patches will get more
    attributes, but right now only use it to track port buffer lossiness.
    
    Instead of passing around the primary indicators of PFC and pause_en, add a
    function mlxsw_sp_hdroom_bufs_reset_lossiness() to compute the buffer
    lossiness from the priority map and priority lossiness. Change
    mlxsw_sp_port_headroom_set() to take the buffer lossy flag from the
    headroom configuration. Have the PFC and pause handlers configure priority
    lossiness in mlxsw_sp_hdroom, from where it will propagate.
    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>
    ca21e84e
spectrum_buffers.c 41.3 KB