Skip to contentSkip to conversation

update UAPI header copies

PATCH In review Dan Murphy 2 participants 3 messages Sep 24, 2020 – Sep 25, 2020

Subsystems (2)
lore
Share & tools
lore

Dan Murphy

author
#0 lore raw

PATCH v2 1/2 update UAPI header copies

Update to kernel commit 55f13311785c

---
 uapi/linux/ethtool.h         |  2 ++
 uapi/linux/ethtool_netlink.h | 19 ++++++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)
uapi/linux/ethtool.h +2 -0
index 847ccd0b1fce..052689bcc90c 100644
@@ -1615,6 +1615,8 @@ enum ethtool_link_mode_bit_indices {
 	ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT = 87,
 	ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT	 = 88,
 	ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT	 = 89,
+	ETHTOOL_LINK_MODE_100baseFX_Half_BIT		 = 90,
+	ETHTOOL_LINK_MODE_100baseFX_Full_BIT		 = 91,
 	/* must be last entry */
 	__ETHTOOL_LINK_MODE_MASK_NBITS
 };
uapi/linux/ethtool_netlink.h +18 -1
index cebdb52e6a05..c022883cdb22 100644
@@ -79,6 +79,7 @@ enum {
 	ETHTOOL_MSG_TSINFO_GET_REPLY,
 	ETHTOOL_MSG_CABLE_TEST_NTF,
 	ETHTOOL_MSG_CABLE_TEST_TDR_NTF,
+	ETHTOOL_MSG_TUNNEL_INFO_GET_REPLY,
 
 	/* add new constants above here */
 	__ETHTOOL_MSG_KERNEL_CNT,
@@ -91,9 +92,12 @@ enum {
 #define ETHTOOL_FLAG_COMPACT_BITSETS	(1 << 0)
 /* provide optional reply for SET or ACT requests */
 #define ETHTOOL_FLAG_OMIT_REPLY	(1 << 1)
+/* request statistics, if supported by the driver */
+#define ETHTOOL_FLAG_STATS		(1 << 2)
 
 #define ETHTOOL_FLAG_ALL (ETHTOOL_FLAG_COMPACT_BITSETS | \
-			  ETHTOOL_FLAG_OMIT_REPLY)
+			  ETHTOOL_FLAG_OMIT_REPLY | \
+			  ETHTOOL_FLAG_STATS)
 
 enum {
 	ETHTOOL_A_HEADER_UNSPEC,
@@ -376,12 +380,25 @@ enum {
 	ETHTOOL_A_PAUSE_AUTONEG,			/* u8 */
 	ETHTOOL_A_PAUSE_RX,				/* u8 */
 	ETHTOOL_A_PAUSE_TX,				/* u8 */
+	ETHTOOL_A_PAUSE_STATS,				/* nest - _PAUSE_STAT_* */
 
 	/* add new constants above here */
 	__ETHTOOL_A_PAUSE_CNT,
 	ETHTOOL_A_PAUSE_MAX = (__ETHTOOL_A_PAUSE_CNT - 1)
 };
 
+enum {
+	ETHTOOL_A_PAUSE_STAT_UNSPEC,
+	ETHTOOL_A_PAUSE_STAT_PAD,
+
+	ETHTOOL_A_PAUSE_STAT_TX_FRAMES,
+	ETHTOOL_A_PAUSE_STAT_RX_FRAMES,
+
+	/* add new constants above here */
+	__ETHTOOL_A_PAUSE_STAT_CNT,
+	ETHTOOL_A_PAUSE_STAT_MAX = (__ETHTOOL_A_PAUSE_STAT_CNT - 1)
+};
+
 /* EEE */
 
 enum {
Signature · 1 line
2.28.0.585.ge1cfff676549
author
#1 lore raw

PATCH v2 2/2 Update link mode tables for fiber

Update the link mode tables to include 100base Fx Full and Half duplex modes.

---
 ethtool.c          | 6 ++++++
 netlink/settings.c | 2 ++
 2 files changed, 8 insertions(+)
ethtool.c +6 -0
index ab9b4577cbce..2f71fa92bb09 100644
@@ -463,6 +463,8 @@ static void init_global_link_mode_masks(void)
 		ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT,
 		ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT,
 		ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT,
+		ETHTOOL_LINK_MODE_100baseFX_Half_BIT,
+		ETHTOOL_LINK_MODE_100baseFX_Full_BIT,
 	};
 	static const enum ethtool_link_mode_bit_indices
 		additional_advertised_flags_bits[] = {
@@ -659,6 +661,10 @@ static void dump_link_caps(const char *prefix, const char *an_prefix,
 		  "200000baseDR4/Full" },
 		{ 0, ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
 		  "200000baseCR4/Full" },
+		{ 0, ETHTOOL_LINK_MODE_100baseFX_Half_BIT,
+		  "100baseFx/Half" },
+		{ 1, ETHTOOL_LINK_MODE_100baseFX_Full_BIT,
+		  "100baseFx/Full" },
 	};
 	int indent;
 	int did1, new_line_pend;
netlink/settings.c +2 -0
index 3059d4d0d0b7..41a2e5af1945 100644
@@ -162,6 +162,8 @@ static const struct link_mode_info link_modes[] = {
 	[ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT] = __REAL(400000),
 	[ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT]	= __REAL(400000),
 	[ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT]	= __REAL(400000),
+	[ETHTOOL_LINK_MODE_100baseFX_Half_BIT]		= __HALF_DUPLEX(100),
+	[ETHTOOL_LINK_MODE_100baseFX_Full_BIT]		= __REAL(100),
 };
 const unsigned int link_modes_count = ARRAY_SIZE(link_modes);
 
Signature · 1 line
2.28.0.585.ge1cfff676549
#2 lore raw

Re: [PATCH ethtool v2 2/2] Update link mode tables for fiber

Quoted 23 lines · Dan Murphy

Update the link mode tables to include 100base Fx Full and Half duplex modes.

---
 ethtool.c          | 6 ++++++
 netlink/settings.c | 2 ++
 2 files changed, 8 insertions(+)
ethtool.c +2 -0
index ab9b4577cbce..2f71fa92bb09 100644
@@ -463,6 +463,8 @@ static void init_global_link_mode_masks(void)
 		ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT,
 		ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT,
 		ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT,
+		ETHTOOL_LINK_MODE_100baseFX_Half_BIT,
+		ETHTOOL_LINK_MODE_100baseFX_Full_BIT,
 	};
 	static const enum ethtool_link_mode_bit_indices
 		additional_advertised_flags_bits[] = {

ethtool.c static void dump_link_caps(const char *prefix, const char *an_prefix, · line 670

Quoted 10 lines
ethtool.c +4 -0
@@ -659,6 +661,10 @@ static void dump_link_caps(const char *prefix, const char *an_prefix,
 		  "200000baseDR4/Full" },
 		{ 0, ETHTOOL_LINK_MODE_200000baseCR4_Full_BIT,
 		  "200000baseCR4/Full" },
+		{ 0, ETHTOOL_LINK_MODE_100baseFX_Half_BIT,
+		  "100baseFx/Half" },
+		{ 1, ETHTOOL_LINK_MODE_100baseFX_Full_BIT,
+		  "100baseFx/Full" },
 	};
 	int indent;
 	int did1, new_line_pend;

This table seems to be missing many other modes but I'll rather fix that in a separate commit.

netlink/settings.c static const struct link_mode_info link_modes[] = { · line 169

Quoted 13 lines
netlink/settings.c +2 -0
index 3059d4d0d0b7..41a2e5af1945 100644
@@ -162,6 +162,8 @@ static const struct link_mode_info link_modes[] = {
 	[ETHTOOL_LINK_MODE_400000baseLR4_ER4_FR4_Full_BIT] = __REAL(400000),
 	[ETHTOOL_LINK_MODE_400000baseDR4_Full_BIT]	= __REAL(400000),
 	[ETHTOOL_LINK_MODE_400000baseCR4_Full_BIT]	= __REAL(400000),
+	[ETHTOOL_LINK_MODE_100baseFX_Half_BIT]		= __HALF_DUPLEX(100),
+	[ETHTOOL_LINK_MODE_100baseFX_Full_BIT]		= __REAL(100),
 };
 const unsigned int link_modes_count = ARRAY_SIZE(link_modes);
 

Please update also the table in ethtool.8.in

Michal

Quoted 3 lines
Signature · 1 line
2.28.0.585.ge1cfff676549