Commit 424c3232 authored by Jianhua Xie's avatar Jianhua Xie Committed by David S. Miller

bonding: Introduce 4 AD link speed to fix agg_bandwidth

This patch adds [2.5|20|40|56] Gbps enum definition, and fixes
aggregated bandwidth calculation based on above slave links.

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: David S. Miller <davem@davemloft.net>
Signed-off-by: default avatarJianhua Xie <jianhua.xie@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cb8dda90
...@@ -88,7 +88,11 @@ enum ad_link_speed_type { ...@@ -88,7 +88,11 @@ enum ad_link_speed_type {
AD_LINK_SPEED_10MBPS, AD_LINK_SPEED_10MBPS,
AD_LINK_SPEED_100MBPS, AD_LINK_SPEED_100MBPS,
AD_LINK_SPEED_1000MBPS, AD_LINK_SPEED_1000MBPS,
AD_LINK_SPEED_10000MBPS AD_LINK_SPEED_2500MBPS,
AD_LINK_SPEED_10000MBPS,
AD_LINK_SPEED_20000MBPS,
AD_LINK_SPEED_40000MBPS,
AD_LINK_SPEED_56000MBPS
}; };
/* compare MAC addresses */ /* compare MAC addresses */
...@@ -247,7 +251,11 @@ static inline int __check_agg_selection_timer(struct port *port) ...@@ -247,7 +251,11 @@ static inline int __check_agg_selection_timer(struct port *port)
* %AD_LINK_SPEED_10MBPS, * %AD_LINK_SPEED_10MBPS,
* %AD_LINK_SPEED_100MBPS, * %AD_LINK_SPEED_100MBPS,
* %AD_LINK_SPEED_1000MBPS, * %AD_LINK_SPEED_1000MBPS,
* %AD_LINK_SPEED_2500MBPS,
* %AD_LINK_SPEED_10000MBPS * %AD_LINK_SPEED_10000MBPS
* %AD_LINK_SPEED_20000MBPS
* %AD_LINK_SPEED_40000MBPS
* %AD_LINK_SPEED_56000MBPS
*/ */
static u16 __get_link_speed(struct port *port) static u16 __get_link_speed(struct port *port)
{ {
...@@ -275,10 +283,26 @@ static u16 __get_link_speed(struct port *port) ...@@ -275,10 +283,26 @@ static u16 __get_link_speed(struct port *port)
speed = AD_LINK_SPEED_1000MBPS; speed = AD_LINK_SPEED_1000MBPS;
break; break;
case SPEED_2500:
speed = AD_LINK_SPEED_2500MBPS;
break;
case SPEED_10000: case SPEED_10000:
speed = AD_LINK_SPEED_10000MBPS; speed = AD_LINK_SPEED_10000MBPS;
break; break;
case SPEED_20000:
speed = AD_LINK_SPEED_20000MBPS;
break;
case SPEED_40000:
speed = AD_LINK_SPEED_40000MBPS;
break;
case SPEED_56000:
speed = AD_LINK_SPEED_56000MBPS;
break;
default: default:
/* unknown speed value from ethtool. shouldn't happen */ /* unknown speed value from ethtool. shouldn't happen */
speed = 0; speed = 0;
...@@ -639,9 +663,21 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator) ...@@ -639,9 +663,21 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
case AD_LINK_SPEED_1000MBPS: case AD_LINK_SPEED_1000MBPS:
bandwidth = aggregator->num_of_ports * 1000; bandwidth = aggregator->num_of_ports * 1000;
break; break;
case AD_LINK_SPEED_2500MBPS:
bandwidth = aggregator->num_of_ports * 2500;
break;
case AD_LINK_SPEED_10000MBPS: case AD_LINK_SPEED_10000MBPS:
bandwidth = aggregator->num_of_ports * 10000; bandwidth = aggregator->num_of_ports * 10000;
break; break;
case AD_LINK_SPEED_20000MBPS:
bandwidth = aggregator->num_of_ports * 20000;
break;
case AD_LINK_SPEED_40000MBPS:
bandwidth = aggregator->num_of_ports * 40000;
break;
case AD_LINK_SPEED_56000MBPS:
bandwidth = aggregator->num_of_ports * 56000;
break;
default: default:
bandwidth = 0; /* to silence the compiler */ bandwidth = 0; /* to silence the compiler */
} }
......
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