mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
Merge branch 'net-dsa-mv88e6xxx-lag-fixes'
Tobias Waldekranz says: ==================== net: dsa: mv88e6xxx: LAG fixes The kernel test robot kindly pointed out that Global 2 support in mv88e6xxx is optional. This also made me realize that we should verify that the hardware actually supports LAG offloading before trying to configure it. ==================== Link: https://lore.kernel.org/r/20210115125259.22542-1-tobias@waldekranz.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
7c140b05a1
3 changed files with 22 additions and 1 deletions
|
@ -5385,9 +5385,13 @@ static bool mv88e6xxx_lag_can_offload(struct dsa_switch *ds,
|
||||||
struct net_device *lag,
|
struct net_device *lag,
|
||||||
struct netdev_lag_upper_info *info)
|
struct netdev_lag_upper_info *info)
|
||||||
{
|
{
|
||||||
|
struct mv88e6xxx_chip *chip = ds->priv;
|
||||||
struct dsa_port *dp;
|
struct dsa_port *dp;
|
||||||
int id, members = 0;
|
int id, members = 0;
|
||||||
|
|
||||||
|
if (!mv88e6xxx_has_lag(chip))
|
||||||
|
return false;
|
||||||
|
|
||||||
id = dsa_lag_id(ds->dst, lag);
|
id = dsa_lag_id(ds->dst, lag);
|
||||||
if (id < 0 || id >= ds->num_lag_ids)
|
if (id < 0 || id >= ds->num_lag_ids)
|
||||||
return false;
|
return false;
|
||||||
|
@ -5727,7 +5731,7 @@ static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
|
||||||
* 5-bit port mode, which we do not support. 640k^W16 ought to
|
* 5-bit port mode, which we do not support. 640k^W16 ought to
|
||||||
* be enough for anyone.
|
* be enough for anyone.
|
||||||
*/
|
*/
|
||||||
ds->num_lag_ids = 16;
|
ds->num_lag_ids = mv88e6xxx_has_lag(chip) ? 16 : 0;
|
||||||
|
|
||||||
dev_set_drvdata(dev, ds);
|
dev_set_drvdata(dev, ds);
|
||||||
|
|
||||||
|
|
|
@ -662,6 +662,11 @@ static inline bool mv88e6xxx_has_pvt(struct mv88e6xxx_chip *chip)
|
||||||
return chip->info->pvt;
|
return chip->info->pvt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool mv88e6xxx_has_lag(struct mv88e6xxx_chip *chip)
|
||||||
|
{
|
||||||
|
return !!chip->info->global2_addr;
|
||||||
|
}
|
||||||
|
|
||||||
static inline unsigned int mv88e6xxx_num_databases(struct mv88e6xxx_chip *chip)
|
static inline unsigned int mv88e6xxx_num_databases(struct mv88e6xxx_chip *chip)
|
||||||
{
|
{
|
||||||
return chip->info->num_databases;
|
return chip->info->num_databases;
|
||||||
|
|
|
@ -525,6 +525,18 @@ static inline int mv88e6xxx_g2_trunk_clear(struct mv88e6xxx_chip *chip)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int mv88e6xxx_g2_trunk_mask_write(struct mv88e6xxx_chip *chip,
|
||||||
|
int num, bool hash, u16 mask)
|
||||||
|
{
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int mv88e6xxx_g2_trunk_mapping_write(struct mv88e6xxx_chip *chip,
|
||||||
|
int id, u16 map)
|
||||||
|
{
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int mv88e6xxx_g2_device_mapping_write(struct mv88e6xxx_chip *chip,
|
static inline int mv88e6xxx_g2_device_mapping_write(struct mv88e6xxx_chip *chip,
|
||||||
int target, int port)
|
int target, int port)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue