svn commit: r347804 - in stable/11/sys/dev/mlx5: . mlx5_en
Hans Petter Selasky
hselasky at FreeBSD.org
Thu May 16 17:16:33 UTC 2019
Author: hselasky
Date: Thu May 16 17:16:31 2019
New Revision: 347804
URL: https://svnweb.freebsd.org/changeset/base/347804
Log:
MFC r347254:
Update Ethernet extended counters in mlx5en(4).
Expose all Ethernet extended counters those counters via debug_stats
sysctl:
dev.mce.X.debug_stats
Submitted by: slavash@
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/dev/mlx5/mlx5_en/en.h
stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
stable/11/sys/dev/mlx5/mlx5_ifc.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu May 16 17:15:41 2019 (r347803)
+++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu May 16 17:16:31 2019 (r347804)
@@ -254,6 +254,28 @@ struct mlx5e_vport_stats {
m(+1, u64 out_multicast_pkts, "out_multicast_pkts", "Out multicast packets") \
m(+1, u64 out_broadcast_pkts, "out_broadcast_pkts", "Out broadcast packets")
+#define MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(m) \
+ m(+1, u64 port_transmit_wait_high, "port_transmit_wait_high", "Port transmit wait high") \
+ m(+1, u64 ecn_marked, "ecn_marked", "ECN marked") \
+ m(+1, u64 no_buffer_discard_mc, "no_buffer_discard_mc", "No buffer discard mc") \
+ m(+1, u64 rx_ebp, "rx_ebp", "RX EBP") \
+ m(+1, u64 tx_ebp, "tx_ebp", "TX EBP") \
+ m(+1, u64 rx_buffer_almost_full, "rx_buffer_almost_full", "RX buffer almost full") \
+ m(+1, u64 rx_buffer_full, "rx_buffer_full", "RX buffer full") \
+ m(+1, u64 rx_icrc_encapsulated, "rx_icrc_encapsulated", "RX ICRC encapsulated") \
+ m(+1, u64 ex_reserved_0, "ex_reserved_0", "Reserved") \
+ m(+1, u64 ex_reserved_1, "ex_reserved_1", "Reserved") \
+ m(+1, u64 tx_stat_p64octets, "tx_stat_p64octets", "Bytes") \
+ m(+1, u64 tx_stat_p65to127octets, "tx_stat_p65to127octets", "Bytes") \
+ m(+1, u64 tx_stat_p128to255octets, "tx_stat_p128to255octets", "Bytes") \
+ m(+1, u64 tx_stat_p256to511octets, "tx_stat_p256to511octets", "Bytes") \
+ m(+1, u64 tx_stat_p512to1023octets, "tx_stat_p512to1023octets", "Bytes") \
+ m(+1, u64 tx_stat_p1024to1518octets, "tx_stat_p1024to1518octets", "Bytes") \
+ m(+1, u64 tx_stat_p1519to2047octets, "tx_stat_p1519to2047octets", "Bytes") \
+ m(+1, u64 tx_stat_p2048to4095octets, "tx_stat_p2048to4095octets", "Bytes") \
+ m(+1, u64 tx_stat_p4096to8191octets, "tx_stat_p4096to8191octets", "Bytes") \
+ m(+1, u64 tx_stat_p8192to10239octets, "tx_stat_p8192to10239octets", "Bytes")
+
#define MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) \
m(+1, u64 time_since_last_clear, "time_since_last_clear", \
"Time since the last counters clear event (msec)") \
@@ -348,7 +370,8 @@ struct mlx5e_vport_stats {
#define MLX5E_PORT_STATS_DEBUG(m) \
MLX5E_PPORT_RFC2819_STATS_DEBUG(m) \
MLX5E_PPORT_RFC2863_STATS_DEBUG(m) \
- MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m)
+ MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(m) \
+ MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(m)
#define MLX5E_PPORT_IEEE802_3_STATS_NUM \
(0 MLX5E_PPORT_IEEE802_3_STATS(MLX5E_STATS_COUNT))
@@ -365,6 +388,8 @@ struct mlx5e_vport_stats {
(0 MLX5E_PPORT_RFC2863_STATS_DEBUG(MLX5E_STATS_COUNT))
#define MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM \
(0 MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG(MLX5E_STATS_COUNT))
+#define MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG_NUM \
+ (0 MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG(MLX5E_STATS_COUNT))
#define MLX5E_PORT_STATS_DEBUG_NUM \
(0 MLX5E_PORT_STATS_DEBUG(MLX5E_STATS_COUNT))
Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu May 16 17:15:41 2019 (r347803)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu May 16 17:16:31 2019 (r347804)
@@ -440,6 +440,12 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv)
for (x = 0; x != MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM; x++, y++)
s_debug->arg[y] = be64toh(ptr[x]);
+ /* read Extended Ethernet counter group using predefined counter layout */
+ MLX5_SET(ppcnt_reg, in, grp, MLX5_ETHERNET_EXTENDED_COUNTERS_GROUP);
+ mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0);
+ for (x = 0; x != MLX5E_PPORT_ETHERNET_EXTENDED_STATS_DEBUG_NUM; x++, y++)
+ s_debug->arg[y] = be64toh(ptr[x]);
+
/* read per-priority counters */
MLX5_SET(ppcnt_reg, in, grp, MLX5_PER_PRIORITY_COUNTERS_GROUP);
@@ -453,6 +459,7 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv)
MLX5E_PPORT_PER_PRIO_STATS_NUM_PRIO); x++, y++)
s->arg[y] = be64toh(ptr[x]);
}
+
free_out:
/* free firmware request structures */
kvfree(in);
Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_ifc.h Thu May 16 17:15:41 2019 (r347803)
+++ stable/11/sys/dev/mlx5/mlx5_ifc.h Thu May 16 17:16:31 2019 (r347804)
@@ -8752,7 +8752,69 @@ struct mlx5_ifc_eth_extended_cntrs_grp_data_layout_bit
u8 no_buffer_discard_mc_low[0x20];
- u8 reserved_0[0x700];
+ u8 rx_ebp_high[0x20];
+
+ u8 rx_ebp_low[0x20];
+
+ u8 tx_ebp_high[0x20];
+
+ u8 tx_ebp_low[0x20];
+
+ u8 rx_buffer_almost_full_high[0x20];
+
+ u8 rx_buffer_almost_full_low[0x20];
+
+ u8 rx_buffer_full_high[0x20];
+
+ u8 rx_buffer_full_low[0x20];
+
+ u8 rx_icrc_encapsulated_high[0x20];
+
+ u8 rx_icrc_encapsulated_low[0x20];
+
+ u8 reserved_0[0x80];
+
+ u8 tx_stats_pkts64octets_high[0x20];
+
+ u8 tx_stats_pkts64octets_low[0x20];
+
+ u8 tx_stats_pkts65to127octets_high[0x20];
+
+ u8 tx_stats_pkts65to127octets_low[0x20];
+
+ u8 tx_stats_pkts128to255octets_high[0x20];
+
+ u8 tx_stats_pkts128to255octets_low[0x20];
+
+ u8 tx_stats_pkts256to511octets_high[0x20];
+
+ u8 tx_stats_pkts256to511octets_low[0x20];
+
+ u8 tx_stats_pkts512to1023octets_high[0x20];
+
+ u8 tx_stats_pkts512to1023octets_low[0x20];
+
+ u8 tx_stats_pkts1024to1518octets_high[0x20];
+
+ u8 tx_stats_pkts1024to1518octets_low[0x20];
+
+ u8 tx_stats_pkts1519to2047octets_high[0x20];
+
+ u8 tx_stats_pkts1519to2047octets_low[0x20];
+
+ u8 tx_stats_pkts2048to4095octets_high[0x20];
+
+ u8 tx_stats_pkts2048to4095octets_low[0x20];
+
+ u8 tx_stats_pkts4096to8191octets_high[0x20];
+
+ u8 tx_stats_pkts4096to8191octets_low[0x20];
+
+ u8 tx_stats_pkts8192to10239octets_high[0x20];
+
+ u8 tx_stats_pkts8192to10239octets_low[0x20];
+
+ u8 reserved_1[0x2C0];
};
struct mlx5_ifc_eth_802_3_cntrs_grp_data_layout_bits {
More information about the svn-src-all
mailing list