OSDN Git Service

mlxsw: spectrum_span: Derive SBIB from maximum port speed & MTU
authorPetr Machata <petrm@nvidia.com>
Sun, 13 Sep 2020 15:46:09 +0000 (18:46 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Sep 2020 21:37:30 +0000 (14:37 -0700)
commit532b49e41e6450f0f7eec2ac9cffb59b689bac25
treef769c45415252af111b677c647a4421f6dc98a38
parent3232e8c66e72585073fb01fefc92f9d5b0e71e0c
mlxsw: spectrum_span: Derive SBIB from maximum port speed & MTU

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.

However when dcbnl_setbuffer is implemented, the user has control over
sizes of PG buffers, and they might overshoot the headroom capacity.
However the size of the SBIB buffer depends on port speed, and that cannot
be vetoed. Therefore SBIB size should be deduced from maximum port speed.

Additionally, once the buffers are configured by hand, the user could get
into an uncomfortable situation where their MTU change requests get vetoed,
because the SBIB does not fit anymore. Therefore derive SBIB size from
maximum permissible MTU as well.

Remove all the code that adjusted the SBIB size whenever speed or MTU
changed.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c