[PATCH mlx5-next 1/3] net/mlx5: Extend nic_cap_reg layout to its full register size

From: Tariq Toukan

Date: Mon Nov 16 2026 - 09:48:08 EST


From: Moshe Shemesh <moshe@xxxxxxxxxx>

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@xxxxxxxxxx>
Reviewed-by: Shay Drori <shayd@xxxxxxxxxx>
Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>
---
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