* [PATCH RFC net-next 1/5] bonding: Expand speed type for AD Port Key
2014-11-06 11:52 [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed *** Xie Jianhua
@ 2014-11-06 11:52 ` Xie Jianhua
2014-11-06 11:52 ` [PATCH RFC net-next 2/5] bonding: Introduce 2.5Gbps AD link speed Xie Jianhua
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Xie Jianhua @ 2014-11-06 11:52 UTC (permalink / raw)
To: netdev
Cc: Jianhua Xie, Jianhua Xie, Jay Vosburgh, Veaceslav Falico,
Andy Gospodarek, David S. Miller
From: Jianhua Xie <Jianhua.Xie@freescale.com>
Port Key was determined as 16 bits according to the link speed,
duplex and user key (which is yet not supported), in which key
speed was 5 bits for 1Mbps/10Mbps/100Mbps/1Gbps/10Gbps as below:
--------------------------------------------------------------
Port key :| User key | Speed | Duplex|
--------------------------------------------------------------
16 6 1 0
This patch is expanding speed type from 5 bits to 9 bits for other
speed 2.5Gbps/20Gbps/40Gbps/56Gbps and shrinking user key from 10
bits to 6 bits. New Port Key looks like below:
--------------------------------------------------------------
Port key :| User key | Speed | Duplex|
--------------------------------------------------------------
16 10 1 0
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>
---
drivers/net/bonding/bond_3ad.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 2110215f..15821f3 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -77,11 +77,11 @@
* --------------------------------------------------------------
* Port key : | User key | Speed | Duplex |
* --------------------------------------------------------------
- * 16 6 1 0
+ * 16 10 1 0
*/
#define AD_DUPLEX_KEY_BITS 0x1
-#define AD_SPEED_KEY_BITS 0x3E
-#define AD_USER_KEY_BITS 0xFFC0
+#define AD_SPEED_KEY_BITS 0x3FE
+#define AD_USER_KEY_BITS 0xFC00
#define AD_LINK_SPEED_BITMASK_1MBPS 0x1
#define AD_LINK_SPEED_BITMASK_10MBPS 0x2
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH RFC net-next 2/5] bonding: Introduce 2.5Gbps AD link speed
2014-11-06 11:52 [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed *** Xie Jianhua
2014-11-06 11:52 ` [PATCH RFC net-next 1/5] bonding: Expand speed type for AD Port Key Xie Jianhua
@ 2014-11-06 11:52 ` Xie Jianhua
2014-11-06 11:52 ` [PATCH RFC net-next 3/5] bonding: Introduce 20Gbps " Xie Jianhua
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Xie Jianhua @ 2014-11-06 11:52 UTC (permalink / raw)
To: netdev
Cc: Jianhua Xie, Jianhua Xie, Jay Vosburgh, Veaceslav Falico,
Andy Gospodarek, David S. Miller
From: Jianhua Xie <Jianhua.Xie@freescale.com>
This patch inserts 2500Mbps bitmask, fixes aggregated bandwidth
calculation based on 2.5Gbps 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>
---
drivers/net/bonding/bond_3ad.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 15821f3..250232e 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -87,7 +87,8 @@
#define AD_LINK_SPEED_BITMASK_10MBPS 0x2
#define AD_LINK_SPEED_BITMASK_100MBPS 0x4
#define AD_LINK_SPEED_BITMASK_1000MBPS 0x8
-#define AD_LINK_SPEED_BITMASK_10000MBPS 0x10
+#define AD_LINK_SPEED_BITMASK_2500MBPS 0x10
+#define AD_LINK_SPEED_BITMASK_10000MBPS 0x20
/* compare MAC addresses */
#define MAC_ADDRESS_EQUAL(A, B) \
@@ -245,6 +246,7 @@ static inline int __check_agg_selection_timer(struct port *port)
* %AD_LINK_SPEED_BITMASK_10MBPS,
* %AD_LINK_SPEED_BITMASK_100MBPS,
* %AD_LINK_SPEED_BITMASK_1000MBPS,
+ * %AD_LINK_SPEED_BITMASK_2500MBPS,
* %AD_LINK_SPEED_BITMASK_10000MBPS
*/
static u16 __get_link_speed(struct port *port)
@@ -273,6 +275,10 @@ static u16 __get_link_speed(struct port *port)
speed = AD_LINK_SPEED_BITMASK_1000MBPS;
break;
+ case SPEED_2500:
+ speed = AD_LINK_SPEED_BITMASK_2500MBPS;
+ break;
+
case SPEED_10000:
speed = AD_LINK_SPEED_BITMASK_10000MBPS;
break;
@@ -637,6 +643,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
case AD_LINK_SPEED_BITMASK_1000MBPS:
bandwidth = aggregator->num_of_ports * 1000;
break;
+ case AD_LINK_SPEED_BITMASK_2500MBPS:
+ bandwidth = aggregator->num_of_ports * 2500;
+ break;
case AD_LINK_SPEED_BITMASK_10000MBPS:
bandwidth = aggregator->num_of_ports * 10000;
break;
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH RFC net-next 3/5] bonding: Introduce 20Gbps AD link speed
2014-11-06 11:52 [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed *** Xie Jianhua
2014-11-06 11:52 ` [PATCH RFC net-next 1/5] bonding: Expand speed type for AD Port Key Xie Jianhua
2014-11-06 11:52 ` [PATCH RFC net-next 2/5] bonding: Introduce 2.5Gbps AD link speed Xie Jianhua
@ 2014-11-06 11:52 ` Xie Jianhua
2014-11-06 11:52 ` [PATCH RFC net-next 4/5] bonding: Introduce 40Gbps " Xie Jianhua
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Xie Jianhua @ 2014-11-06 11:52 UTC (permalink / raw)
To: netdev
Cc: Jianhua Xie, Jianhua Xie, Jay Vosburgh, Veaceslav Falico,
Andy Gospodarek, David S. Miller
From: Jianhua Xie <Jianhua.Xie@freescale.com>
This patch inserts 20Gbps bitmask, fixes aggregated bandwidth
calculation based on 20Gbps 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>
---
drivers/net/bonding/bond_3ad.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 250232e..a1acc0e 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -89,6 +89,7 @@
#define AD_LINK_SPEED_BITMASK_1000MBPS 0x8
#define AD_LINK_SPEED_BITMASK_2500MBPS 0x10
#define AD_LINK_SPEED_BITMASK_10000MBPS 0x20
+#define AD_LINK_SPEED_BITMASK_20000MBPS 0x40
/* compare MAC addresses */
#define MAC_ADDRESS_EQUAL(A, B) \
@@ -248,6 +249,7 @@ static inline int __check_agg_selection_timer(struct port *port)
* %AD_LINK_SPEED_BITMASK_1000MBPS,
* %AD_LINK_SPEED_BITMASK_2500MBPS,
* %AD_LINK_SPEED_BITMASK_10000MBPS
+ * %AD_LINK_SPEED_BITMASK_20000MBPS
*/
static u16 __get_link_speed(struct port *port)
{
@@ -283,6 +285,10 @@ static u16 __get_link_speed(struct port *port)
speed = AD_LINK_SPEED_BITMASK_10000MBPS;
break;
+ case SPEED_20000:
+ speed = AD_LINK_SPEED_BITMASK_20000MBPS;
+ break;
+
default:
/* unknown speed value from ethtool. shouldn't happen */
speed = 0;
@@ -649,6 +655,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
case AD_LINK_SPEED_BITMASK_10000MBPS:
bandwidth = aggregator->num_of_ports * 10000;
break;
+ case AD_LINK_SPEED_BITMASK_20000MBPS:
+ bandwidth = aggregator->num_of_ports * 20000;
+ break;
default:
bandwidth = 0; /* to silence the compiler */
}
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH RFC net-next 4/5] bonding: Introduce 40Gbps AD link speed
2014-11-06 11:52 [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed *** Xie Jianhua
` (2 preceding siblings ...)
2014-11-06 11:52 ` [PATCH RFC net-next 3/5] bonding: Introduce 20Gbps " Xie Jianhua
@ 2014-11-06 11:52 ` Xie Jianhua
2014-11-06 11:52 ` [PATCH RFC net-next 5/5] bonding: Introduce 56Gbps " Xie Jianhua
2014-11-07 20:19 ` [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed *** David Miller
5 siblings, 0 replies; 8+ messages in thread
From: Xie Jianhua @ 2014-11-06 11:52 UTC (permalink / raw)
To: netdev
Cc: Jianhua Xie, Jianhua Xie, Jay Vosburgh, Veaceslav Falico,
Andy Gospodarek, David S. Miller
From: Jianhua Xie <Jianhua.Xie@freescale.com>
This patch inserts 40Gbps bitmask, fixes aggregated bandwidth
calculation based on 40Gbps 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>
---
drivers/net/bonding/bond_3ad.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index a1acc0e..065c4cc 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -90,6 +90,7 @@
#define AD_LINK_SPEED_BITMASK_2500MBPS 0x10
#define AD_LINK_SPEED_BITMASK_10000MBPS 0x20
#define AD_LINK_SPEED_BITMASK_20000MBPS 0x40
+#define AD_LINK_SPEED_BITMASK_40000MBPS 0x80
/* compare MAC addresses */
#define MAC_ADDRESS_EQUAL(A, B) \
@@ -250,6 +251,7 @@ static inline int __check_agg_selection_timer(struct port *port)
* %AD_LINK_SPEED_BITMASK_2500MBPS,
* %AD_LINK_SPEED_BITMASK_10000MBPS
* %AD_LINK_SPEED_BITMASK_20000MBPS
+ * %AD_LINK_SPEED_BITMASK_40000MBPS
*/
static u16 __get_link_speed(struct port *port)
{
@@ -289,6 +291,10 @@ static u16 __get_link_speed(struct port *port)
speed = AD_LINK_SPEED_BITMASK_20000MBPS;
break;
+ case SPEED_40000:
+ speed = AD_LINK_SPEED_BITMASK_40000MBPS;
+ break;
+
default:
/* unknown speed value from ethtool. shouldn't happen */
speed = 0;
@@ -658,6 +664,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
case AD_LINK_SPEED_BITMASK_20000MBPS:
bandwidth = aggregator->num_of_ports * 20000;
break;
+ case AD_LINK_SPEED_BITMASK_40000MBPS:
+ bandwidth = aggregator->num_of_ports * 40000;
+ break;
default:
bandwidth = 0; /* to silence the compiler */
}
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH RFC net-next 5/5] bonding: Introduce 56Gbps AD link speed
2014-11-06 11:52 [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed *** Xie Jianhua
` (3 preceding siblings ...)
2014-11-06 11:52 ` [PATCH RFC net-next 4/5] bonding: Introduce 40Gbps " Xie Jianhua
@ 2014-11-06 11:52 ` Xie Jianhua
2014-11-07 20:19 ` [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed *** David Miller
5 siblings, 0 replies; 8+ messages in thread
From: Xie Jianhua @ 2014-11-06 11:52 UTC (permalink / raw)
To: netdev
Cc: Jianhua Xie, Jianhua Xie, Jay Vosburgh, Veaceslav Falico,
Andy Gospodarek, David S. Miller
From: Jianhua Xie <Jianhua.Xie@freescale.com>
This patch inserts 56Gbps bitmask, fixes aggregated bandwidth
calculation based on 56Gbps 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>
---
drivers/net/bonding/bond_3ad.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 065c4cc..32513dc 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -91,6 +91,7 @@
#define AD_LINK_SPEED_BITMASK_10000MBPS 0x20
#define AD_LINK_SPEED_BITMASK_20000MBPS 0x40
#define AD_LINK_SPEED_BITMASK_40000MBPS 0x80
+#define AD_LINK_SPEED_BITMASK_56000MBPS 0x100
/* compare MAC addresses */
#define MAC_ADDRESS_EQUAL(A, B) \
@@ -252,6 +253,7 @@ static inline int __check_agg_selection_timer(struct port *port)
* %AD_LINK_SPEED_BITMASK_10000MBPS
* %AD_LINK_SPEED_BITMASK_20000MBPS
* %AD_LINK_SPEED_BITMASK_40000MBPS
+ * %AD_LINK_SPEED_BITMASK_56000MBPS
*/
static u16 __get_link_speed(struct port *port)
{
@@ -295,6 +297,10 @@ static u16 __get_link_speed(struct port *port)
speed = AD_LINK_SPEED_BITMASK_40000MBPS;
break;
+ case SPEED_56000:
+ speed = AD_LINK_SPEED_BITMASK_56000MBPS;
+ break;
+
default:
/* unknown speed value from ethtool. shouldn't happen */
speed = 0;
@@ -667,6 +673,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
case AD_LINK_SPEED_BITMASK_40000MBPS:
bandwidth = aggregator->num_of_ports * 40000;
break;
+ case AD_LINK_SPEED_BITMASK_56000MBPS:
+ bandwidth = aggregator->num_of_ports * 56000;
+ break;
default:
bandwidth = 0; /* to silence the compiler */
}
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed ***
2014-11-06 11:52 [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed *** Xie Jianhua
` (4 preceding siblings ...)
2014-11-06 11:52 ` [PATCH RFC net-next 5/5] bonding: Introduce 56Gbps " Xie Jianhua
@ 2014-11-07 20:19 ` David Miller
2014-11-10 7:21 ` Jianhua Xie
5 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2014-11-07 20:19 UTC (permalink / raw)
To: Jianhua.Xie; +Cc: netdev
From: Xie Jianhua <Jianhua.Xie@freescale.com>
Date: Thu, 6 Nov 2014 19:52:47 +0800
> From: Jianhua Xie <Jianhua.Xie@freescale.com>
>
> User Key bits in Port key of AD mode are yet not used. This series
> expands speed type bits and shrinks unused user Key bits in AD mode
> Port Key, introduces 4 AD link speed: 2.5G/20G/40G/56G, and fixes
> aggregated link bandwidth calculation based on new link speed.
I think you can compress patches #2 to #5 into one single patch.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed ***
2014-11-07 20:19 ` [PATCH RFC net-next 0/5] *** Introduce 4 AD link speed *** David Miller
@ 2014-11-10 7:21 ` Jianhua Xie
0 siblings, 0 replies; 8+ messages in thread
From: Jianhua Xie @ 2014-11-10 7:21 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Thanks a lot for the valuable comments.
New patches set is coming.
Best Regards,
Jianhua
在 2014年11月08日 04:19, David Miller 写道:
> From: Xie Jianhua <Jianhua.Xie@freescale.com>
> Date: Thu, 6 Nov 2014 19:52:47 +0800
>
>> From: Jianhua Xie <Jianhua.Xie@freescale.com>
>>
>> User Key bits in Port key of AD mode are yet not used. This series
>> expands speed type bits and shrinks unused user Key bits in AD mode
>> Port Key, introduces 4 AD link speed: 2.5G/20G/40G/56G, and fixes
>> aggregated link bandwidth calculation based on new link speed.
> I think you can compress patches #2 to #5 into one single patch.
^ permalink raw reply [flat|nested] 8+ messages in thread