[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210116005943.219479-9-olteanv@gmail.com>
Date: Sat, 16 Jan 2021 02:59:37 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: "David S . Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: netdev <netdev@...r.kernel.org>,
Microchip Linux Driver Support <UNGLinuxDriver@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Tobias Waldekranz <tobias@...dekranz.com>,
Maxim Kochetkov <fido_max@...ox.ru>
Subject: [PATCH v2 net-next 08/14] net: mscc: ocelot: use "lag" variable name in ocelot_bridge_stp_state_set
From: Vladimir Oltean <vladimir.oltean@....com>
In anticipation of further simplification, make it more clear what we're
iterating over.
Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
---
Changes in v2:
None.
drivers/net/ethernet/mscc/ocelot.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index ce52bf892f9b..915cf81f602a 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -897,7 +897,7 @@ static u32 ocelot_get_bond_mask(struct ocelot *ocelot, struct net_device *bond)
void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state)
{
u32 port_cfg;
- int p, i;
+ int p;
if (!(BIT(port) & ocelot->bridge_mask))
return;
@@ -921,14 +921,17 @@ void ocelot_bridge_stp_state_set(struct ocelot *ocelot, int port, u8 state)
ocelot_write_gix(ocelot, port_cfg, ANA_PORT_PORT_CFG, port);
/* Apply FWD mask. The loop is needed to add/remove the current port as
- * a source for the other ports.
+ * a source for the other ports. If the source port is in a bond, then
+ * all the other ports from that bond need to be removed from this
+ * source port's forwarding mask.
*/
for (p = 0; p < ocelot->num_phys_ports; p++) {
if (ocelot->bridge_fwd_mask & BIT(p)) {
unsigned long mask = ocelot->bridge_fwd_mask & ~BIT(p);
+ int lag;
- for (i = 0; i < ocelot->num_phys_ports; i++) {
- unsigned long bond_mask = ocelot->lags[i];
+ for (lag = 0; lag < ocelot->num_phys_ports; lag++) {
+ unsigned long bond_mask = ocelot->lags[lag];
if (!bond_mask)
continue;
--
2.25.1
Powered by blists - more mailing lists