aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorJianhua Xie <Jianhua.Xie@freescale.com>2014-11-19 03:48:59 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-19 19:10:16 -0500
commit424c3232b04ac97176d105ffaaed80edcaa19b92 (patch)
tree05879684b0f93bdbac3a0db4de021e9d9ce7b537 /drivers/net/bonding
parentcb8dda90c28e2a13a007ef675a25db6a79991630 (diff)
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: Jianhua Xie <jianhua.xie@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_3ad.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 6bc27d9a8670..8baa87df1738 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -88,7 +88,11 @@ enum ad_link_speed_type {
88 AD_LINK_SPEED_10MBPS, 88 AD_LINK_SPEED_10MBPS,
89 AD_LINK_SPEED_100MBPS, 89 AD_LINK_SPEED_100MBPS,
90 AD_LINK_SPEED_1000MBPS, 90 AD_LINK_SPEED_1000MBPS,
91 AD_LINK_SPEED_10000MBPS 91 AD_LINK_SPEED_2500MBPS,
92 AD_LINK_SPEED_10000MBPS,
93 AD_LINK_SPEED_20000MBPS,
94 AD_LINK_SPEED_40000MBPS,
95 AD_LINK_SPEED_56000MBPS
92}; 96};
93 97
94/* compare MAC addresses */ 98/* compare MAC addresses */
@@ -247,7 +251,11 @@ static inline int __check_agg_selection_timer(struct port *port)
247 * %AD_LINK_SPEED_10MBPS, 251 * %AD_LINK_SPEED_10MBPS,
248 * %AD_LINK_SPEED_100MBPS, 252 * %AD_LINK_SPEED_100MBPS,
249 * %AD_LINK_SPEED_1000MBPS, 253 * %AD_LINK_SPEED_1000MBPS,
254 * %AD_LINK_SPEED_2500MBPS,
250 * %AD_LINK_SPEED_10000MBPS 255 * %AD_LINK_SPEED_10000MBPS
256 * %AD_LINK_SPEED_20000MBPS
257 * %AD_LINK_SPEED_40000MBPS
258 * %AD_LINK_SPEED_56000MBPS
251 */ 259 */
252static u16 __get_link_speed(struct port *port) 260static u16 __get_link_speed(struct port *port)
253{ 261{
@@ -275,10 +283,26 @@ static u16 __get_link_speed(struct port *port)
275 speed = AD_LINK_SPEED_1000MBPS; 283 speed = AD_LINK_SPEED_1000MBPS;
276 break; 284 break;
277 285
286 case SPEED_2500:
287 speed = AD_LINK_SPEED_2500MBPS;
288 break;
289
278 case SPEED_10000: 290 case SPEED_10000:
279 speed = AD_LINK_SPEED_10000MBPS; 291 speed = AD_LINK_SPEED_10000MBPS;
280 break; 292 break;
281 293
294 case SPEED_20000:
295 speed = AD_LINK_SPEED_20000MBPS;
296 break;
297
298 case SPEED_40000:
299 speed = AD_LINK_SPEED_40000MBPS;
300 break;
301
302 case SPEED_56000:
303 speed = AD_LINK_SPEED_56000MBPS;
304 break;
305
282 default: 306 default:
283 /* unknown speed value from ethtool. shouldn't happen */ 307 /* unknown speed value from ethtool. shouldn't happen */
284 speed = 0; 308 speed = 0;
@@ -639,9 +663,21 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
639 case AD_LINK_SPEED_1000MBPS: 663 case AD_LINK_SPEED_1000MBPS:
640 bandwidth = aggregator->num_of_ports * 1000; 664 bandwidth = aggregator->num_of_ports * 1000;
641 break; 665 break;
666 case AD_LINK_SPEED_2500MBPS:
667 bandwidth = aggregator->num_of_ports * 2500;
668 break;
642 case AD_LINK_SPEED_10000MBPS: 669 case AD_LINK_SPEED_10000MBPS:
643 bandwidth = aggregator->num_of_ports * 10000; 670 bandwidth = aggregator->num_of_ports * 10000;
644 break; 671 break;
672 case AD_LINK_SPEED_20000MBPS:
673 bandwidth = aggregator->num_of_ports * 20000;
674 break;
675 case AD_LINK_SPEED_40000MBPS:
676 bandwidth = aggregator->num_of_ports * 40000;
677 break;
678 case AD_LINK_SPEED_56000MBPS:
679 bandwidth = aggregator->num_of_ports * 56000;
680 break;
645 default: 681 default:
646 bandwidth = 0; /* to silence the compiler */ 682 bandwidth = 0; /* to silence the compiler */
647 } 683 }