mlxsw: spectrum_fid: Initialize flood profiles in CFF mode
authorPetr Machata <petrm@nvidia.com>
Tue, 28 Nov 2023 15:50:47 +0000 (16:50 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Nov 2023 04:03:25 +0000 (20:03 -0800)
commitd79b70dbb76001e51a287d0f7430009068e1e55e
tree036db7ede82c39e7c039217cd1463eb2d8398ef1
parentaf1e696fdf1e588ac0153cc8dff70b5a10a2e220
mlxsw: spectrum_fid: Initialize flood profiles in CFF mode

In CFF flood mode, the way flood vectors are looked up changes: there's a
per-FID PGT base, to which a small offset is added depending on type of
traffic. Thus each FID occupies a small contiguous block of PGT memory,
whereas in the controlled flood mode, flood vectors for a given FID were
spread across the PGT.

Each FID is associated with one of a handful of profiles. The profile and
the traffic type are then used as keys to look up the PGT offset. This
offset is then added to the per-FID PGT base. The profile / type / offset
mapping needs to be configured by the driver, and is only relevant in CFF
flood mode.

In this patch, add the SFFP initialization code. Only initialize the one
profile currently explicitly used. As follow-up patch add more profiles,
this code will pick them up and initialize as well.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/2c4733ed72d439444218969c032acad22cd4ed88.1701183892.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c