Commit c7c55067 authored by Thibaut Collet's avatar Thibaut Collet Committed by David S. Miller

bonding: fix 802.3ad support for 5G and 50G speeds

This patch adds [5|50] Gbps enum definition, and fixes
aggregated bandwidth calculation based on above slave links.

Fixes: c9a70d43 ("net-next: ethtool: Added port speed macros.")
Signed-off-by: default avatarThibaut Collet <thibaut.collet@6wind.com>
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: default avatarAndy Gospodarek <andy@greyhouse.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent daa6630a
...@@ -90,10 +90,12 @@ enum ad_link_speed_type { ...@@ -90,10 +90,12 @@ enum ad_link_speed_type {
AD_LINK_SPEED_100MBPS, AD_LINK_SPEED_100MBPS,
AD_LINK_SPEED_1000MBPS, AD_LINK_SPEED_1000MBPS,
AD_LINK_SPEED_2500MBPS, AD_LINK_SPEED_2500MBPS,
AD_LINK_SPEED_5000MBPS,
AD_LINK_SPEED_10000MBPS, AD_LINK_SPEED_10000MBPS,
AD_LINK_SPEED_20000MBPS, AD_LINK_SPEED_20000MBPS,
AD_LINK_SPEED_25000MBPS, AD_LINK_SPEED_25000MBPS,
AD_LINK_SPEED_40000MBPS, AD_LINK_SPEED_40000MBPS,
AD_LINK_SPEED_50000MBPS,
AD_LINK_SPEED_56000MBPS, AD_LINK_SPEED_56000MBPS,
AD_LINK_SPEED_100000MBPS, AD_LINK_SPEED_100000MBPS,
}; };
...@@ -259,10 +261,12 @@ static inline int __check_agg_selection_timer(struct port *port) ...@@ -259,10 +261,12 @@ static inline int __check_agg_selection_timer(struct port *port)
* %AD_LINK_SPEED_100MBPS, * %AD_LINK_SPEED_100MBPS,
* %AD_LINK_SPEED_1000MBPS, * %AD_LINK_SPEED_1000MBPS,
* %AD_LINK_SPEED_2500MBPS, * %AD_LINK_SPEED_2500MBPS,
* %AD_LINK_SPEED_5000MBPS,
* %AD_LINK_SPEED_10000MBPS * %AD_LINK_SPEED_10000MBPS
* %AD_LINK_SPEED_20000MBPS * %AD_LINK_SPEED_20000MBPS
* %AD_LINK_SPEED_25000MBPS * %AD_LINK_SPEED_25000MBPS
* %AD_LINK_SPEED_40000MBPS * %AD_LINK_SPEED_40000MBPS
* %AD_LINK_SPEED_50000MBPS
* %AD_LINK_SPEED_56000MBPS * %AD_LINK_SPEED_56000MBPS
* %AD_LINK_SPEED_100000MBPS * %AD_LINK_SPEED_100000MBPS
*/ */
...@@ -296,6 +300,10 @@ static u16 __get_link_speed(struct port *port) ...@@ -296,6 +300,10 @@ static u16 __get_link_speed(struct port *port)
speed = AD_LINK_SPEED_2500MBPS; speed = AD_LINK_SPEED_2500MBPS;
break; break;
case SPEED_5000:
speed = AD_LINK_SPEED_5000MBPS;
break;
case SPEED_10000: case SPEED_10000:
speed = AD_LINK_SPEED_10000MBPS; speed = AD_LINK_SPEED_10000MBPS;
break; break;
...@@ -312,6 +320,10 @@ static u16 __get_link_speed(struct port *port) ...@@ -312,6 +320,10 @@ static u16 __get_link_speed(struct port *port)
speed = AD_LINK_SPEED_40000MBPS; speed = AD_LINK_SPEED_40000MBPS;
break; break;
case SPEED_50000:
speed = AD_LINK_SPEED_50000MBPS;
break;
case SPEED_56000: case SPEED_56000:
speed = AD_LINK_SPEED_56000MBPS; speed = AD_LINK_SPEED_56000MBPS;
break; break;
...@@ -707,6 +719,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator) ...@@ -707,6 +719,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
case AD_LINK_SPEED_2500MBPS: case AD_LINK_SPEED_2500MBPS:
bandwidth = nports * 2500; bandwidth = nports * 2500;
break; break;
case AD_LINK_SPEED_5000MBPS:
bandwidth = nports * 5000;
break;
case AD_LINK_SPEED_10000MBPS: case AD_LINK_SPEED_10000MBPS:
bandwidth = nports * 10000; bandwidth = nports * 10000;
break; break;
...@@ -719,6 +734,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator) ...@@ -719,6 +734,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
case AD_LINK_SPEED_40000MBPS: case AD_LINK_SPEED_40000MBPS:
bandwidth = nports * 40000; bandwidth = nports * 40000;
break; break;
case AD_LINK_SPEED_50000MBPS:
bandwidth = nports * 50000;
break;
case AD_LINK_SPEED_56000MBPS: case AD_LINK_SPEED_56000MBPS:
bandwidth = nports * 56000; bandwidth = nports * 56000;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment