diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-05-05 19:22:10 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-05-07 07:00:11 +0300 |
commit | 2c110abc46168c3a8cc9f855c986a55650c777dd (patch) | |
tree | c71e50c8373d6aa45d4243ae77888c7299a3d4cd /drivers/net/dsa | |
parent | 0a02e282bad4dad455553fc2b9268cf1d003f132 (diff) | |
download | linux-2c110abc46168c3a8cc9f855c986a55650c777dd.tar.xz |
net: dsa: felix: use PGID_CPU for FDB entry migration on NPI port
ocelot_fdb_add() redirects FDB entries installed on the NPI port towards
the special reserved PGID_CPU used for host-filtered addresses. PGID_CPU
contains BIT(ocelot->num_phys_ports) in the destination port mask, which
is code name for the CPU port module.
Whereas felix_migrate_fdbs_to_*_port() uses the ocelot->num_phys_ports
PGID directly, and it appears that this works too. Even if this PGID is
set to zero, apparently its number is special and packets still reach
the CPU port module.
Nonetheless, in the end, these addresses end up in the same place
regardless of whether they go through an extra indirection layer or not.
Use PGID_CPU across to have more uniformity.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r-- | drivers/net/dsa/ocelot/felix.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 33cb124ca912..8abe48ae8c3a 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -49,14 +49,13 @@ static int felix_migrate_fdbs_to_npi_port(struct dsa_switch *ds, int port, { struct net_device *bridge_dev = felix_classify_db(db); struct ocelot *ocelot = ds->priv; - int cpu = ocelot->num_phys_ports; int err; err = ocelot_fdb_del(ocelot, port, addr, vid, bridge_dev); if (err) return err; - return ocelot_fdb_add(ocelot, cpu, addr, vid, bridge_dev); + return ocelot_fdb_add(ocelot, PGID_CPU, addr, vid, bridge_dev); } static int felix_migrate_mdbs_to_npi_port(struct dsa_switch *ds, int port, @@ -128,10 +127,9 @@ felix_migrate_fdbs_to_tag_8021q_port(struct dsa_switch *ds, int port, { struct net_device *bridge_dev = felix_classify_db(db); struct ocelot *ocelot = ds->priv; - int cpu = ocelot->num_phys_ports; int err; - err = ocelot_fdb_del(ocelot, cpu, addr, vid, bridge_dev); + err = ocelot_fdb_del(ocelot, PGID_CPU, addr, vid, bridge_dev); if (err) return err; |