All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: sashiko-reviews@lists.linux.dev
Cc: linux-rdma@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH v5 08/10] vfio: selftests: Add mlx5 driver - HW init and command interface
Date: Fri, 11 Sep 2026 15:37:03 -0300	[thread overview]
Message-ID: <20260911183703.GA1350659@nvidia.com> (raw)
In-Reply-To: <20260910235832.4B4E51F000FF@smtp.kernel.org>

On Thu, Sep 10, 2026 at 11:58:31PM +0000, sashiko-bot@kernel.org wrote:
> > +static void mlx5st_query_fl_caps(struct mlx5st_device *dev)
> > +{
> > +	u32 out[MLX5_ST_SZ_DW(query_hca_cap_out)] = {};
> > +	u32 in[MLX5_ST_SZ_DW(query_hca_cap_in)] = {};
> > +	bool fl_roce_en, fl_roce_dis;
> > +
> > +	/* Query RoCE capabilities */
> > +	MLX5_SET(query_hca_cap_in, in, opcode, MLX5_CMD_OP_QUERY_HCA_CAP);
> > +	MLX5_SET(query_hca_cap_in, in, op_mod,
> > +		 MLX5_SET_HCA_CAP_OP_MOD_ROCE | HCA_CAP_OPMOD_GET_CUR);
> 
> [Severity: Medium]
> Does the MLX5_SET_HCA_CAP_OP_MOD_ROCE constant need to be shifted left by 1?
> 
> If the constant is defined as 0x4, passing it unshifted results in an op_mod
> of 5. This causes the hardware to interpret bits 15:1 as capability type 2
> (MLX5_CAP_ODP) instead of RoCE, causing the driver to query the wrong
> capabilities.

This looks correct, I will fix it and repost

For the others, the driver does not validate fw information (aka hardening)

Jason

  reply	other threads:[~2026-09-11 18:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 23:57 [PATCH v5 00/10] mlx5 support for VFIO self test Jason Gunthorpe
2026-09-09 23:57 ` [PATCH v5 01/10] net/mlx5: Add IFC structures for CQE and WQE Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 02/10] net/mlx5: Move HW constant groups from device.h/cq.h to mlx5_ifc.h Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 03/10] net/mlx5: Extract MLX5_SET/GET macros into mlx5_ifc_macros.h Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 04/10] net/mlx5: Add ONCE and MMIO accessor variants to mlx5_ifc_macros.h Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 05/10] selftests: Add additional kernel functions to tools/include/ Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 06/10] vfio: selftests: Allow drivers to specify required region size Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 07/10] vfio: selftests: Add dev_dbg Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 08/10] vfio: selftests: Add mlx5 driver - HW init and command interface Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-11 18:37     ` Jason Gunthorpe [this message]
2026-09-09 23:57 ` [PATCH v5 09/10] vfio: selftests: Add mlx5 driver - data path and memcpy ops Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot
2026-09-09 23:57 ` [PATCH v5 10/10] vfio: selftests: mlx5 driver - add send_msi support Jason Gunthorpe
2026-09-10 23:58   ` sashiko-bot

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=20260911183703.GA1350659@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.