[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220221212337.2034956-3-vladimir.oltean@nxp.com>
Date: Mon, 21 Feb 2022 23:23:28 +0200
From: Vladimir Oltean <vladimir.oltean@....com>
To: netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Ansuel Smith <ansuelsmth@...il.com>,
Tobias Waldekranz <tobias@...dekranz.com>,
DENG Qingfang <dqfext@...il.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
UNGLinuxDriver@...rochip.com, Jiri Pirko <jiri@...nulli.us>,
Ivan Vecera <ivecera@...hat.com>
Subject: [PATCH v4 net-next 02/11] net: dsa: mv88e6xxx: rename references to "lag" as "lag_dev"
In preparation of converting struct net_device *dp->lag_dev into a
struct dsa_lag *dp->lag, we need to rename, for consistency purposes,
all occurrences of the "lag" variable in mv88e6xxx to "lag_dev".
Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
v1->v4: none
drivers/net/dsa/mv88e6xxx/chip.c | 49 ++++++++++++++++----------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 7d5e72cdc125..24da1aa56546 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -6168,7 +6168,7 @@ static int mv88e6xxx_port_bridge_flags(struct dsa_switch *ds, int port,
}
static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,
- struct net_device *lag,
+ struct net_device *lag_dev,
struct netdev_lag_upper_info *info)
{
struct mv88e6xxx_chip *chip = ds->priv;
@@ -6178,11 +6178,11 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,
if (!mv88e6xxx_has_lag(chip))
return false;
- id = dsa_lag_id(ds->dst, lag);
+ id = dsa_lag_id(ds->dst, lag_dev);
if (id < 0 || id >= ds->num_lag_ids)
return false;
- dsa_lag_foreach_port(dp, ds->dst, lag)
+ dsa_lag_foreach_port(dp, ds->dst, lag_dev)
/* Includes the port joining the LAG */
members++;
@@ -6202,20 +6202,21 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,
return true;
}
-static int mv88e6xxx_lag_sync_map(struct dsa_switch *ds, struct net_device *lag)
+static int mv88e6xxx_lag_sync_map(struct dsa_switch *ds,
+ struct net_device *lag_dev)
{
struct mv88e6xxx_chip *chip = ds->priv;
struct dsa_port *dp;
u16 map = 0;
int id;
- id = dsa_lag_id(ds->dst, lag);
+ id = dsa_lag_id(ds->dst, lag_dev);
/* Build the map of all ports to distribute flows destined for
* this LAG. This can be either a local user port, or a DSA
* port if the LAG port is on a remote chip.
*/
- dsa_lag_foreach_port(dp, ds->dst, lag)
+ dsa_lag_foreach_port(dp, ds->dst, lag_dev)
map |= BIT(dsa_towards_port(ds, dp->ds->index, dp->index));
return mv88e6xxx_g2_trunk_mapping_write(chip, id, map);
@@ -6259,8 +6260,8 @@ static void mv88e6xxx_lag_set_port_mask(u16 *mask, int port,
static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
{
struct mv88e6xxx_chip *chip = ds->priv;
+ struct net_device *lag_dev;
unsigned int id, num_tx;
- struct net_device *lag;
struct dsa_port *dp;
int i, err, nth;
u16 mask[8];
@@ -6284,12 +6285,12 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
* are in the Tx set.
*/
dsa_lags_foreach_id(id, ds->dst) {
- lag = dsa_lag_dev(ds->dst, id);
- if (!lag)
+ lag_dev = dsa_lag_dev(ds->dst, id);
+ if (!lag_dev)
continue;
num_tx = 0;
- dsa_lag_foreach_port(dp, ds->dst, lag) {
+ dsa_lag_foreach_port(dp, ds->dst, lag_dev) {
if (dp->lag_tx_enabled)
num_tx++;
}
@@ -6298,7 +6299,7 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
continue;
nth = 0;
- dsa_lag_foreach_port(dp, ds->dst, lag) {
+ dsa_lag_foreach_port(dp, ds->dst, lag_dev) {
if (!dp->lag_tx_enabled)
continue;
@@ -6320,14 +6321,14 @@ static int mv88e6xxx_lag_sync_masks(struct dsa_switch *ds)
}
static int mv88e6xxx_lag_sync_masks_map(struct dsa_switch *ds,
- struct net_device *lag)
+ struct net_device *lag_dev)
{
int err;
err = mv88e6xxx_lag_sync_masks(ds);
if (!err)
- err = mv88e6xxx_lag_sync_map(ds, lag);
+ err = mv88e6xxx_lag_sync_map(ds, lag_dev);
return err;
}
@@ -6344,16 +6345,16 @@ static int mv88e6xxx_port_lag_change(struct dsa_switch *ds, int port)
}
static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,
- struct net_device *lag,
+ struct net_device *lag_dev,
struct netdev_lag_upper_info *info)
{
struct mv88e6xxx_chip *chip = ds->priv;
int err, id;
- if (!mv88e6xxx_lag_can_offload(ds, lag, info))
+ if (!mv88e6xxx_lag_can_offload(ds, lag_dev, info))
return -EOPNOTSUPP;
- id = dsa_lag_id(ds->dst, lag);
+ id = dsa_lag_id(ds->dst, lag_dev);
mv88e6xxx_reg_lock(chip);
@@ -6361,7 +6362,7 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,
if (err)
goto err_unlock;
- err = mv88e6xxx_lag_sync_masks_map(ds, lag);
+ err = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
if (err)
goto err_clear_trunk;
@@ -6376,13 +6377,13 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,
}
static int mv88e6xxx_port_lag_leave(struct dsa_switch *ds, int port,
- struct net_device *lag)
+ struct net_device *lag_dev)
{
struct mv88e6xxx_chip *chip = ds->priv;
int err_sync, err_trunk;
mv88e6xxx_reg_lock(chip);
- err_sync = mv88e6xxx_lag_sync_masks_map(ds, lag);
+ err_sync = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
err_trunk = mv88e6xxx_port_set_trunk(chip, port, false, 0);
mv88e6xxx_reg_unlock(chip);
return err_sync ? : err_trunk;
@@ -6401,18 +6402,18 @@ static int mv88e6xxx_crosschip_lag_change(struct dsa_switch *ds, int sw_index,
}
static int mv88e6xxx_crosschip_lag_join(struct dsa_switch *ds, int sw_index,
- int port, struct net_device *lag,
+ int port, struct net_device *lag_dev,
struct netdev_lag_upper_info *info)
{
struct mv88e6xxx_chip *chip = ds->priv;
int err;
- if (!mv88e6xxx_lag_can_offload(ds, lag, info))
+ if (!mv88e6xxx_lag_can_offload(ds, lag_dev, info))
return -EOPNOTSUPP;
mv88e6xxx_reg_lock(chip);
- err = mv88e6xxx_lag_sync_masks_map(ds, lag);
+ err = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
if (err)
goto unlock;
@@ -6424,13 +6425,13 @@ static int mv88e6xxx_crosschip_lag_join(struct dsa_switch *ds, int sw_index,
}
static int mv88e6xxx_crosschip_lag_leave(struct dsa_switch *ds, int sw_index,
- int port, struct net_device *lag)
+ int port, struct net_device *lag_dev)
{
struct mv88e6xxx_chip *chip = ds->priv;
int err_sync, err_pvt;
mv88e6xxx_reg_lock(chip);
- err_sync = mv88e6xxx_lag_sync_masks_map(ds, lag);
+ err_sync = mv88e6xxx_lag_sync_masks_map(ds, lag_dev);
err_pvt = mv88e6xxx_pvt_map(chip, sw_index, port);
mv88e6xxx_reg_unlock(chip);
return err_sync ? : err_pvt;
--
2.25.1
Powered by blists - more mailing lists