From owner-svn-src-all@freebsd.org Thu May 16 16:32:24 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 C7E4F159DC90; Thu, 16 May 2019 16:32:23 +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 6EFF18A3FF; Thu, 16 May 2019 16:32:23 +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 4A0A623700; Thu, 16 May 2019 16:32:23 +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 x4GGWNoq075145; Thu, 16 May 2019 16:32:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4GGWMLm075060; Thu, 16 May 2019 16:32:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201905161632.x4GGWMLm075060@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 16:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347772 - in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 347772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6EFF18A3FF 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.98)[-0.980,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 16:32:24 -0000 Author: hselasky Date: Thu May 16 16:32:22 2019 New Revision: 347772 URL: https://svnweb.freebsd.org/changeset/base/347772 Log: MFC r347307: Update performance counter bits in mlx5core. Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c stable/12/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Thu May 16 16:31:39 2019 (r347771) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Thu May 16 16:32:22 2019 (r347772) @@ -231,13 +231,13 @@ int mlx5_core_get_diagnostics_full(struct mlx5_core_de MLX5_REG_MPCNT, 0, 0); if (err == 0) { void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, - counter_set.pcie_performance_counters_data_layout); + counter_set.pcie_perf_counters); pdiag->counter.rx_pci_errors = - MLX5_GET(pcie_performance_counters_data_layout, + MLX5_GET(pcie_perf_counters, pcounters, rx_errors); pdiag->counter.tx_pci_errors = - MLX5_GET(pcie_performance_counters_data_layout, + MLX5_GET(pcie_perf_counters, pcounters, tx_errors); } MLX5_SET(mpcnt_reg, in, grp, @@ -247,13 +247,13 @@ int mlx5_core_get_diagnostics_full(struct mlx5_core_de MLX5_REG_MPCNT, 0, 0); if (err == 0) { void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, - counter_set.pcie_timers_and_states_data_layout); + counter_set.pcie_timers_states); pdiag->counter.tx_pci_non_fatal_errors = - MLX5_GET(pcie_timers_and_states_data_layout, + MLX5_GET(pcie_timers_states, pcounters, non_fatal_err_msg_sent); pdiag->counter.tx_pci_fatal_errors = - MLX5_GET(pcie_timers_and_states_data_layout, + MLX5_GET(pcie_timers_states, pcounters, fatal_err_msg_sent); } kvfree(in); Modified: stable/12/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_ifc.h Thu May 16 16:31:39 2019 (r347771) +++ stable/12/sys/dev/mlx5/mlx5_ifc.h Thu May 16 16:32:22 2019 (r347772) @@ -9868,11 +9868,89 @@ struct mlx5_ifc_ppcnt_reg_bits { union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits counter_set; }; -struct mlx5_ifc_pcie_performance_counters_data_layout_bits { +struct mlx5_ifc_pcie_lanes_counters_bits { u8 life_time_counter_high[0x20]; u8 life_time_counter_low[0x20]; + u8 error_counter_lane0[0x20]; + + u8 error_counter_lane1[0x20]; + + u8 error_counter_lane2[0x20]; + + u8 error_counter_lane3[0x20]; + + u8 error_counter_lane4[0x20]; + + u8 error_counter_lane5[0x20]; + + u8 error_counter_lane6[0x20]; + + u8 error_counter_lane7[0x20]; + + u8 error_counter_lane8[0x20]; + + u8 error_counter_lane9[0x20]; + + u8 error_counter_lane10[0x20]; + + u8 error_counter_lane11[0x20]; + + u8 error_counter_lane12[0x20]; + + u8 error_counter_lane13[0x20]; + + u8 error_counter_lane14[0x20]; + + u8 error_counter_lane15[0x20]; + + u8 reserved_at_240[0x580]; +}; + +struct mlx5_ifc_pcie_lanes_counters_ext_bits { + u8 reserved_at_0[0x40]; + + u8 error_counter_lane0[0x20]; + + u8 error_counter_lane1[0x20]; + + u8 error_counter_lane2[0x20]; + + u8 error_counter_lane3[0x20]; + + u8 error_counter_lane4[0x20]; + + u8 error_counter_lane5[0x20]; + + u8 error_counter_lane6[0x20]; + + u8 error_counter_lane7[0x20]; + + u8 error_counter_lane8[0x20]; + + u8 error_counter_lane9[0x20]; + + u8 error_counter_lane10[0x20]; + + u8 error_counter_lane11[0x20]; + + u8 error_counter_lane12[0x20]; + + u8 error_counter_lane13[0x20]; + + u8 error_counter_lane14[0x20]; + + u8 error_counter_lane15[0x20]; + + u8 reserved_at_240[0x580]; +}; + +struct mlx5_ifc_pcie_perf_counters_bits { + u8 life_time_counter_high[0x20]; + + u8 life_time_counter_low[0x20]; + u8 rx_errors[0x20]; u8 tx_errors[0x20]; @@ -9889,10 +9967,46 @@ struct mlx5_ifc_pcie_performance_counters_data_layout_ u8 crc_error_tlp[0x20]; - u8 reserved_0[0x680]; + u8 tx_overflow_buffer_pkt[0x40]; + + u8 outbound_stalled_reads[0x20]; + + u8 outbound_stalled_writes[0x20]; + + u8 outbound_stalled_reads_events[0x20]; + + u8 outbound_stalled_writes_events[0x20]; + + u8 tx_overflow_buffer_marked_pkt[0x40]; + + u8 reserved_at_240[0x580]; }; -struct mlx5_ifc_pcie_timers_and_states_data_layout_bits { +struct mlx5_ifc_pcie_perf_counters_ext_bits { + u8 reserved_at_0[0x40]; + + u8 rx_errors[0x20]; + + u8 tx_errors[0x20]; + + u8 reserved_at_80[0xc0]; + + u8 tx_overflow_buffer_pkt[0x40]; + + u8 outbound_stalled_reads[0x20]; + + u8 outbound_stalled_writes[0x20]; + + u8 outbound_stalled_reads_events[0x20]; + + u8 outbound_stalled_writes_events[0x20]; + + u8 tx_overflow_buffer_marked_pkt[0x40]; + + u8 reserved_at_240[0x580]; +}; + +struct mlx5_ifc_pcie_timers_states_bits { u8 life_time_counter_high[0x20]; u8 life_time_counter_low[0x20]; @@ -9939,66 +10053,97 @@ struct mlx5_ifc_pcie_timers_and_states_data_layout_bit u8 fatal_err_msg_sent[0x20]; - u8 reserved_0[0x4e0]; + u8 reserved_at_2e0[0x4e0]; }; -struct mlx5_ifc_pcie_lanes_counters_data_layout_bits { - u8 life_time_counter_high[0x20]; +struct mlx5_ifc_pcie_timers_states_ext_bits { + u8 reserved_at_0[0x40]; - u8 life_time_counter_low[0x20]; + u8 time_to_boot_image_start[0x20]; - u8 error_counter_lane0[0x20]; + u8 time_to_link_image[0x20]; - u8 error_counter_lane1[0x20]; + u8 calibration_time[0x20]; - u8 error_counter_lane2[0x20]; + u8 time_to_first_perst[0x20]; - u8 error_counter_lane3[0x20]; + u8 time_to_detect_state[0x20]; - u8 error_counter_lane4[0x20]; + u8 time_to_l0[0x20]; - u8 error_counter_lane5[0x20]; + u8 time_to_crs_en[0x20]; - u8 error_counter_lane6[0x20]; + u8 time_to_plastic_image_start[0x20]; - u8 error_counter_lane7[0x20]; + u8 time_to_iron_image_start[0x20]; - u8 error_counter_lane8[0x20]; + u8 perst_handler[0x20]; - u8 error_counter_lane9[0x20]; + u8 times_in_l1[0x20]; - u8 error_counter_lane10[0x20]; + u8 times_in_l23[0x20]; - u8 error_counter_lane11[0x20]; + u8 dl_down[0x20]; - u8 error_counter_lane12[0x20]; + u8 config_cycle1usec[0x20]; - u8 error_counter_lane13[0x20]; + u8 config_cycle2to7usec[0x20]; - u8 error_counter_lane14[0x20]; + u8 config_cycle8to15usec[0x20]; - u8 error_counter_lane15[0x20]; + u8 config_cycle16to63usec[0x20]; - u8 reserved_0[0x580]; + u8 config_cycle64usec[0x20]; + + u8 correctable_err_msg_sent[0x20]; + + u8 non_fatal_err_msg_sent[0x20]; + + u8 fatal_err_msg_sent[0x20]; + + u8 reserved_at_2e0[0x4e0]; }; -union mlx5_ifc_mpcnt_cntrs_grp_data_layout_bits { - struct mlx5_ifc_pcie_performance_counters_data_layout_bits pcie_performance_counters_data_layout; - struct mlx5_ifc_pcie_timers_and_states_data_layout_bits pcie_timers_and_states_data_layout; - struct mlx5_ifc_pcie_lanes_counters_data_layout_bits pcie_lanes_counters_data_layout; - u8 reserved_0[0xf8]; +union mlx5_ifc_mpcnt_reg_counter_set_auto_bits { + struct mlx5_ifc_pcie_perf_counters_bits pcie_perf_counters; + struct mlx5_ifc_pcie_lanes_counters_bits pcie_lanes_counters; + struct mlx5_ifc_pcie_timers_states_bits pcie_timers_states; + u8 reserved_at_0[0x7c0]; }; +union mlx5_ifc_mpcnt_reg_counter_set_auto_ext_bits { + struct mlx5_ifc_pcie_perf_counters_ext_bits pcie_perf_counters_ext; + struct mlx5_ifc_pcie_lanes_counters_ext_bits pcie_lanes_counters_ext; + struct mlx5_ifc_pcie_timers_states_ext_bits pcie_timers_states_ext; + u8 reserved_at_0[0x7c0]; +}; + struct mlx5_ifc_mpcnt_reg_bits { - u8 reserved_0[0x8]; + u8 reserved_at_0[0x2]; + u8 depth[0x6]; u8 pcie_index[0x8]; - u8 reserved_1[0xa]; + u8 node[0x8]; + u8 reserved_at_18[0x2]; u8 grp[0x6]; u8 clr[0x1]; - u8 reserved_2[0x1f]; + u8 reserved_at_21[0x1f]; - union mlx5_ifc_mpcnt_cntrs_grp_data_layout_bits counter_set; + union mlx5_ifc_mpcnt_reg_counter_set_auto_bits counter_set; +}; + +struct mlx5_ifc_mpcnt_reg_ext_bits { + u8 reserved_at_0[0x2]; + u8 depth[0x6]; + u8 pcie_index[0x8]; + u8 node[0x8]; + u8 reserved_at_18[0x2]; + u8 grp[0x6]; + + u8 clr[0x1]; + u8 reserved_at_21[0x1f]; + + union mlx5_ifc_mpcnt_reg_counter_set_auto_ext_bits counter_set; }; enum {