Skip to content

Commit

Permalink
bonding: 3ad: add support for 400G speed
Browse files Browse the repository at this point in the history
In order to be able to use 3ad mode with 400G devices we need to extend
the supported speeds.

Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Feb 11, 2021
1 parent ab73447 commit 138e3b3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/net/bonding/bond_3ad.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ enum ad_link_speed_type {
AD_LINK_SPEED_56000MBPS,
AD_LINK_SPEED_100000MBPS,
AD_LINK_SPEED_200000MBPS,
AD_LINK_SPEED_400000MBPS,
};

/* compare MAC addresses */
Expand Down Expand Up @@ -247,6 +248,7 @@ static inline int __check_agg_selection_timer(struct port *port)
* %AD_LINK_SPEED_56000MBPS
* %AD_LINK_SPEED_100000MBPS
* %AD_LINK_SPEED_200000MBPS
* %AD_LINK_SPEED_400000MBPS
*/
static u16 __get_link_speed(struct port *port)
{
Expand Down Expand Up @@ -318,6 +320,10 @@ static u16 __get_link_speed(struct port *port)
speed = AD_LINK_SPEED_200000MBPS;
break;

case SPEED_400000:
speed = AD_LINK_SPEED_400000MBPS;
break;

default:
/* unknown speed value from ethtool. shouldn't happen */
if (slave->speed != SPEED_UNKNOWN)
Expand Down Expand Up @@ -742,6 +748,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
case AD_LINK_SPEED_200000MBPS:
bandwidth = nports * 200000;
break;
case AD_LINK_SPEED_400000MBPS:
bandwidth = nports * 400000;
break;
default:
bandwidth = 0; /* to silence the compiler */
}
Expand Down

0 comments on commit 138e3b3

Please sign in to comment.