Skip to contentSkip to conversation

Add standard stats for HSR/PRP

PATCH In review MD Danish Anwar 2 participants 6 messages Jun 11 – Jun 12

Subsystems (5)
lore
Share & tools
lore

MD Danish Anwar

author reviewer
#0 lore raw

v4 cover Add standard stats for HSR/PRP

Add standard stats for HSR / PRP. This series was initially adding HSR/PRP related stats for ICSSG driver. Based on maintainers' comments on v2 I am now adding support to dump standard stats for HSR/PRP.

The drivers which support offload can populate these standard stats.

This series only implements offloaded stats. For software-only interfaces Felix Maurer had said he will do it later [1]

v3 - v4:
*) Address AI review comments on Patch 1/3 and Patch 3/3. AI review comments on patch 2/3 were not relevant to this series.

v3 https://lore.kernel.org/all/[email protected]/
v2 https://lore.kernel.org/all/[email protected]/
[1] https://lore.kernel.org/all/ag87pBZfOyccPZTc@thinkpad/

Cc Jakub Kicinski <[email protected]>
Cc Felix Maurer <[email protected]>
Cc Luka Gejak <[email protected]>

MD Danish Anwar (3):
net: hsr: Add standard LRE stats via RTM_GETSTATS /
IFLA_STATS_LINK_XSTATS
net: ti: icssg: Add static_assert to guard stat array counts
net: ti: icssg: Add HSR offload statistics support

 .../ethernet/ti/icssg_prueth.rst              |  19 +++
 drivers/net/ethernet/ti/icssg/icssg_common.c  |   7 +-
 drivers/net/ethernet/ti/icssg/icssg_ethtool.c |  10 +-
 drivers/net/ethernet/ti/icssg/icssg_prueth.c  |  92 +++++++++++++
 drivers/net/ethernet/ti/icssg/icssg_prueth.h  |  10 +-
 drivers/net/ethernet/ti/icssg/icssg_stats.c   |   6 +-
 drivers/net/ethernet/ti/icssg/icssg_stats.h   |  89 +++++++-----
 .../net/ethernet/ti/icssg/icssg_switch_map.h  |  10 ++
 include/linux/if_hsr.h                        |  48 +++++++
 include/uapi/linux/hsr_netlink.h              |  56 ++++++++
 include/uapi/linux/if_link.h                  |   2 +
 net/hsr/hsr_netlink.c                         | 130 ++++++++++++++++--
 tools/include/uapi/linux/if_link.h            |   2 +
 13 files changed, 427 insertions(+), 54 deletions(-)

base-commit: 0068940907d33217ae01217f84910a5cde606c17

Signature · 1 line
2.34.1
author reviewer
#1 lore raw

PATCH v4 1/3 net: hsr: Add standard LRE stats via RTM_GETSTATS / IFLA_STATS_LINK_XSTATS

Per the IEC-62439-3 specification the Link Redundancy Entity (LRE) maintains a well-defined set of counters applicable to both software and offloaded HSR/PRP implementations. Define these counters as individual netlink attributes inside a LINK_XSTATS_TYPE_HSR nest, following the approach used by bridge and bond with IFLA_STATS_LINK_XSTATS.

The full IEC-62439-3 MIB counter set is represented, with per-port (A, B, C) granularity where applicable:

lreCntTx{A,B,C} - sent HSR/PRP tagged frames per port
lreCntRx{A,B,C} - received HSR/PRP tagged frames per port
lreCntErrWrongLan{A,B,C} - received frames with wrong LAN ID (PRP)
lreCntErrors{A,B,C} - received frames with errors per port

  lreCntUnique{A,B,C}       - frames received without duplicate
  lreCntDuplicate{A,B,C}    - frames received with exactly one duplicate
  lreCntMulti{A,B,C}        - frames received with more than one duplicate
  lreCntOwnRx{A,B}          - own-address frames received (HSR only)

Each counter is encoded as its own HSR_XSTATS_* u64 netlink attribute. Unsupported counters are initialised to ~0ULL by the kernel and omitted from the netlink reply; user-space must treat an absent attribute as "not available".

The UAPI attribute enum (HSR_XSTATS_*) is added to hsr_netlink.h. LINK_XSTATS_TYPE_HSR is added to the LINK_XSTATS_TYPE_* enum in both include/uapi/linux/if_link.h and tools/include/uapi/linux/if_link.h.

A kernel-internal struct hsr_lre_stats (in linux/if_hsr.h) is provided for offload drivers to fill via ndo_get_offload_stats. Unsupported fields must be left at the ~0ULL value initialised by the HSR layer before calling the NDO.

The HSR stack calls ndo_get_offload_stats on slave A to collect offload counters.

---
 include/linux/if_hsr.h             |  48 +++++++++++
 include/uapi/linux/hsr_netlink.h   |  56 +++++++++++++
 include/uapi/linux/if_link.h       |   2 +
 net/hsr/hsr_netlink.c              | 130 +++++++++++++++++++++++++++--
 tools/include/uapi/linux/if_link.h |   2 +
 5 files changed, 230 insertions(+), 8 deletions(-)
include/linux/if_hsr.h +48 -0
index f4cf2dd36d193..b8c20f0906194 100644
@@ -38,6 +38,54 @@ struct hsr_tag {
 
 #define HSR_HLEN	6
 
+/**
+ * struct hsr_lre_stats - Kernel-internal IEC-62439-3 LRE counter set.
+ *
+ * This is the buffer type written by ndo_get_offload_stats() when called
+ * with attr_id == IFLA_STATS_LINK_XSTATS on an HSR slave device.  Each
+ * field maps to one HSR_XSTATS_* netlink attribute.  Fields that the
+ * offload driver does not support must be left at the initialised value of
+ * ~0ULL; the HSR layer will skip those when building the netlink reply.
+ *
+ * Per-port suffix: _a = port A (slave 1 / LAN-A),
+ *                  _b = port B (slave 2 / LAN-B),
+ *                  _c = interlink / application interface.
+ *
+ * @cnt_tx_a: lreCntTxA - sent HSR/PRP tagged frames on port A.
+ * @cnt_tx_b: lreCntTxB - sent HSR/PRP tagged frames on port B.
+ * @cnt_tx_c: lreCntTxC - sent HSR/PRP tagged frames on port C.
+ * @cnt_rx_a: lreCntRxA - received HSR/PRP tagged frames on port A.
+ * @cnt_rx_b: lreCntRxB - received HSR/PRP tagged frames on port B.
+ * @cnt_rx_c: lreCntRxC - received HSR/PRP tagged frames on port C.
+ * @cnt_err_wrong_lan_a: lreCntErrWrongLanA - wrong LAN ID frames on port A.
+ * @cnt_err_wrong_lan_b: lreCntErrWrongLanB - wrong LAN ID frames on port B.
+ * @cnt_err_wrong_lan_c: lreCntErrWrongLanC - wrong LAN ID frames on port C.
+ * @cnt_errors_a: lreCntErrorsA - received frames with errors on port A.
+ * @cnt_errors_b: lreCntErrorsB - received frames with errors on port B.
+ * @cnt_errors_c: lreCntErrorsC - received frames with errors on port C.
+ * @cnt_unique_a: lreCntUniqueA - frames received without duplicate on port A.
+ * @cnt_unique_b: lreCntUniqueB - frames received without duplicate on port B.
+ * @cnt_unique_c: lreCntUniqueC - frames received without duplicate on port C.
+ * @cnt_duplicate_a: lreCntDuplicateA - frames with one duplicate on port A.
+ * @cnt_duplicate_b: lreCntDuplicateB - frames with one duplicate on port B.
+ * @cnt_duplicate_c: lreCntDuplicateC - frames with one duplicate on port C.
+ * @cnt_multi_a: lreCntMultiA - frames with more than one duplicate on port A.
+ * @cnt_multi_b: lreCntMultiB - frames with more than one duplicate on port B.
+ * @cnt_multi_c: lreCntMultiC - frames with more than one duplicate on port C.
+ * @cnt_own_rx_a: lreCntOwnRxA - own-address frames received on port A.
+ * @cnt_own_rx_b: lreCntOwnRxB - own-address frames received on port B.
+ */
+struct hsr_lre_stats {
+	u64 cnt_tx_a, cnt_tx_b, cnt_tx_c;
+	u64 cnt_rx_a, cnt_rx_b, cnt_rx_c;
+	u64 cnt_err_wrong_lan_a, cnt_err_wrong_lan_b, cnt_err_wrong_lan_c;
+	u64 cnt_errors_a, cnt_errors_b, cnt_errors_c;
+	u64 cnt_unique_a, cnt_unique_b, cnt_unique_c;
+	u64 cnt_duplicate_a, cnt_duplicate_b, cnt_duplicate_c;
+	u64 cnt_multi_a, cnt_multi_b, cnt_multi_c;
+	u64 cnt_own_rx_a, cnt_own_rx_b;
+};
+
 #if IS_ENABLED(CONFIG_HSR)
 extern bool is_hsr_master(struct net_device *dev);
 extern int hsr_get_version(struct net_device *dev, enum hsr_version *ver);
include/uapi/linux/hsr_netlink.h +56 -0

60 lines not on this page · raw message

include/uapi/linux/if_link.h +2 -0
index 79ce4bc24cba6..11458f683624a 100644
@@ -1905,6 +1905,7 @@ enum {
 	LINK_XSTATS_TYPE_UNSPEC,
 	LINK_XSTATS_TYPE_BRIDGE,
 	LINK_XSTATS_TYPE_BOND,
+	LINK_XSTATS_TYPE_HSR,
 	__LINK_XSTATS_TYPE_MAX
 };
 #define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
@@ -1915,6 +1916,7 @@ enum {
 	IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
 	IFLA_OFFLOAD_XSTATS_HW_S_INFO,	/* HW stats info. A nest */
 	IFLA_OFFLOAD_XSTATS_L3_STATS,	/* struct rtnl_hw_stats64 */
+	IFLA_OFFLOAD_XSTATS_LRE_STATS,	/* struct hsr_lre_stats */
 	__IFLA_OFFLOAD_XSTATS_MAX
 };
 #define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
net/hsr/hsr_netlink.c +122 -8

143 lines not on this page · raw message

tools/include/uapi/linux/if_link.h +2 -0
index 7e46ca4cd31bb..ed4e6d53ccbab 100644
@@ -1844,6 +1844,7 @@ enum {
 	LINK_XSTATS_TYPE_UNSPEC,
 	LINK_XSTATS_TYPE_BRIDGE,
 	LINK_XSTATS_TYPE_BOND,
+	LINK_XSTATS_TYPE_HSR,
 	__LINK_XSTATS_TYPE_MAX
 };
 #define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
@@ -1854,6 +1855,7 @@ enum {
 	IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
 	IFLA_OFFLOAD_XSTATS_HW_S_INFO,	/* HW stats info. A nest */
 	IFLA_OFFLOAD_XSTATS_L3_STATS,	/* struct rtnl_hw_stats64 */
+	IFLA_OFFLOAD_XSTATS_LRE_STATS,	/* struct hsr_lre_stats */
 	__IFLA_OFFLOAD_XSTATS_MAX
 };
 #define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
Signature · 1 line
2.34.1
author reviewer
#2 lore raw

PATCH v4 2/3 net: ti: icssg: Add static_assert to guard stat array counts

In reply to MD Danish Anwar

Place static_assert() immediately after each of icssg_all_miig_stats[] and icssg_all_pa_stats[] in icssg_stats.h to verify at build time that ICSSG_NUM_MIIG_STATS and ICSSG_NUM_PA_STATS stay in sync with the actual array sizes. This turns a silent miscount into a build error should either the constant or the array be updated independently.

---
 drivers/net/ethernet/ti/icssg/icssg_stats.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/ti/icssg/icssg_stats.h +4 -0
index 5ec0b38e0c67d..6f4400d8a0f61 100644
@@ -155,6 +155,8 @@ static const struct icssg_miig_stats icssg_all_miig_stats[] = {
 	ICSSG_MIIG_STATS(tx_bytes, true),
 };
 
+static_assert(ARRAY_SIZE(icssg_all_miig_stats) == ICSSG_NUM_MIIG_STATS);
+
 #define ICSSG_PA_STATS(field)	\
 {				\
 	#field,			\
@@ -201,4 +203,6 @@ static const struct icssg_pa_stats icssg_all_pa_stats[] = {
 	ICSSG_PA_STATS(FW_HOST_EGRESS_Q_EXP_OVERFLOW),
 };
 
+static_assert(ARRAY_SIZE(icssg_all_pa_stats) == ICSSG_NUM_PA_STATS);
+
 #endif /* __NET_TI_ICSSG_STATS_H */
Signature · 1 line
2.34.1
author reviewer
#3 lore raw

PATCH v4 3/3 net: ti: icssg: Add HSR offload statistics support

In reply to MD Danish Anwar

Add support for exposing ICSSG HSR statistics through two interfaces:
ethtool and the standard RTM_GETSTATS / IFLA_STATS_LINK_XSTATS path.

Add a standard_stats flag to struct icssg_pa_stats and extend icssg_all_pa_stats[] with 10 new entries:

Firmware-specific HSR counters (standard_stats=false, ethtool only):
- FW_HSR_FWD_CHECK_FAIL_DROP
- FW_HSR_HE_CHECK_FAIL_DROP
- FW_HSR_SKIP_HOST_DUP_DISCARD

IEC 62439-3 LRE counters (standard_stats=true, excluded from ethtool):
- FW_LRE_CNT_UNIQUE_RX, FW_LRE_CNT_DUPLICATE_RX, FW_LRE_CNT_MULTIPLE_RX
- FW_LRE_CNT_RX, FW_LRE_CNT_TX, FW_LRE_CNT_OWN_RX
- FW_LRE_CNT_ERRWRONGLAN

The ethtool get_strings/get_ethtool_stats callbacks skip entries with standard_stats=true so they do not appear as ethtool counters. ICSSG_NUM_PA_STANDARD_STATS is introduced and accounted for in ICSSG_NUM_ETHTOOL_STATS so the sset count stays accurate. ICSSG_NUM_PA_STATS is updated from 32 to 42.

Implement ndo_has_offload_stats() and ndo_get_offload_stats() in emac_netdev_ops to expose the IEC 62439-3 LRE counters via the HSR stack's RTM_GETSTATS / IFLA_STATS_LINK_XSTATS interface. The HSR stack calls these NDOs on slave A; the callback reads PA stat registers for both ports (MAC0 = port A, MAC1 = port B) from the shared prueth instance and fills struct hsr_lre_stats. Port C counters are not available in ICSSG hardware and remain at ~0ULL.

Export emac_update_hardware_stats() and emac_get_stat_by_name() as GPL symbols so they can be called from icssg_prueth.c. Also change emac_get_stat_by_name() return type from int to u64 and make it return ~0ULL on an unknown stat name instead of -EINVAL, consistent with the hsr_lre_stats sentinel convention.

Add FW_HSR_FWD_CHECK_FAIL_DROP and FW_HSR_HE_CHECK_FAIL_DROP to the rx_dropped sum in ndo_get_stats64, as these represent frames discarded by the HSR forwarding logic.

---
 .../ethernet/ti/icssg_prueth.rst              | 19 ++++
 drivers/net/ethernet/ti/icssg/icssg_common.c  |  7 +-
 drivers/net/ethernet/ti/icssg/icssg_ethtool.c | 10 +-
 drivers/net/ethernet/ti/icssg/icssg_prueth.c  | 92 +++++++++++++++++++
 drivers/net/ethernet/ti/icssg/icssg_prueth.h  | 10 +-
 drivers/net/ethernet/ti/icssg/icssg_stats.c   |  6 +-
 drivers/net/ethernet/ti/icssg/icssg_stats.h   | 85 +++++++++--------
 .../net/ethernet/ti/icssg/icssg_switch_map.h  | 10 ++
 8 files changed, 193 insertions(+), 46 deletions(-)
Documentation/networking/device_drivers/ethernet/ti/icssg_prueth.rst +19 -0
index da21ddf431bbc..faa1fc18a6737 100644
@@ -54,3 +54,22 @@ These statistics are as follows,
  - ``FW_HOST_TX_PKT_CNT``: Number of valid packets copied by RTU0 to Tx queues
  - ``FW_HOST_EGRESS_Q_PRE_OVERFLOW``: Host Egress Q (Pre-emptible) Overflow Counter
  - ``FW_HOST_EGRESS_Q_EXP_OVERFLOW``: Host Egress Q (Pre-emptible) Overflow Counter
+ - ``FW_HSR_FWD_CHECK_FAIL_DROP``: Packets dropped on the HSR forwarding path due to failed checks
+ - ``FW_HSR_HE_CHECK_FAIL_DROP``: Packets dropped on the host egress path due to failed checks
+ - ``FW_HSR_SKIP_HOST_DUP_DISCARD``: Frames for which the host duplicate discard check was skipped
+
+HSR/LRE Standard Statistics
+============================
+
+When the ICSSG operates in HSR offload mode the driver exposes the IEC 62439-3
+LRE counters through the standard netlink stats interface.
+
+The following per-port (port A and port B) LRE counters are reported:
+
+ - ``lreCntTx``: Number of HSR/PRP tagged frames sent
+ - ``lreCntRx``: Number of HSR/PRP tagged frames received
+ - ``lreCntUnique``: Number of frames received with no duplicate detected
+ - ``lreCntDuplicate``: Number of frames received for which exactly one duplicate was detected
+ - ``lreCntMultiple``: Number of frames received for which more than one duplicate was detected
+ - ``lreCntOwnRx``: Number of HSR/PRP tagged frames received whose source MAC matches the node's own address
+ - ``lreCntErrWrongLan``: Number of frames received with a wrong LAN identifier (PRP only)
drivers/net/ethernet/ti/icssg/icssg_common.c +6 -1
index a28a608f9bf4b..1fcb031949535 100644
@@ -1643,7 +1643,12 @@ void icssg_ndo_get_stats64(struct net_device *ndev,
 			    emac_get_stat_by_name(emac, "FW_INF_DROP_TAGGED") +
 			    emac_get_stat_by_name(emac, "FW_INF_DROP_PRIOTAGGED") +
 			    emac_get_stat_by_name(emac, "FW_INF_DROP_NOTAG") +
-			    emac_get_stat_by_name(emac, "FW_INF_DROP_NOTMEMBER");
+			    emac_get_stat_by_name(emac,
+						  "FW_INF_DROP_NOTMEMBER") +
+			    emac_get_stat_by_name(emac,
+						  "FW_HSR_FWD_CHECK_FAIL_DROP") +
+			    emac_get_stat_by_name(emac,
+						  "FW_HSR_HE_CHECK_FAIL_DROP");
 	stats->tx_errors  = ndev->stats.tx_errors;
 	stats->tx_dropped = ndev->stats.tx_dropped +
 			    emac_get_stat_by_name(emac, "FW_RTU_PKT_DROP") +
drivers/net/ethernet/ti/icssg/icssg_ethtool.c +7 -3
index b715af21d23ac..7a99c99aab1e8 100644
@@ -74,7 +74,9 @@ static int emac_get_sset_count(struct net_device *ndev, int stringset)
 		if (emac->prueth->pa_stats)
 			return ICSSG_NUM_ETHTOOL_STATS;
 		else
-			return ICSSG_NUM_ETHTOOL_STATS - ICSSG_NUM_PA_STATS;
+			return ICSSG_NUM_ETHTOOL_STATS -
+			       (ICSSG_NUM_PA_STATS -
+				ICSSG_NUM_PA_STANDARD_STATS);
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -93,7 +95,8 @@ static void emac_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
 				ethtool_puts(&p, icssg_all_miig_stats[i].name);
 		if (emac->prueth->pa_stats)
 			for (i = 0; i < ARRAY_SIZE(icssg_all_pa_stats); i++)
-				ethtool_puts(&p, icssg_all_pa_stats[i].name);
+				if (!icssg_all_pa_stats[i].standard_stats)
+					ethtool_puts(&p, icssg_all_pa_stats[i].name);
 		break;
 	default:
 		break;
@@ -114,7 +117,8 @@ static void emac_get_ethtool_stats(struct net_device *ndev,
 
 	if (emac->prueth->pa_stats)
 		for (i = 0; i < ARRAY_SIZE(icssg_all_pa_stats); i++)
-			*(data++) = emac->pa_stats[i];
+			if (!icssg_all_pa_stats[i].standard_stats)
+				*(data++) = emac->pa_stats[i];
 }
 
 static int emac_get_ts_info(struct net_device *ndev,
drivers/net/ethernet/ti/icssg/icssg_prueth.c +92 -0

110 lines not on this page · raw message

drivers/net/ethernet/ti/icssg/icssg_prueth.h +6 -4
index df93d15c5b786..d6c221e897924 100644
@@ -57,12 +57,14 @@
 
 #define ICSSG_MAX_RFLOWS	8	/* per slice */
 
-#define ICSSG_NUM_PA_STATS	32
+#define ICSSG_NUM_PA_STATS	42
 #define ICSSG_NUM_MIIG_STATS	60
 /* Number of ICSSG related stats */
 #define ICSSG_NUM_STATS (ICSSG_NUM_MIIG_STATS + ICSSG_NUM_PA_STATS)
-#define ICSSG_NUM_STANDARD_STATS 31
-#define ICSSG_NUM_ETHTOOL_STATS (ICSSG_NUM_STATS - ICSSG_NUM_STANDARD_STATS)
+#define ICSSG_NUM_STANDARD_STATS	31
+#define ICSSG_NUM_PA_STANDARD_STATS	7
+#define ICSSG_NUM_ETHTOOL_STATS (ICSSG_NUM_STATS - ICSSG_NUM_STANDARD_STATS - \
+				 ICSSG_NUM_PA_STANDARD_STATS)
 
 #define IEP_DEFAULT_CYCLE_TIME_NS	1000000	/* 1 ms */
 
@@ -458,7 +460,7 @@ int emac_fdb_flow_id_updated(struct prueth_emac *emac);
 
 void icssg_stats_work_handler(struct work_struct *work);
 void emac_update_hardware_stats(struct prueth_emac *emac);
-int emac_get_stat_by_name(struct prueth_emac *emac, char *stat_name);
+u64 emac_get_stat_by_name(struct prueth_emac *emac, char *stat_name);
 
 /* Common functions */
 void prueth_cleanup_rx_chns(struct prueth_emac *emac,
drivers/net/ethernet/ti/icssg/icssg_stats.c +4 -2
index 7159baa0155cf..9950d0ba899fa 100644
@@ -62,6 +62,7 @@ void emac_update_hardware_stats(struct prueth_emac *emac)
 
 	spin_unlock(&prueth->stats_lock);
 }
+EXPORT_SYMBOL_GPL(emac_update_hardware_stats);
 
 void icssg_stats_work_handler(struct work_struct *work)
 {
@@ -74,7 +75,7 @@ void icssg_stats_work_handler(struct work_struct *work)
 }
 EXPORT_SYMBOL_GPL(icssg_stats_work_handler);
 
-int emac_get_stat_by_name(struct prueth_emac *emac, char *stat_name)
+u64 emac_get_stat_by_name(struct prueth_emac *emac, char *stat_name)
 {
 	int i;
 
@@ -91,5 +92,6 @@ int emac_get_stat_by_name(struct prueth_emac *emac, char *stat_name)
 	}
 
 	netdev_err(emac->ndev, "Invalid stats %s\n", stat_name);
-	return -EINVAL;
+	return ~0ULL;
 }
+EXPORT_SYMBOL_GPL(emac_get_stat_by_name);
drivers/net/ethernet/ti/icssg/icssg_stats.h +49 -36

99 lines not on this page · raw message

drivers/net/ethernet/ti/icssg/icssg_switch_map.h +10 -0
index 7e053b8af3ece..556facb33e0ce 100644
@@ -266,5 +266,15 @@
 #define FW_HOST_TX_PKT_CNT		0x0250
 #define FW_HOST_EGRESS_Q_PRE_OVERFLOW	0x0258
 #define FW_HOST_EGRESS_Q_EXP_OVERFLOW	0x0260
+#define FW_HSR_FWD_CHECK_FAIL_DROP		0x0500
+#define FW_HSR_HE_CHECK_FAIL_DROP		0x0508
+#define FW_HSR_SKIP_HOST_DUP_DISCARD		0x0510
+#define FW_LRE_CNT_UNIQUE_RX			0x0518
+#define FW_LRE_CNT_DUPLICATE_RX			0x0520
+#define FW_LRE_CNT_MULTIPLE_RX			0x0528
+#define FW_LRE_CNT_RX				0x0530
+#define FW_LRE_CNT_TX				0x0538
+#define FW_LRE_CNT_OWN_RX			0x0540
+#define FW_LRE_CNT_ERRWRONGLAN			0x0548
 
 #endif /* __NET_TI_ICSSG_SWITCH_MAP_H  */
Signature · 1 line
2.34.1
#4 lore raw
In reply to MD Danish Anwar
Quoted 8 lines · MD Danish Anwar

Add standard stats for HSR / PRP. This series was initially adding HSR/PRP related stats for ICSSG driver. Based on maintainers' comments on v2 I am now adding support to dump standard stats for HSR/PRP.

The drivers which support offload can populate these standard stats.

This series only implements offloaded stats. For software-only interfaces Felix Maurer had said he will do it later [1]

That is ideally the wrong way around. Offloading it used to accelerate what Linux can already do in software. Statistics should be part of this, you first define software statistics, and then get the hardware to report those.

So please get the software statistics merged first.

Andrew

author reviewer
#5 lore raw

Hi Andrew,

Quoted 7 lines · Andrew Lunn
Quoted 6 lines · MD Danish Anwar

Add standard stats for HSR / PRP. This series was initially adding HSR/PRP related stats for ICSSG driver. Based on maintainers' comments on v2 I am now adding support to dump standard stats for HSR/PRP.

The drivers which support offload can populate these standard stats.

Quoted 7 lines
Quoted 2 lines

This series only implements offloaded stats. For software-only interfaces Felix Maurer had said he will do it later [1]

That is ideally the wrong way around. Offloading it used to accelerate what Linux can already do in software. Statistics should be part of this, you first define software statistics, and then get the hardware to report those.

On v2 of the series Felix commented saying I should go ahead with the hardware stats first and he can later implement for software only interfaces [1]. This is the reason I went ahead with this. Initially this series was not standardizing the stats of HSR/PPR interfaces, it was only meant for dumping those stats for ICSSG via ethtool -S.

Felix and Jakub commented saying I should standardize these stats.

Hi Felix, When can you implement the same for software only interfaces? If we can't add support for hardware interfaces before software only interfaces, then what should be the next steps?

[1]
https://lore.kernel.org/all/ag87pBZfOyccPZTc@thinkpad/#:~:text=(no%20need%20to%20implement%20it%20for%20the%20software%2Donly%20interfaces%0Ain%20this%20patch%20series%2C%20I%20can%20do%20that%20afterwards%20as%20well)

Quoted 4 lines

So please get the software statistics merged first.

Andrew

Signature · 2 lines
Thanks and Regards,
Danish