public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail•com>
To: netdev@vger•kernel.org
Cc: Jay Vosburgh <j.vosburgh@gmail•com>,
	"David S . Miller" <davem@davemloft•net>,
	Jakub Kicinski <kuba@kernel•org>, Paolo Abeni <pabeni@redhat•com>,
	Eric Dumazet <edumazet@google•com>, Liang Li <liali@redhat•com>,
	Jiri Pirko <jiri@nvidia•com>,
	Nikolay Aleksandrov <razor@blackwall•org>,
	Hangbin Liu <liuhangbin@gmail•com>,
	Andrew Schorr <ajschorr@alumni•princeton.edu>
Subject: [PATCH net-next] bonding: update port speed when getting bond speed
Date: Mon, 21 Aug 2023 18:10:08 +0800	[thread overview]
Message-ID: <20230821101008.797482-1-liuhangbin@gmail.com> (raw)

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>
---
 drivers/net/bonding/bond_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 447b06ea4fc9..07c2e46d27a8 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -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,
-- 
2.41.0


             reply	other threads:[~2023-08-21 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-21 10:10 Hangbin Liu [this message]
2023-08-21 22:57 ` [PATCH net-next] bonding: update port speed when getting bond speed Jay Vosburgh
2023-08-22 13:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230821101008.797482-1-liuhangbin@gmail.com \
    --to=liuhangbin@gmail$(echo .)com \
    --cc=ajschorr@alumni$(echo .)princeton.edu \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=j.vosburgh@gmail$(echo .)com \
    --cc=jiri@nvidia$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=liali@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=razor@blackwall$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox