Skip to contentSkip to conversation

bonding: update port speed when getting bond speed

PATCH Applied Hangbin Liu 3 participants 3 messages Aug 21, 2023 – Aug 22, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bonding: update port speed when getting bond speed

Andrew reported a bonding issue that if we put an active-back bond on top of a 802.3ad bond interface. When the 802.3ad bond's speed/duplex changed dynamically. The upper bonding interface's speed/duplex can't be changed at the same time, which will show incorrect speed.

Fix it by updating the port speed when calling ethtool.

---
 drivers/net/bonding/bond_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/bonding/bond_main.c +1 -0
index 447b06ea4fc9..07c2e46d27a8 100644
@@ -5706,6 +5706,7 @@ static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
 	 */
 	bond_for_each_slave(bond, slave, iter) {
 		if (bond_slave_can_tx(slave)) {
+			bond_update_speed_duplex(slave);
 			if (slave->speed != SPEED_UNKNOWN) {
 				if (BOND_MODE(bond) == BOND_MODE_BROADCAST)
 					speed = bond_mode_bcast_speed(slave,
Signature · 1 line
2.41.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Hangbin Liu

Andrew reported a bonding issue that if we put an active-back bond on top of a 802.3ad bond interface. When the 802.3ad bond's speed/duplex changed dynamically. The upper bonding interface's speed/duplex can't be changed at the same time, which will show incorrect speed.

Fix it by updating the port speed when calling ethtool.

Quoted 20 lines

---
drivers/net/bonding/bond_main.c | 1 +

1 file changed, 1 insertion(+)
drivers/net/bonding/bond_main.c +1 -0
index 447b06ea4fc9..07c2e46d27a8 100644
@@ -5706,6 +5706,7 @@ static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
 	 */
 	bond_for_each_slave(bond, slave, iter) {
 		if (bond_slave_can_tx(slave)) {
+			bond_update_speed_duplex(slave);
 			if (slave->speed != SPEED_UNKNOWN) {
 				if (BOND_MODE(bond) == BOND_MODE_BROADCAST)
 					speed = bond_mode_bcast_speed(slave,
Signature · 1 line
2.41.0
#2 lore raw
In reply to Hangbin Liu
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Mon, 21 Aug 2023 18:10:08 +0800 you wrote:

Andrew reported a bonding issue that if we put an active-back bond on top of a 802.3ad bond interface. When the 802.3ad bond's speed/duplex changed dynamically. The upper bonding interface's speed/duplex can't be changed at the same time, which will show incorrect speed.

Fix it by updating the port speed when calling ethtool.

[...]

Here is the summary with links:
- [net-next] bonding: update port speed when getting bond speed

    https://git.kernel.org/netdev/net-next/c/691b2bf14946

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html