Skip to contentSkip to conversation

Add 100BaseT1 and 1000BaseT1

PATCH In review Andrew Lunn 3 participants 7 messages May 31, 2019 – Jun 14, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Add 100BaseT1 and 1000BaseT1

Import the latest ethtool.h and add two new links modes.

v2:
Move the new speeds to the end of the all_advertised_modes_bits[]. Remove the same_line bit for the new moved
Add the new modes to the man page.

Andrew Lunn (2):
ethtool: sync ethtool-copy.h with linux-next from 30/05/2019
ethtool: Add 100BaseT1 and 1000BaseT1 link modes

 ethtool-copy.h | 7 ++++++-
 ethtool.8.in   | 2 ++
 ethtool.c      | 6 ++++++
 3 files changed, 14 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/2 ethtool: sync ethtool-copy.h with linux-next from 30/05/2019

Sync ethtool-copy.h with linux-next from 22/05/2019. This provides access to the new link modes for 100BaseT1 and 1000BaseT1.

---
 ethtool-copy.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
ethtool-copy.h +6 -1
index 92ab10d65fc9..ad16e8f9c290 100644
@@ -1481,6 +1481,8 @@ enum ethtool_link_mode_bit_indices {
 	ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64,
 	ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT	 = 65,
 	ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT	 = 66,
+	ETHTOOL_LINK_MODE_100baseT1_Full_BIT             = 67,
+	ETHTOOL_LINK_MODE_1000baseT1_Full_BIT            = 68,
 
 	/* must be last entry */
 	__ETHTOOL_LINK_MODE_MASK_NBITS
@@ -1597,7 +1599,7 @@ enum ethtool_link_mode_bit_indices {
 
 static __inline__ int ethtool_validate_speed(__u32 speed)
 {
-	return speed <= INT_MAX || speed == SPEED_UNKNOWN;
+	return speed <= INT_MAX || speed == (__u32)SPEED_UNKNOWN;
 }
 
 /* Duplex, half or full. */
@@ -1710,6 +1712,9 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
 #define ETH_MODULE_SFF_8436		0x4
 #define ETH_MODULE_SFF_8436_LEN		256
 
+#define ETH_MODULE_SFF_8636_MAX_LEN	640
+#define ETH_MODULE_SFF_8436_MAX_LEN	640
+
 /* Reset flags */
 /* The reset() operation must clear the flags for the components which
  * were actually reset.  On successful return, the flags indicate the
Signature · 1 line
2.20.1
Reviewed-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] ethtool: sync ethtool-copy.h with linux-next from 30/05/2019

Quoted 5 lines · Andrew Lunn

Sync ethtool-copy.h with linux-next from 22/05/2019. This provides access to the new link modes for 100BaseT1 and 1000BaseT1.

---

BtW, this differs from the file "make headers_install" produces in net-next but only in white space so that it doesn't really matter and it gets sorted in a future sync.

Quoted 38 lines
 ethtool-copy.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
ethtool-copy.h +6 -1
index 92ab10d65fc9..ad16e8f9c290 100644
@@ -1481,6 +1481,8 @@ enum ethtool_link_mode_bit_indices {
 	ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT = 64,
 	ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT	 = 65,
 	ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT	 = 66,
+	ETHTOOL_LINK_MODE_100baseT1_Full_BIT             = 67,
+	ETHTOOL_LINK_MODE_1000baseT1_Full_BIT            = 68,
 
 	/* must be last entry */
 	__ETHTOOL_LINK_MODE_MASK_NBITS
@@ -1597,7 +1599,7 @@ enum ethtool_link_mode_bit_indices {
 
 static __inline__ int ethtool_validate_speed(__u32 speed)
 {
-	return speed <= INT_MAX || speed == SPEED_UNKNOWN;
+	return speed <= INT_MAX || speed == (__u32)SPEED_UNKNOWN;
 }
 
 /* Duplex, half or full. */
@@ -1710,6 +1712,9 @@ static __inline__ int ethtool_validate_duplex(__u8 duplex)
 #define ETH_MODULE_SFF_8436		0x4
 #define ETH_MODULE_SFF_8436_LEN		256
 
+#define ETH_MODULE_SFF_8636_MAX_LEN	640
+#define ETH_MODULE_SFF_8436_MAX_LEN	640
+
 /* Reset flags */
 /* The reset() operation must clear the flags for the components which
  * were actually reset.  On successful return, the flags indicate the
Signature · 1 line
2.20.1
#3 lore raw

Re: [PATCH v2 1/2] ethtool: sync ethtool-copy.h with linux-next from 30/05/2019

Quoted 5 lines

BtW, this differs from the file "make headers_install" produces in net-next but only in white space so that it doesn't really matter and it gets sorted in a future sync.

Yes, there is something odd going on. It looks like two tabs have been converted to spaces in the ethtool copy. I left them alone, since i did not add them.

Andrew

#4 lore raw

PATCH v2 2/2 ethtool: Add 100BaseT1 and 1000BaseT1 link modes

In reply to Andrew Lunn

The kernel can now indicate if the PHY supports operating over a single pair at 100Mbps or 1000Mbps.

---
 ethtool.8.in | 2 ++
 ethtool.c    | 6 ++++++
 2 files changed, 8 insertions(+)
ethtool.8.in +2 -0
index 430d11b915af..6af63455c636 100644
@@ -639,8 +639,10 @@ lB	l	lB.
 0x002	10baseT Full
 0x004	100baseT Half
 0x008	100baseT Full
+0x80000000000000000	100baseT1 Full
 0x010	1000baseT Half	(not supported by IEEE standards)
 0x020	1000baseT Full
+0x100000000000000000	1000baseT1 Full
 0x20000	1000baseKX Full
 0x20000000000	1000baseX Full
 0x800000000000	2500baseT Full
ethtool.c +6 -0
index 66a907edd97b..05fe05a080cd 100644
@@ -545,6 +545,8 @@ static void init_global_link_mode_masks(void)
 		ETHTOOL_LINK_MODE_200000baseLR4_ER4_FR4_Full_BIT,
 		ETHTOOL_LINK_MODE_200000baseDR4_Full_BIT,
 		ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
+		ETHTOOL_LINK_MODE_100baseT1_Full_BIT,
+		ETHTOOL_LINK_MODE_1000baseT1_Full_BIT,
 	};
 	static const enum ethtool_link_mode_bit_indices
 		additional_advertised_flags_bits[] = {
@@ -634,10 +636,14 @@ static void dump_link_caps(const char *prefix, const char *an_prefix,
 		  "100baseT/Half" },
 		{ 1, ETHTOOL_LINK_MODE_100baseT_Full_BIT,
 		  "100baseT/Full" },
+		{ 0, ETHTOOL_LINK_MODE_100baseT1_Full_BIT,
+		  "100baseT1/Full" },
 		{ 0, ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
 		  "1000baseT/Half" },
 		{ 1, ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
 		  "1000baseT/Full" },
+		{ 0, ETHTOOL_LINK_MODE_1000baseT1_Full_BIT,
+		  "1000baseT1/Full" },
 		{ 0, ETHTOOL_LINK_MODE_1000baseKX_Full_BIT,
 		  "1000baseKX/Full" },
 		{ 0, ETHTOOL_LINK_MODE_2500baseX_Full_BIT,
Signature · 1 line
2.20.1
Reviewed-by on v2 2/2
#5 lore raw

Re: [PATCH v2 2/2] ethtool: Add 100BaseT1 and 1000BaseT1 link modes

Quoted 5 lines · Andrew Lunn

The kernel can now indicate if the PHY supports operating over a single pair at 100Mbps or 1000Mbps.

---

Quoted 9 lines
 ethtool.8.in | 2 ++
 ethtool.c    | 6 ++++++
 2 files changed, 8 insertions(+)
ethtool.8.in +0 -0
index 430d11b915af..6af63455c636 100644

ethtool.8.in lB l lB. · line 648

Quoted 10 lines
ethtool.8.in +2 -0
@@ -639,8 +639,10 @@ lB	l	lB.
 0x002	10baseT Full
 0x004	100baseT Half
 0x008	100baseT Full
+0x80000000000000000	100baseT1 Full
 0x010	1000baseT Half	(not supported by IEEE standards)
 0x020	1000baseT Full
+0x100000000000000000	1000baseT1 Full
 0x20000	1000baseKX Full
 0x20000000000	1000baseX Full
 0x800000000000	2500baseT Full

This reminds me the earlier discussion about which syntax extension would be more useful:

ethtool -s <dev> advertise 100baseT1/Full 1000baseT1/Full

(listing modes to be advertised) or

ethtool -s <dev> advertise 100baseT1/Full off 1000baseT1/Full on

(enabling/disabling selected modes). But maybe we could support both; after all, it's unlikely there would ever be a link mode named "on" or "off".

Michal

#6 lore raw
In reply to Andrew Lunn
Quoted 7 lines · Andrew Lunn

Import the latest ethtool.h and add two new links modes.

v2:
Move the new speeds to the end of the all_advertised_modes_bits[]. Remove the same_line bit for the new moved
Add the new modes to the man page.

Quoted 8 lines

Andrew Lunn (2):
ethtool: sync ethtool-copy.h with linux-next from 30/05/2019
ethtool: Add 100BaseT1 and 1000BaseT1 link modes

 ethtool-copy.h | 7 ++++++-
 ethtool.8.in   | 2 ++
 ethtool.c      | 6 ++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

Thanks for the patches! Queued for next release...

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.