lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190128234507.32028-11-jakub.kicinski@netronome.com>
Date:   Mon, 28 Jan 2019 15:45:03 -0800
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     davem@...emloft.net
Cc:     oss-drivers@...ronome.com, netdev@...r.kernel.org,
        jiri@...nulli.us, f.fainelli@...il.com, andrew@...n.ch,
        mkubecek@...e.cz, dsahern@...il.com, simon.horman@...ronome.com,
        jesse.brandeburg@...el.com, maciejromanfijalkowski@...il.com,
        vasundhara-v.volam@...adcom.com, michael.chan@...adcom.com,
        shalomt@...lanox.com, idosch@...lanox.com,
        Jakub Kicinski <jakub.kicinski@...ronome.com>
Subject: [RFC 10/14] net: hstats: add IEEE 802.3 and common IETF MIB/RMON stats

Add IDs for standard-based counters commonly maintained by ethernet
hardware (IEEE 802.3, IETF RFC2819, IETF RFC2863).  The lists are
not intended to be complete, reserve some ID space for adding
more stats in the middle if they are found useful later.

Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
---
 include/net/hstats.h         | 50 ++++++++++++++++++++++++++++++++++++
 include/uapi/linux/if_link.h | 50 ++++++++++++++++++++++++++++++++++++
 2 files changed, 100 insertions(+)

diff --git a/include/net/hstats.h b/include/net/hstats.h
index bb83f50768b1..dd6d5dc567cb 100644
--- a/include/net/hstats.h
+++ b/include/net/hstats.h
@@ -101,6 +101,56 @@ enum {
 	RTNL_HSTAT_BIT(LINUX_CSUM_COMPLETE, 0),
 	RTNL_HSTAT_BIT(LINUX_CSUM_UNNECESSARY, 0),
 	RTNL_HSTAT_BIT(LINUX_SEGMENTATION_OFFLOAD_PKTS, 0),
+
+	/* IETF RFC2819 ("Remote Network Monitoring MIB") */
+	RTNL_HSTAT_BIT(RFC2819_etherStatsDropEvents, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsOctets, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsPkts, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsBroadcastPkts, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsMulticastPkts, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsCRCAlignErrors, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsUndersizePkts, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsOversizePkts, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsFragments, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsJabbers, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsCollisions, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsPkts64Octets, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsPkts65to127Octets, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsPkts128to255Octets, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsPkts256to511Octets, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsPkts512to1023Octets, 1),
+	RTNL_HSTAT_BIT(RFC2819_etherStatsPkts1024to1518Octets, 1),
+	/* Extensions to IETF RFC2819 */
+	RTNL_HSTAT_BIT(RFC2819EXT_etherStatsPkts1024toMaxOctets, 1),
+	RTNL_HSTAT_BIT(RFC2819EXT_etherStatsPkts1519toMaxOctets, 1),
+	RTNL_HSTAT_BIT(RFC2819EXT_etherStatsPkts1024to2047Octets, 1),
+	RTNL_HSTAT_BIT(RFC2819EXT_etherStatsPkts2048to4095Octets, 1),
+	RTNL_HSTAT_BIT(RFC2819EXT_etherStatsPkts4096to8191Octets, 1),
+	RTNL_HSTAT_BIT(RFC2819EXT_etherStatsPkts8192toMaxOctets, 1),
+
+	/* IETF RFC2863 ("The Interfaces Group MIB") */
+	RTNL_HSTAT_BIT(RFC2863_UcastPkts, 1),
+	RTNL_HSTAT_BIT(RFC2863_Errors, 1),
+	RTNL_HSTAT_BIT(RFC2863_Discards, 1),
+
+	/* IEEE 802.3 */
+	RTNL_HSTAT_BIT(IEEE8023_FramesOK, 2),
+	RTNL_HSTAT_BIT(IEEE8023_OctetsOK, 2),
+	RTNL_HSTAT_BIT(IEEE8023_MulticastFramesOK, 2),
+	RTNL_HSTAT_BIT(IEEE8023_BroadcastFramesOK, 2),
+	RTNL_HSTAT_BIT(IEEE8023_FrameCheckSequenceErrors, 2),
+	RTNL_HSTAT_BIT(IEEE8023_AlignmentErrors, 2),
+	RTNL_HSTAT_BIT(IEEE8023_InRangeLengthErrors, 2),
+	RTNL_HSTAT_BIT(IEEE8023_OutOfRangeLengthField, 2),
+	RTNL_HSTAT_BIT(IEEE8023_FrameTooLongErrors, 2),
+	RTNL_HSTAT_BIT(IEEE8023_CollisionFrames, 2),
+	RTNL_HSTAT_BIT(IEEE8023_SQETestErrors, 2),
+	RTNL_HSTAT_BIT(IEEE8023_SymbolErrorDuringCarrier, 2),
+	RTNL_HSTAT_BIT(IEEE8023_MACControlFrames, 2),
+	RTNL_HSTAT_BIT(IEEE8023_UnsupportedOpcodes, 2),
+	RTNL_HSTAT_BIT(IEEE8023_PAUSEMACCtrlFrames, 2),
+	RTNL_HSTAT_BIT(IEEE8023_FECCorrectedBlocks, 2),
+	RTNL_HSTAT_BIT(IEEE8023_FECUncorrectableBlocks, 2),
 #undef RTNL_HSTAT_BIT
 };
 
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index b33d38ff5b47..c58468100a06 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -982,6 +982,56 @@ enum {
 	IFLA_HSTATS_STAT_LINUX_CSUM_UNNECESSARY,
 	IFLA_HSTATS_STAT_LINUX_SEGMENTATION_OFFLOAD_PKTS,
 
+	/* IETF RFC2819 ("Remote Network Monitoring MIB") */
+	IFLA_HSTATS_STAT_RFC2819_etherStatsDropEvents = 65, /* 1 */
+	IFLA_HSTATS_STAT_RFC2819_etherStatsOctets,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsPkts,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsBroadcastPkts,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsMulticastPkts,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsCRCAlignErrors,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsUndersizePkts,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsOversizePkts,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsFragments,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsJabbers,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsCollisions,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsPkts64Octets,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsPkts65to127Octets,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsPkts128to255Octets,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsPkts256to511Octets,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsPkts512to1023Octets,
+	IFLA_HSTATS_STAT_RFC2819_etherStatsPkts1024to1518Octets,
+	/* Extensions to IETF RFC2819 */
+	IFLA_HSTATS_STAT_RFC2819EXT_etherStatsPkts1024toMaxOctets,
+	IFLA_HSTATS_STAT_RFC2819EXT_etherStatsPkts1519toMaxOctets,
+	IFLA_HSTATS_STAT_RFC2819EXT_etherStatsPkts1024to2047Octets,
+	IFLA_HSTATS_STAT_RFC2819EXT_etherStatsPkts2048to4095Octets,
+	IFLA_HSTATS_STAT_RFC2819EXT_etherStatsPkts4096to8191Octets,
+	IFLA_HSTATS_STAT_RFC2819EXT_etherStatsPkts8192toMaxOctets,
+
+	/* IETF RFC2863 ("The Interfaces Group MIB") */
+	IFLA_HSTATS_STAT_RFC2863_UcastPkts = 97,
+	IFLA_HSTATS_STAT_RFC2863_Errors,
+	IFLA_HSTATS_STAT_RFC2863_Discards,
+
+	/* IEEE 802.3 */
+	IFLA_HSTATS_STAT_IEEE8023_FramesOK = 129, /* 2 */
+	IFLA_HSTATS_STAT_IEEE8023_OctetsOK,
+	IFLA_HSTATS_STAT_IEEE8023_MulticastFramesOK,
+	IFLA_HSTATS_STAT_IEEE8023_BroadcastFramesOK,
+	IFLA_HSTATS_STAT_IEEE8023_FrameCheckSequenceErrors,
+	IFLA_HSTATS_STAT_IEEE8023_AlignmentErrors,
+	IFLA_HSTATS_STAT_IEEE8023_InRangeLengthErrors,
+	IFLA_HSTATS_STAT_IEEE8023_OutOfRangeLengthField,
+	IFLA_HSTATS_STAT_IEEE8023_FrameTooLongErrors,
+	IFLA_HSTATS_STAT_IEEE8023_CollisionFrames,
+	IFLA_HSTATS_STAT_IEEE8023_SQETestErrors,
+	IFLA_HSTATS_STAT_IEEE8023_SymbolErrorDuringCarrier,
+	IFLA_HSTATS_STAT_IEEE8023_MACControlFrames,
+	IFLA_HSTATS_STAT_IEEE8023_UnsupportedOpcodes,
+	IFLA_HSTATS_STAT_IEEE8023_PAUSEMACCtrlFrames,
+	IFLA_HSTATS_STAT_IEEE8023_FECCorrectedBlocks,
+	IFLA_HSTATS_STAT_IEEE8023_FECUncorrectableBlocks,
+
 	__IFLA_HSTATS_STAT_MAX,
 };
 #define IFLA_HSTATS_STAT_MAX (__IFLA_HSTATS_STAT_MAX - 1)
-- 
2.19.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ