mlxsw: Add support for 400Gbps (50Gbps per lane) link modes
Subsystems (5)
v2 cover mlxsw: Add support for 400Gbps (50Gbps per lane) link modes
From: Jiri Pirko <[email protected]>
Add 400Gbps bits to ethtool and introduce support in mlxsw. These modes are supported by the Spectrum-2 switch ASIC.
Jiri Pirko (2):
ethtool: Add support for 400Gbps (50Gbps per lane) link modes
mlxsw: spectrum: Add support for 400Gbps (50Gbps per lane) link modes
drivers/net/ethernet/mellanox/mlxsw/reg.h | 1 + .../net/ethernet/mellanox/mlxsw/spectrum.c | 52 +++++++++++++++---- drivers/net/phy/phy-core.c | 10 +++- include/uapi/linux/ethtool.h | 6 +++ 4 files changed, 58 insertions(+), 11 deletions(-)
Signature · 1 line
2.21.0
PATCH v2 1/2 ethtool: Add support for 400Gbps (50Gbps per lane) link modes
From: Jiri Pirko <[email protected]>
Add support for 400Gbps speed, link modes of 50Gbps per lane
---v1->v2:
- added patch description
--- drivers/net/phy/phy-core.c | 10 +++++++++- include/uapi/linux/ethtool.h | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-)
drivers/net/phy/phy-core.c +9 -1
@@ -8,7 +8,7 @@const char *phy_speed_to_str (int speed) { -BUILD_BUG_ON_MSG (__ETHTOOL_LINK_MODE_MASK_NBITS !=69 , +BUILD_BUG_ON_MSG (__ETHTOOL_LINK_MODE_MASK_NBITS !=74 ,"Enum ethtool_link_mode_bit_indices and phylib are out of sync. " "If a speed or mode has been added please update phy_speed_to_str " "and the PHY settings array.\n" );
@@ -42,6 +42,8 @@ const char *phy_speed_to_str(int speed)return "100Gbps" ;case SPEED_200000 :return "200Gbps" ; +case SPEED_400000 : +return "400Gbps" ;case SPEED_UNKNOWN :return "Unknown" ;default :
@@ -70,6 +72,12 @@ EXPORT_SYMBOL_GPL(phy_duplex_to_str); .bit = ETHTOOL_LINK_MODE_ ## b ## _BIT}static const struct phy_setting settings[] = { +/* 400G */ + PHY_SETTING( 400000, FULL, 400000baseCR8_Full ), + PHY_SETTING( 400000, FULL, 400000baseKR8_Full ), + PHY_SETTING( 400000, FULL, 400000baseLR8_ER8_FR8_Full ), + PHY_SETTING( 400000, FULL, 400000baseDR8_Full ), + PHY_SETTING( 400000, FULL, 400000baseSR8_Full ),/* 200G */ PHY_SETTING( 200000, FULL, 200000baseCR4_Full ), PHY_SETTING( 200000, FULL, 200000baseKR4_Full ),
include/uapi/linux/ethtool.h +6 -0
@@ -1507,6 +1507,11 @@ enum ethtool_link_mode_bit_indices { ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT =66 , ETHTOOL_LINK_MODE_100baseT1_Full_BIT =67 , ETHTOOL_LINK_MODE_1000baseT1_Full_BIT =68 , + ETHTOOL_LINK_MODE_400000baseKR8_Full_BIT =69 , + ETHTOOL_LINK_MODE_400000baseSR8_Full_BIT =70 , + ETHTOOL_LINK_MODE_400000baseLR8_ER8_FR8_Full_BIT =71 , + ETHTOOL_LINK_MODE_400000baseDR8_Full_BIT =72 , + ETHTOOL_LINK_MODE_400000baseCR8_Full_BIT =73 ,/* must be last entry */ __ETHTOOL_LINK_MODE_MASK_NBITS
@@ -1618,6 +1623,7 @@ enum ethtool_link_mode_bit_indices {#define SPEED_56000 56000#define SPEED_100000 100000#define SPEED_200000 200000 +#define SPEED_400000 400000#define SPEED_UNKNOWN -1
Signature · 1 line
2.21.0
PATCH v2 2/2 mlxsw: spectrum: Add support for 400Gbps (50Gbps per lane) link modes
In reply to Jiri PirkoFrom: Jiri Pirko <[email protected]>
Extend speed support with 400Gbps
--- drivers/net/ethernet/mellanox/mlxsw/reg.h | 1 + .../net/ethernet/mellanox/mlxsw/spectrum.c | 52 +++++++++++++++---- 2 files changed, 43 insertions(+), 10 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/reg.h +1 -0
@@ -4111,6 +4111,7 @@ MLXSW_ITEM32(reg, ptys, an_status, 0x04, 28, 4);#define MLXSW_REG_PTYS_EXT_ETH_SPEED_CAUI_4_100GBASE_CR4_KR4 BIT(9)#define MLXSW_REG_PTYS_EXT_ETH_SPEED_100GAUI_2_100GBASE_CR2_KR2 BIT(10)#define MLXSW_REG_PTYS_EXT_ETH_SPEED_200GAUI_4_200GBASE_CR4_KR4 BIT(12) +#define MLXSW_REG_PTYS_EXT_ETH_SPEED_400GAUI_8 BIT(15)/* reg_ptys_ext_eth_proto_cap * Extended Ethernet port supported speeds and protocols.
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +42 -10
129 lines not on this page · raw message
Signature · 1 line
2.21.0
Quoted 4 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
Add 400Gbps bits to ethtool and introduce support in mlxsw. These modes are supported by the Spectrum-2 switch ASIC.
Thanks for the update, looks good to me!
Out of curiosity - why did we start bunching up LR, ER and FR?
Quoted 9 lines · Tue, Oct 15, 2019 at 09:07:57PM CEST, [email protected] wrote:
Quoted 4 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
Add 400Gbps bits to ethtool and introduce support in mlxsw. These modes are supported by the Spectrum-2 switch ASIC.
Thanks for the update, looks good to me!
Out of curiosity - why did we start bunching up LR, ER and FR?
No clue. But it's been done like that for other speeds too.
Quoted 4 lines · Jiri Pirko
Quoted 3 lines · Tue, Oct 15, 2019 at 09:07:57PM CEST, [email protected] wrote:
Quoted 2 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Add 400Gbps bits to ethtool and introduce support in mlxsw. These modes are supported by the Spectrum-2 switch ASIC.
Thanks for the update, looks good to me!
Out of curiosity - why did we start bunching up LR, ER and FR?
No clue. But it's been done like that for other speeds too.
Looks like for 50G Serdeses and 4x25G we started grouping by Clause. Probably makes sense.
David Miller
maintainerFrom: Jiri Pirko <[email protected]>
Date: Sat, 12 Oct 2019 18:27:56 +0200
Quoted 4 lines
From: Jiri Pirko <[email protected]>
Add 400Gbps bits to ethtool and introduce support in mlxsw. These modes are supported by the Spectrum-2 switch ASIC.
Series applied, thanks.