Blame SOURCES/0020-ethtool-Add-support-for-200Gbps-50Gbps-per-lane-link.patch

bdc7d9
From f507c9e5f77a10d25d32581c2b160e90c4c446b0 Mon Sep 17 00:00:00 2001
bdc7d9
From: Aya Levin <ayal@mellanox.com>
bdc7d9
Date: Mon, 25 Feb 2019 17:44:34 +0200
bdc7d9
Subject: [PATCH] ethtool: Add support for 200Gbps (50Gbps per lane) link mode
bdc7d9
bdc7d9
Introduce 50Gbps per lane link modes and 200Gbps speed, update print
bdc7d9
functions and initialization functions accordingly.
bdc7d9
In addition, update related man page accordingly.
bdc7d9
bdc7d9
Signed-off-by: Aya Levin <ayal@mellanox.com>
bdc7d9
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
bdc7d9
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
bdc7d9
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bdc7d9
(cherry picked from commit caa4bbef6ff920a0ff1d94c5bff7f2c7c875fca3)
bdc7d9
---
bdc7d9
 ethtool-copy.h | 18 +++++++++++++++++-
bdc7d9
 ethtool.8.in   | 15 +++++++++++++++
bdc7d9
 ethtool.c      | 45 +++++++++++++++++++++++++++++++++++++++++++++
bdc7d9
 3 files changed, 77 insertions(+), 1 deletion(-)
bdc7d9
bdc7d9
diff --git a/ethtool-copy.h b/ethtool-copy.h
bdc7d9
index 8cc61e9..28b3592 100644
bdc7d9
--- a/ethtool-copy.h
bdc7d9
+++ b/ethtool-copy.h
bdc7d9
@@ -1450,6 +1450,21 @@ enum ethtool_link_mode_bit_indices {
bdc7d9
 	ETHTOOL_LINK_MODE_FEC_NONE_BIT	= 49,
bdc7d9
 	ETHTOOL_LINK_MODE_FEC_RS_BIT	= 50,
bdc7d9
 	ETHTOOL_LINK_MODE_FEC_BASER_BIT	= 51,
bdc7d9
+	ETHTOOL_LINK_MODE_50000baseKR_Full_BIT		 = 52,
bdc7d9
+	ETHTOOL_LINK_MODE_50000baseSR_Full_BIT		 = 53,
bdc7d9
+	ETHTOOL_LINK_MODE_50000baseCR_Full_BIT		 = 54,
bdc7d9
+	ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT	 = 55,
bdc7d9
+	ETHTOOL_LINK_MODE_50000baseDR_Full_BIT		 = 56,
bdc7d9
+	ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT	 = 57,
bdc7d9
+	ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT	 = 58,
bdc7d9
+	ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT	 = 59,
bdc7d9
+	ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT = 60,
bdc7d9
+	ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT	 = 61,
bdc7d9
+	ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT	 = 62,
bdc7d9
+	ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT	 = 63,
bdc7d9
+	ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64,
bdc7d9
+	ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT	 = 65,
bdc7d9
+	ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT	 = 66,
bdc7d9
 
bdc7d9
 	/* Last allowed bit for __ETHTOOL_LINK_MODE_LEGACY_MASK is bit
bdc7d9
 	 * 31. Please do NOT define any SUPPORTED_* or ADVERTISED_*
bdc7d9
@@ -1458,7 +1473,7 @@ enum ethtool_link_mode_bit_indices {
bdc7d9
 	 */
bdc7d9
 
bdc7d9
 	__ETHTOOL_LINK_MODE_LAST
bdc7d9
-	  = ETHTOOL_LINK_MODE_FEC_BASER_BIT,
bdc7d9
+	  = ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
bdc7d9
 };
bdc7d9
 
bdc7d9
 #define __ETHTOOL_LINK_MODE_LEGACY_MASK(base_name)	\
bdc7d9
@@ -1566,6 +1581,7 @@ enum ethtool_link_mode_bit_indices {
bdc7d9
 #define SPEED_50000		50000
bdc7d9
 #define SPEED_56000		56000
bdc7d9
 #define SPEED_100000		100000
bdc7d9
+#define SPEED_200000		200000
bdc7d9
 
bdc7d9
 #define SPEED_UNKNOWN		-1
bdc7d9
 
bdc7d9
diff --git a/ethtool.8.in b/ethtool.8.in
bdc7d9
index dd2e3f5..de6ae68 100644
bdc7d9
--- a/ethtool.8.in
bdc7d9
+++ b/ethtool.8.in
bdc7d9
@@ -613,6 +613,11 @@ lB	l	lB.
bdc7d9
 0x400000000	50000baseCR2 Full
bdc7d9
 0x800000000	50000baseKR2 Full
bdc7d9
 0x10000000000	50000baseSR2 Full
bdc7d9
+0x10000000000000	50000baseKR Full
bdc7d9
+0x20000000000000	50000baseSR Full
bdc7d9
+0x40000000000000	50000baseCR Full
bdc7d9
+0x80000000000000	50000baseLR_ER_FR Full
bdc7d9
+0x100000000000000	50000baseDR Full
bdc7d9
 0x8000000	56000baseKR4 Full
bdc7d9
 0x10000000	56000baseCR4 Full
bdc7d9
 0x20000000	56000baseSR4 Full
bdc7d9
@@ -621,6 +626,16 @@ lB	l	lB.
bdc7d9
 0x2000000000	100000baseSR4 Full
bdc7d9
 0x4000000000	100000baseCR4 Full
bdc7d9
 0x8000000000	100000baseLR4_ER4 Full
bdc7d9
+0x200000000000000	100000baseKR2 Full
bdc7d9
+0x400000000000000	100000baseSR2 Full
bdc7d9
+0x800000000000000	100000baseCR2 Full
bdc7d9
+0x1000000000000000	100000baseLR2_ER2_FR2 Full
bdc7d9
+0x2000000000000000	100000baseDR2 Full
bdc7d9
+0x4000000000000000	200000baseKR4 Full
bdc7d9
+0x8000000000000000	200000baseSR4 Full
bdc7d9
+0x10000000000000000	200000baseLR4_ER4_FR4 Full
bdc7d9
+0x20000000000000000	200000baseDR4 Full
bdc7d9
+0x40000000000000000	200000baseCR4 Full
bdc7d9
 .TE
bdc7d9
 .TP
bdc7d9
 .BI phyad \ N
bdc7d9
diff --git a/ethtool.c b/ethtool.c
bdc7d9
index 06006f4..d58ca2e 100644
bdc7d9
--- a/ethtool.c
bdc7d9
+++ b/ethtool.c
bdc7d9
@@ -530,6 +530,21 @@ static void init_global_link_mode_masks(void)
bdc7d9
 		ETHTOOL_LINK_MODE_10000baseER_Full_BIT,
bdc7d9
 		ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
bdc7d9
 		ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_50000baseKR_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_50000baseSR_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_50000baseCR_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_50000baseDR_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT,
bdc7d9
+		ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
bdc7d9
 	};
bdc7d9
 	static const enum ethtool_link_mode_bit_indices
bdc7d9
 		additional_advertised_flags_bits[] = {
bdc7d9
@@ -689,6 +704,36 @@ static void dump_link_caps(const char *prefix, const char *an_prefix,
bdc7d9
 		  "2500baseT/Full" },
bdc7d9
 		{ 0, ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
bdc7d9
 		  "5000baseT/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_50000baseKR_Full_BIT,
bdc7d9
+		  "50000baseKR/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_50000baseSR_Full_BIT,
bdc7d9
+		  "50000baseSR/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_50000baseCR_Full_BIT,
bdc7d9
+		  "50000baseCR/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT,
bdc7d9
+		  "50000baseLR_ER_FR/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_50000baseDR_Full_BIT,
bdc7d9
+		  "50000baseDR/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_100000baseKR2_Full_BIT,
bdc7d9
+		  "100000baseKR2/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_100000baseSR2_Full_BIT,
bdc7d9
+		  "100000baseSR2/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_100000baseCR2_Full_BIT,
bdc7d9
+		  "100000baseCR2/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_100000baseLR2_ER2_FR2_Full_BIT,
bdc7d9
+		  "100000baseLR2_ER2_FR2/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_100000baseDR2_Full_BIT,
bdc7d9
+		  "100000baseDR2/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_200000baseKR4_Full_BIT,
bdc7d9
+		  "200000baseKR4/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_200000baseSR4_Full_BIT,
bdc7d9
+		  "200000baseSR4/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT,
bdc7d9
+		  "200000baseLR4_ER4_FR4/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT,
bdc7d9
+		  "200000baseDR4/Full" },
bdc7d9
+		{ 0, ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
bdc7d9
+		  "200000baseCR4/Full" },
bdc7d9
 	};
bdc7d9
 	int indent;
bdc7d9
 	int did1, new_line_pend, i;
bdc7d9
-- 
bdc7d9
1.8.3.1
bdc7d9