Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx5: Add RS FEC histogram infrastructure

Define the Ports Phy Histogram Configuration Register (PPHCR) to expose
RS-FEC histogram bin ranges, and expose a new counter group in the Ports
Performance Counters Register (PPCNT) to report the corresponding
histogram values.

Co-developed-by: Yael Chemla <ychemla@nvidia.com>
Signed-off-by: Yael Chemla <ychemla@nvidia.com>
Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1756884600-520195-1-git-send-email-tariqt@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Carolina Jubran and committed by
Leon Romanovsky
ff97bc38 04a3134f

+31
+1
include/linux/mlx5/device.h
··· 1525 1525 MLX5_PHYSICAL_LAYER_RECOVERY_GROUP = 0x1a, 1526 1526 MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20, 1527 1527 MLX5_INFINIBAND_EXTENDED_PORT_COUNTERS_GROUP = 0x21, 1528 + MLX5_RS_FEC_HISTOGRAM_GROUP = 0x23, 1528 1529 }; 1529 1530 1530 1531 enum {
+1
include/linux/mlx5/driver.h
··· 130 130 MLX5_REG_PDDR = 0x5031, 131 131 MLX5_REG_PMLP = 0x5002, 132 132 MLX5_REG_PPLM = 0x5023, 133 + MLX5_REG_PPHCR = 0x503E, 133 134 MLX5_REG_PCAM = 0x507f, 134 135 MLX5_REG_NODE_DESC = 0x6001, 135 136 MLX5_REG_HOST_ENDIANNESS = 0x7004,
+29
include/linux/mlx5/mlx5_ifc.h
··· 4901 4901 u8 reserved_at_0[0x20]; 4902 4902 }; 4903 4903 4904 + struct mlx5_ifc_rs_histogram_cntrs_bits { 4905 + u8 hist[16][0x40]; 4906 + u8 reserved_at_400[0x2c0]; 4907 + }; 4908 + 4904 4909 union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits { 4905 4910 struct mlx5_ifc_eth_802_3_cntrs_grp_data_layout_bits eth_802_3_cntrs_grp_data_layout; 4906 4911 struct mlx5_ifc_eth_2863_cntrs_grp_data_layout_bits eth_2863_cntrs_grp_data_layout; ··· 4920 4915 struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs; 4921 4916 struct mlx5_ifc_phys_layer_statistical_cntrs_bits phys_layer_statistical_cntrs; 4922 4917 struct mlx5_ifc_phys_layer_recovery_cntrs_bits phys_layer_recovery_cntrs; 4918 + struct mlx5_ifc_rs_histogram_cntrs_bits rs_histogram_cntrs; 4923 4919 u8 reserved_at_0[0x7c0]; 4924 4920 }; 4925 4921 ··· 11744 11738 u8 second_clock_timestamp[0x40]; 11745 11739 }; 11746 11740 11741 + struct mlx5_ifc_bin_range_layout_bits { 11742 + u8 reserved_at_0[0xa]; 11743 + u8 high_val[0x6]; 11744 + u8 reserved_at_10[0xa]; 11745 + u8 low_val[0x6]; 11746 + }; 11747 + 11748 + struct mlx5_ifc_pphcr_reg_bits { 11749 + u8 active_hist_type[0x4]; 11750 + u8 reserved_at_4[0x4]; 11751 + u8 local_port[0x8]; 11752 + u8 reserved_at_10[0x10]; 11753 + 11754 + u8 reserved_at_20[0x8]; 11755 + u8 num_of_bins[0x8]; 11756 + u8 reserved_at_30[0x10]; 11757 + 11758 + u8 reserved_at_40[0x40]; 11759 + 11760 + struct mlx5_ifc_bin_range_layout_bits bin_range[16]; 11761 + }; 11762 + 11747 11763 union mlx5_ifc_ports_control_registers_document_bits { 11748 11764 struct mlx5_ifc_bufferx_reg_bits bufferx_reg; 11749 11765 struct mlx5_ifc_eth_2819_cntrs_grp_data_layout_bits eth_2819_cntrs_grp_data_layout; ··· 11832 11804 struct mlx5_ifc_mtmp_reg_bits mtmp_reg; 11833 11805 struct mlx5_ifc_mtptm_reg_bits mtptm_reg; 11834 11806 struct mlx5_ifc_mtctr_reg_bits mtctr_reg; 11807 + struct mlx5_ifc_pphcr_reg_bits pphcr_reg; 11835 11808 u8 reserved_at_0[0x60e0]; 11836 11809 }; 11837 11810