diff mbox series

[net-next] bonding: update port speed when getting bond speed

Message ID 20230821101008.797482-1-liuhangbin@gmail.com (mailing list archive)
State Accepted
Commit 691b2bf1494620ff8c292626e4967c57e5705a8b
Delegated to: Netdev Maintainers
Headers show
Series [net-next] bonding: update port speed when getting bond speed | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1330 this patch: 1330
netdev/cc_maintainers warning 1 maintainers not CCed: andy@greyhouse.net
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1353 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Hangbin Liu Aug. 21, 2023, 10:10 a.m. UTC
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(+)

Comments

Jay Vosburgh Aug. 21, 2023, 10:57 p.m. UTC | #1
Hangbin Liu <liuhangbin@gmail.com> 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.
>
>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>


>---
> 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
>
>
patchwork-bot+netdevbpf@kernel.org Aug. 22, 2023, 1:30 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

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!
diff mbox series

Patch

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,