bonding: warn user when 802.3ad speed is unknown
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Fri, 9 Jun 2017 15:58:08 +0000 (17:58 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Jun 2017 20:06:49 +0000 (16:06 -0400)
Goal is to advertise the user when ethtool speeds and 802.3ad speeds are
desynchronized.
When this case happens, the kernel needs to be patched.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bonding/bond_3ad.c

index b44a6aeb346d0404144dde0304a502268de1da91..165a8009c640100c45d5022575bedb0c88af1a04 100644 (file)
@@ -322,6 +322,11 @@ static u16 __get_link_speed(struct port *port)
 
                default:
                        /* unknown speed value from ethtool. shouldn't happen */
+                       if (slave->speed != SPEED_UNKNOWN)
+                               pr_warn_once("%s: unknown ethtool speed (%d) for port %d (set it to 0)\n",
+                                            slave->bond->dev->name,
+                                            slave->speed,
+                                            port->actor_port_number);
                        speed = 0;
                        break;
                }