* [PATCH mlx5-next 1/3] net/mlx5: Extend nic_cap_reg layout to its full register size
2026-11-16 14:45 [PATCH mlx5-next 0/3] mlx5-next updates 2026-11-16 Tariq Toukan
@ 2026-11-16 14:45 ` Tariq Toukan
2026-11-16 14:45 ` [PATCH mlx5-next 2/3] net/mlx5: Add IFC bits for SW RoCE monitor matched packets counter Tariq Toukan
2026-11-16 14:45 ` [PATCH mlx5-next 3/3] net/mlx5: Add MLX5_PCI_PF_TYPE_QUERY_PF to mlx5_ifc Tariq Toukan
2 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2026-11-16 14:45 UTC (permalink / raw)
To: Leon Romanovsky, linux-rdma, Mark Bloch, netdev, Saeed Mahameed,
Tariq Toukan
Cc: Andrew Lunn, Chris Mi, David S. Miller, Eric Dumazet,
Gal Pressman, Jakub Kicinski, open list, Moshe Shemesh,
Paolo Abeni, Parav Pandit, Shay Drori
From: Moshe Shemesh <moshe@nvidia.com>
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 <moshe@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
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
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH mlx5-next 2/3] net/mlx5: Add IFC bits for SW RoCE monitor matched packets counter
2026-11-16 14:45 [PATCH mlx5-next 0/3] mlx5-next updates 2026-11-16 Tariq Toukan
2026-11-16 14:45 ` [PATCH mlx5-next 1/3] net/mlx5: Extend nic_cap_reg layout to its full register size Tariq Toukan
@ 2026-11-16 14:45 ` Tariq Toukan
2026-11-16 14:45 ` [PATCH mlx5-next 3/3] net/mlx5: Add MLX5_PCI_PF_TYPE_QUERY_PF to mlx5_ifc Tariq Toukan
2 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2026-11-16 14:45 UTC (permalink / raw)
To: Leon Romanovsky, linux-rdma, Mark Bloch, netdev, Saeed Mahameed,
Tariq Toukan
Cc: Andrew Lunn, Chris Mi, David S. Miller, Eric Dumazet,
Gal Pressman, Jakub Kicinski, open list, Moshe Shemesh,
Paolo Abeni, Parav Pandit, Shay Drori
From: Moshe Shemesh <moshe@nvidia.com>
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 <moshe@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
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
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH mlx5-next 3/3] net/mlx5: Add MLX5_PCI_PF_TYPE_QUERY_PF to mlx5_ifc
2026-11-16 14:45 [PATCH mlx5-next 0/3] mlx5-next updates 2026-11-16 Tariq Toukan
2026-11-16 14:45 ` [PATCH mlx5-next 1/3] net/mlx5: Extend nic_cap_reg layout to its full register size Tariq Toukan
2026-11-16 14:45 ` [PATCH mlx5-next 2/3] net/mlx5: Add IFC bits for SW RoCE monitor matched packets counter Tariq Toukan
@ 2026-11-16 14:45 ` Tariq Toukan
2 siblings, 0 replies; 4+ messages in thread
From: Tariq Toukan @ 2026-11-16 14:45 UTC (permalink / raw)
To: Leon Romanovsky, linux-rdma, Mark Bloch, netdev, Saeed Mahameed,
Tariq Toukan
Cc: Andrew Lunn, Chris Mi, David S. Miller, Eric Dumazet,
Gal Pressman, Jakub Kicinski, open list, Moshe Shemesh,
Paolo Abeni, Parav Pandit, Shay Drori
From: Chris Mi <cmi@nvidia.com>
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 <cmi@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
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
^ permalink raw reply [flat|nested] 4+ messages in thread