]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_fid: Make flood index calculation more robust
authorIdo Schimmel <idosch@mellanox.com>
Sun, 25 Nov 2018 09:43:55 +0000 (09:43 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Nov 2018 23:27:07 +0000 (15:27 -0800)
commit520c83f343497e4c37141ce7039603e7fe202862
treea5c058d8fcf3df96879458a95d1ea3396a010763
parent5f41c0c7df75ca420f6232e85fba5818b60d9215
mlxsw: spectrum_fid: Make flood index calculation more robust

802.1D FIDs use a per-FID flood table, where the flood index into the
table is calculated by subtracting 4K from the FID's index.

Currently, 802.1D FIDs start at 4K, so the calculation is correct, but
if it was ever to change, the calculation will no longer be correct.

In addition, this change will allow us to reuse the flood index
calculation function in the next patch, where we are going to emulate
802.1Q FIDs using 802.1D FIDs.

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