Skip to contentSkip to conversation

ethtool: Add direct access to ops->get_sset_count

PATCH Superseded Jeff Kirsher 2 participants 2 messages Feb 27, 2010

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ethtool: Add direct access to ops->get_sset_count

From: Jeff Garzik <[email protected]>

This patch is an alternative approach for accessing string counts, vs. the drvinfo indirect approach. This way the drvinfo space doesn't run out, and we don't break ABI later.

---

 include/linux/ethtool.h |   25 ++++++++++++-----
 net/core/ethtool.c      |   71 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+), 7 deletions(-)
include/linux/ethtool.h +18 -7
index cca1c3d..ff2a49c 100644
@@ -239,10 +239,10 @@ struct ethtool_pauseparam {
 
 #define ETH_GSTRING_LEN		32
 enum ethtool_stringset {
-	ETH_SS_TEST		= 0,
-	ETH_SS_STATS,
-	ETH_SS_PRIV_FLAGS,
-	ETH_SS_NTUPLE_FILTERS,
+	ETH_SS_TEST		= (1 << 0),
+	ETH_SS_STATS		= (1 << 1),
+	ETH_SS_PRIV_FLAGS	= (1 << 2),
+	ETH_SS_NTUPLE_FILTERS	= (1 << 3),
 };
 
 /* for passing string sets for data tagging */
@@ -253,6 +253,17 @@ struct ethtool_gstrings {
 	__u8	data[0];
 };
 
+struct ethtool_sset_info {
+	__u32	cmd;		/* ETHTOOL_GSSET_INFO */
+	__u32	reserved;
+	__u64	sset_mask;	/* input: each bit selects an sset to query */
+				/* output: each bit a returned sset */
+	__u32	data[0];	/* ETH_SS_xxx count, in order, based on bits
+				   in sset_mask.  One bit implies one
+				   __u32, two bits implies two
+				   __u32's, etc. */
+};
+
 enum ethtool_test_flags {
 	ETH_TEST_FL_OFFLINE	= (1 << 0),	/* online / offline */
 	ETH_TEST_FL_FAILED	= (1 << 1),	/* test passed / failed */
@@ -606,9 +617,9 @@ struct ethtool_ops {
 #define	ETHTOOL_SRXCLSRLINS	0x00000032 /* Insert RX classification rule */
 #define	ETHTOOL_FLASHDEV	0x00000033 /* Flash firmware to device */
 #define	ETHTOOL_RESET		0x00000034 /* Reset hardware */
-
-#define ETHTOOL_SRXNTUPLE	0x00000035 /* Add an n-tuple filter to device */
-#define ETHTOOL_GRXNTUPLE	0x00000036 /* Get n-tuple filters from device */
+#define	ETHTOOL_SRXNTUPLE	0x00000035 /* Add an n-tuple filter to device */
+#define	ETHTOOL_GRXNTUPLE	0x00000036 /* Get n-tuple filters from device */
+#define	ETHTOOL_GSSET_INFO	0x00000037 /* Get string set info */
 
 /* compatibility with older code */
 #define SPARC_ETH_GSET		ETHTOOL_GSET
net/core/ethtool.c +71 -0

89 lines not on this page · raw message

#1 lore raw
Quoted 7 lines · Jeff Kirsher

From: Jeff Garzik <[email protected]>

This patch is an alternative approach for accessing string counts, vs. the drvinfo indirect approach. This way the drvinfo space doesn't run out, and we don't break ABI later.

Slander!

Quoted 15 lines

---

 include/linux/ethtool.h |   25 ++++++++++++-----
 net/core/ethtool.c      |   71 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 89 insertions(+), 7 deletions(-)
include/linux/ethtool.h +0 -0
index cca1c3d..ff2a49c 100644
@@ -239,10 +239,10 @@ struct ethtool_pauseparam {
 
 #define ETH_GSTRING_LEN		32

include/linux/ethtool.h struct ethtool_pauseparam { · line 246

Quoted 10 lines
include/linux/ethtool.h +4 -4
 enum ethtool_stringset {
-	ETH_SS_TEST		= 0,
-	ETH_SS_STATS,
-	ETH_SS_PRIV_FLAGS,
-	ETH_SS_NTUPLE_FILTERS,
+	ETH_SS_TEST		= (1 << 0),
+	ETH_SS_STATS		= (1 << 1),
+	ETH_SS_PRIV_FLAGS	= (1 << 2),
+	ETH_SS_NTUPLE_FILTERS	= (1 << 3),
 };

[...]

This breaks the established ABI for ETHTOOL_GSTRINGS.

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.