From: Moshe Shemesh Struct mlx5_ifc_nic_cap_reg_bits describes only the first 4 dwords of NIC_CAP_REG, while the register itself is 32 dwords long. The driver reads the register through mlx5_core_access_reg(), which derives the access length from the struct size, so today it issues a partial read. Partial reads of a register using access reg command are accepted by the device, hence nothing is broken and no fix is needed. It does mean, though, that naming any field deeper in the register changes the length requested on the wire as a side effect. Describe NIC_CAP_REG up to its full size, as is done for the other register layouts in mlx5_ifc.h, so that the access length is fixed and further fields can be added without altering it. Signed-off-by: Moshe Shemesh Reviewed-by: Shay Drori Signed-off-by: Tariq Toukan --- include/linux/mlx5/mlx5_ifc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index a7cf67264a17..04300c8765a0 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -3448,7 +3448,7 @@ struct mlx5_ifc_nic_cap_reg_bits { u8 vhca_icm_ctrl[0x1]; u8 reserved_at_1b[0x5]; - u8 reserved_at_20[0x60]; + u8 reserved_at_20[0x3e0]; }; struct mlx5_ifc_default_timeout_bits { -- 2.44.0 From: Moshe Shemesh Add the sw_roce_monitor_matched_packets counter to the query_vnic_env command output. The counter reports the number of packets generated by the Ethernet SQs of the vNIC that matched the configured SW RoCE monitor classifier. Additionally, add the NIC_CAP_REG capability field sw_roce_monitor_classifier. The field is a bitmask of the supported classifiers, of which only bit 0, RoCEv2, is currently defined. Signed-off-by: Moshe Shemesh Reviewed-by: Shay Drori Signed-off-by: Tariq Toukan --- include/linux/mlx5/mlx5_ifc.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 04300c8765a0..06e17581fa51 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -3448,7 +3448,13 @@ struct mlx5_ifc_nic_cap_reg_bits { u8 vhca_icm_ctrl[0x1]; u8 reserved_at_1b[0x5]; - u8 reserved_at_20[0x3e0]; + u8 reserved_at_20[0x80]; + + u8 reserved_at_a0[0x4]; + u8 sw_roce_monitor_classifier[0x4]; + u8 reserved_at_a8[0x18]; + + u8 reserved_at_c0[0x340]; }; struct mlx5_ifc_default_timeout_bits { @@ -4077,7 +4083,11 @@ struct mlx5_ifc_vnic_diagnostic_statistics_bits { u8 odp_remote_triggered_page_fault[0x20]; - u8 reserved_at_3c0[0xc20]; + u8 reserved_at_3e0[0x20]; + + u8 sw_roce_monitor_matched_packets[0x20]; + + u8 reserved_at_420[0xbe0]; }; struct mlx5_ifc_traffic_counter_bits { -- 2.44.0 From: Chris Mi FW exposes a new PCI PF type value (0x2) in QUERY_ESW_FUNCTIONS to identify the querying PF itself, allowing the driver to read its own host_number from the firmware response. Signed-off-by: Chris Mi Reviewed-by: Shay Drori Reviewed-by: Parav Pandit Signed-off-by: Tariq Toukan --- include/linux/mlx5/mlx5_ifc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 06e17581fa51..cb9b8a908523 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -12913,6 +12913,7 @@ enum mlx5_ifc_vhca_state { enum { MLX5_PCI_PF_TYPE_EXTERNAL_HOST_PF = 0x0, MLX5_PCI_PF_TYPE_SATELLITE_PF = 0x1, + MLX5_PCI_PF_TYPE_QUERY_PF = 0x2, }; struct mlx5_ifc_network_function_params_bits { -- 2.44.0