]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: drop the use of the "lags" array
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 5 Feb 2021 22:02:17 +0000 (00:02 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Feb 2021 22:51:50 +0000 (14:51 -0800)
commit48c304b24d61abc853c583a36ffef46ee12dd684
treea4c33d23a5ca222c094d86404dfe2dfbc3286cd0
parent5e7eb555dab8d6b51c820ba0345e18d3528ce768
net: mscc: ocelot: drop the use of the "lags" array

We can now simplify the implementation by always using ocelot_get_bond_mask
to look up the other ports that are offloading the same bonding interface
as us.

In ocelot_set_aggr_pgids, the code had a way to uniquely iterate through
LAGs. We need to achieve the same behavior by marking each LAG as visited,
which we do now by using a temporary 32-bit "visited" bitmask. This is
ok and we do not need dynamic memory allocation, because we know that
this switch architecture will not have more than 32 ports (the PGID port
masks are 32-bit anyway).

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot.c
include/soc/mscc/ocelot.h