• Petr Machata's avatar
    mlxsw: spectrum_buffers: Manage internal buffer in the hdroom code · 22881adf
    Petr Machata authored
    Traffic mirroring modes that are in-chip implemented on egress need an
    internal buffer to work. As the only client, the SPAN module was managing
    the buffer so far. However logically it belongs to the buffers module. E.g.
    buffer size validation needs to take the size of the internal buffer into
    account.
    
    Therefore move the related code from SPAN to spectrum_buffers. Move over
    the callbacks that determine the minimum buffer size as a function of
    maximum speed and MTU. Add a field describing the internal buffer to struct
    mlxsw_sp_hdroom. Extend mlxsw_sp_hdroom_bufs_reset_sizes() to take care of
    sizing the internal buffer as well. Change the SPAN module to invoke that
    function and mlxsw_sp_hdroom_configure() like all the other hdroom clients.
    Drop the now-unnecessary mlxsw_sp_span_port_buffer_disable().
    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>
    22881adf
spectrum_span.h 3.4 KB