]> git.itanic.dy.fi Git - linux-stable/commitdiff
bonding: update port speed when getting bond speed
authorHangbin Liu <liuhangbin@gmail.com>
Mon, 21 Aug 2023 10:10:08 +0000 (18:10 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 22 Aug 2023 13:10:35 +0000 (15:10 +0200)
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.

Reported-by: Andrew Schorr <ajschorr@alumni.princeton.edu>
Closes: https://lore.kernel.org/netdev/ZEt3hvyREPVdbesO@Laptop-X1/
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Link: https://lore.kernel.org/r/20230821101008.797482-1-liuhangbin@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/bonding/bond_main.c

index f398bec784574d7bdac49f5a6335394dc3d17945..ed7212e61c541b20b4f07d98faa76b6e2ebc300e 100644 (file)
@@ -5718,6 +5718,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,