Thread (17 messages) flat view 17 messages, 4 authors, 2014-03-13

Re: [PATCH net-next v3 5/9] Altera TSE: Add Miscellaneous Files for Altera Ethernet Driver

From: Joe Perches <joe@perches.com>
Date: 2014-03-12 22:26:37
Also in: netdev
Subsystem: networking [ethtool], networking [general], the rest · Maintainers: Andrew Lunn, Jakub Kicinski, "David S. Miller", Eric Dumazet, Paolo Abeni, Linus Torvalds

On Wed, 2014-03-12 at 21:14 +0000, Ben Hutchings wrote:
These look like the statistic names specified in IEEE 802.3.  I would
support a general move to using standard names for MAC stats in Ethernet
drivers, because they are quite clearly defined and widely implemented
in hardware.  However, that is not the current practice in most Linux
drivers.
Hey Ben.

Maybe something like this would be a start?

Change the actual #defines/strings to taste.

Maybe this shouldn't be in uapi or maybe in if_ether.h

---
 include/uapi/linux/ethtool.h | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index fd161e9..24b8b51 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -498,6 +498,36 @@ struct ethtool_pauseparam {
 
 #define ETH_GSTRING_LEN		32
 
+#define ETH_GSTRING_RX_PKTS		"rx_packets"
+#define ETH_GSTRING_RX_BYTES		"rx_bytes"
+#define ETH_GSTRING_RX_TOTAL_BYTES	"rx_total_bytes"
+#define ETH_GSTRING_RX_TOTAL_PKTS	"rx_total_packets"
+#define ETH_GSTRING_RX_CRC_ERRS		"rx_crc_errors"
+#define ETH_GSTRING_RX_ALIGN_ERRS	"rx_align_errors"
+#define ETH_GSTRING_RX_PAUSE		"rx_pause"
+#define ETH_GSTRING_RX_ERRS		"rx_errors"
+#define ETH_GSTRING_RX_UNICAST		"rx_unicast"
+#define ETH_GSTRING_RX_MULTICAST	"rx_multicast"
+#define ETH_GSTRING_RX_BROADCAST	"rx_broadcast"
+#define ETH_GSTRING_RX_FIFO_DROPS	"rx_fifo_drops"
+#define ETH_GSTRING_RX_UNDERSIZE	"rx_undersize"
+#define ETH_GSTRING_RX_OVERSIZE		"rx_oversize"
+#define ETH_GSTRING_RX_DUPLICATES	"rx_duplicates"
+#define ETH_GSTRING_RX_DROPPED		"rx_dropped"
+#define ETH_GSTRING_RX_FRAGMENTS	"rx_fragments"
+
+#define ETH_GSTRING_TX_PKTS		"tx_packets"
+#define ETH_GSTRING_TX_BYTES		"tx_bytes"
+#define ETH_GSTRING_TX_TOTAL_BYTES	"tx_total_bytes"
+#define ETH_GSTRING_TX_TOTAL_PKTS	"tx_total_packets"
+#define ETH_GSTRING_TX_PAUSE		"tx_pause"
+#define ETH_GSTRING_TX_ERRS		"tx_errors"
+#define ETH_GSTRING_TX_DISCARDS		"tx_discards"
+#define ETH_GSTRING_TX_UNICAST		"tx_unicast"
+#define ETH_GSTRING_TX_MULTICAST	"tx_multicast"
+#define ETH_GSTRING_TX_BROADCAST	"tx_broadcast"
+#define ETH_GSTRING_TX_DROPPED		"tx_dropped"
+
 /**
  * enum ethtool_stringset - string set ID
  * @ETH_SS_TEST: Self-test result names, for use with %ETHTOOL_TEST
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help