]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dsa: felix: bring the NPI port indirection for host flooding to surface
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 11 May 2022 09:50:15 +0000 (12:50 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 May 2022 23:38:54 +0000 (16:38 -0700)
For symmetry with host FDBs and MDBs where the indirection is now
handled outside the ocelot switch lib, do the same for bridge port
flags (unicast/multicast/broadcast flooding).

The only caller of the ocelot switch lib which uses the NPI port is the
Felix DSA driver.

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

index f8a587ae9c6baa05d3a862a47880ed8759a89764..59221d838a45d347eb551df397543c00fd3c542e 100644 (file)
@@ -794,6 +794,9 @@ static int felix_bridge_flags(struct dsa_switch *ds, int port,
 {
        struct ocelot *ocelot = ds->priv;
 
+       if (port == ocelot->npi)
+               port = ocelot->num_phys_ports;
+
        ocelot_port_bridge_flags(ocelot, port, val);
 
        return 0;
index 29e8011e4a91f105e5e6ffa7d0996453ebae28eb..e0d1d5b59981e295a7d8fcc6127e9bf9e293144c 100644 (file)
@@ -2943,9 +2943,6 @@ EXPORT_SYMBOL(ocelot_port_pre_bridge_flags);
 void ocelot_port_bridge_flags(struct ocelot *ocelot, int port,
                              struct switchdev_brport_flags flags)
 {
-       if (port == ocelot->npi)
-               port = ocelot->num_phys_ports;
-
        if (flags.mask & BR_LEARNING)
                ocelot_port_set_learning(ocelot, port,
                                         !!(flags.val & BR_LEARNING));