• Petr Machata's avatar
    mlxsw: spectrum_ethtool: Introduce ptys_max_speed callback · 60fbc521
    Petr Machata authored
    The SBIB register configures the size of an internal buffer that the
    Spectrum ASICs use when mirroring traffic on egress. This size should be
    taken into account when validating that the port headroom buffers are not
    larger than the chip can handle. Up until now this was not done, which is
    incidentally not a problem, because the priority group buffers that mlxsw
    auto-configures are small enough that the boundary condition could not be
    violated.
    
    When dcbnl_setbuffer is implemented, the user gets control over sizes of PG
    buffers, and they might overshoot the headroom capacity. However the size
    of the SBIB buffer depends on port speed, which cannot be vetoed. There is
    obviously no way to retroactively push back on requests for overlarge PG
    buffers, or reject an overlarge MTU, or cancel losslessness of a certain
    PG.
    
    Therefore, instead of taking into account the current speed when
    calculating SBIB buffer size, take into account the maximum speed that a
    port with given Ethernet protocol capabilities can have.
    
    To that end, add a new ethtool callback, ptys_max_speed, which determines
    this maximum speed.
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    60fbc521
spectrum_ethtool.c 48.6 KB