]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_router: Consolidate MAC profiles when possible
authorDanielle Ratson <danieller@nvidia.com>
Tue, 14 Dec 2021 10:21:36 +0000 (12:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Dec 2021 12:56:10 +0000 (12:56 +0000)
commit8da06901f7798b259c61a3385b621ee50a8c313f
tree620876bf7bdfa1b5d95e576d9a34717019cdccb1
parent85f55cacb78ac7ba2572adc53a7aadd86d971b7e
mlxsw: spectrum_router: Consolidate MAC profiles when possible

Currently, when setting a router interface (RIF) MAC address while the
MAC profile is not shared with other RIFs, the profile is edited so that
the new MAC address is assigned to it.

This does not take into account a situation in which the new MAC address
already matches an existing MAC profile. In that situation, two MAC
profiles will be occupied even though they hold MAC addresses from the
same profile.

In order to prevent that, add a check to ensure that editing a MAC
profile takes place only when the new MAC address does not match an
existing profile.

Fixes: 9bba70d9958b6 ("mlxsw: spectrum_router: Add RIF MAC profiles support")
Reported-by: Maksym Yaremchuk <maksymy@nvidia.com>
Tested-by: Maksym Yaremchuk <maksymy@nvidia.com>
Signed-off-by: Danielle Ratson <danieller@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_router.c