Netdev List
 help / color / mirror / Atom feed
From: Tariq Toukan <tariqt@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>, <linux-rdma@vger.kernel.org>,
	"Mark Bloch" <mbloch@nvidia.com>, <netdev@vger.kernel.org>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Tariq Toukan <tariqt@nvidia.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>, Chris Mi <cmi@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	"Gal Pressman" <gal@nvidia.com>, Jakub Kicinski <kuba@kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Moshe Shemesh <moshe@nvidia.com>, Paolo Abeni <pabeni@redhat.com>,
	Parav Pandit <parav@nvidia.com>, Shay Drori <shayd@nvidia.com>
Subject: [PATCH mlx5-next 1/3] net/mlx5: Extend nic_cap_reg layout to its full register size
Date: Mon, 16 Nov 2026 16:45:52 +0200	[thread overview]
Message-ID: <20261116144554.1194389-2-tariqt@nvidia.com> (raw)
In-Reply-To: <20261116144554.1194389-1-tariqt@nvidia.com>

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


  reply	other threads:[~2026-11-16 14:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116144554.1194389-2-tariqt@nvidia.com \
    --to=tariqt@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=cmi@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parav@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=shayd@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox