--- zzzz-none-000/linux-4.19.183/drivers/net/bonding/bond_options.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/drivers/net/bonding/bond_options.c 2023-06-28 08:54:19.000000000 +0000 @@ -78,6 +78,10 @@ const struct bond_opt_value *newval); static int bond_option_ad_user_port_key_set(struct bonding *bond, const struct bond_opt_value *newval); +#if defined(CONFIG_BCM_KF_KBONDING) && defined(CONFIG_BCM_KERNEL_BONDING) +static int bond_option_async_linkspeed_set(struct bonding *bond, + const struct bond_opt_value *newval); +#endif /* defined(CONFIG_BCM_KF_KBONDING) && defined(CONFIG_BCM_KERNEL_BONDING) */ static const struct bond_opt_value bond_mode_tbl[] = { @@ -206,6 +210,14 @@ { NULL, -1, 0}, }; +#if defined(CONFIG_BCM_KF_KBONDING) && defined(CONFIG_BCM_KERNEL_BONDING) +static const struct bond_opt_value bond_async_linkspeed_tbl[] = { + { "off", BOND_ASYNC_LINKSPEED_OFF, BOND_VALFLAG_DEFAULT}, + { "on", BOND_ASYNC_LINKSPEED_ON, 0}, + { NULL, -1, 0}, +}; +#endif /* defined(CONFIG_BCM_KF_KBONDING) && defined(CONFIG_BCM_KERNEL_BONDING) */ + static const struct bond_option bond_opts[BOND_OPT_LAST] = { [BOND_OPT_MODE] = { .id = BOND_OPT_MODE, @@ -428,6 +440,16 @@ .desc = "Number of peer notifications to send on failover event", .values = bond_num_peer_notif_tbl, .set = bond_option_num_peer_notif_set +#if defined(CONFIG_BCM_KF_KBONDING) && defined(CONFIG_BCM_KERNEL_BONDING) + }, + [BOND_OPT_ASYNC_LINKSPEED] = { + .id = BOND_OPT_ASYNC_LINKSPEED, + .name = "async_linkspeed", + .desc = "Enable Aggregation of links of different data rates is not prohibited nor required by 802.1ax.", + .unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)), + .values = bond_async_linkspeed_tbl, + .set = bond_option_async_linkspeed_set +#endif /* defined(CONFIG_BCM_KF_KBONDING) && defined(CONFIG_BCM_KERNEL_BONDING) */ } }; @@ -1462,3 +1484,15 @@ bond->params.ad_user_port_key = newval->value; return 0; } + +#if defined(CONFIG_BCM_KF_KBONDING) && defined(CONFIG_BCM_KERNEL_BONDING) +static int bond_option_async_linkspeed_set(struct bonding *bond, + const struct bond_opt_value *newval) +{ + netdev_info(bond->dev, "Setting ad_select to %s (%llu)\n", + newval->string, newval->value); + bond->params.async_linkspeed = newval->value; + + return 0; +} +#endif /* defined(CONFIG_BCM_KF_KBONDING) && defined(CONFIG_BCM_KERNEL_BONDING) */