From owner-svn-src-all@freebsd.org Thu May 16 17:16:33 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 550FE159FE28; Thu, 16 May 2019 17:16:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E65418DE7E; Thu, 16 May 2019 17:16:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD4E623DE6; Thu, 16 May 2019 17:16:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4GHGWva099049; Thu, 16 May 2019 17:16:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GHGWWO099047; Thu, 16 May 2019 17:16:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905161716.x4GHGWWO099047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 16 May 2019 17:16:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347804 - in stable/11/sys/dev/mlx5: . mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_en X-SVN-Commit-Revision: 347804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E65418DE7E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 May 2019 17:16:33 -0000 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 {