netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Tariq Toukan <tariqt@nvidia.com>, Jakub Kicinski <kuba@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Mark Bloch <mbloch@nvidia.com>,
	Dragos Tatulea <dtatulea@nvidia.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, virtualization@lists.linux.dev,
	Gal Pressman <gal@nvidia.com>, Edward Srouji <edwards@nvidia.com>,
	Moshe Shemesh <moshe@nvidia.com>,
	Akiva Goldberger <agoldberger@nvidia.com>
Subject: Re: [PATCH net] mlx5: Fix default values in create CQ
Date: Sun, 9 Nov 2025 13:54:02 +0200	[thread overview]
Message-ID: <20251109115402.GJ15456@unreal> (raw)
In-Reply-To: <1762681743-1084694-1-git-send-email-tariqt@nvidia.com>

On Sun, Nov 09, 2025 at 11:49:03AM +0200, Tariq Toukan wrote:
> From: Akiva Goldberger <agoldberger@nvidia.com>
> 
> Currently, CQs without a completion function are assigned the
> mlx5_add_cq_to_tasklet function by default. This is problematic since
> only user CQs created through the mlx5_ib driver are intended to use
> this function.
> 
> Additionally, all CQs that will use doorbells instead of polling for
> completions must call mlx5_cq_arm. However, the default CQ creation flow
> leaves a valid value in the CQ's arm_db field, allowing FW to send
> interrupts to polling-only CQs in certain corner cases.
> 
> These two factors would allow a polling-only kernel CQ to be triggered
> by an EQ interrupt and call a completion function intended only for user
> CQs, causing a null pointer exception.
> 
> Some areas in the driver have prevented this issue with one-off fixes
> but did not address the root cause.
> 
> This patch fixes the described issue by adding defaults to the create CQ
> flow. It adds a default dummy completion function to protect against
> null pointer exceptions, and it sets an invalid command sequence number
> by default in kernel CQs to prevent the FW from sending an interrupt to
> the CQ until it is armed. User CQs are responsible for their own
> initialization values.
> 
> Callers of mlx5_core_create_cq are responsible for changing the
> completion function and arming the CQ per their needs.
> 
> Fixes: cdd04f4d4d71 ("net/mlx5: Add support to create SQ and CQ for ASO")
> Signed-off-by: Akiva Goldberger <agoldberger@nvidia.com>
> Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
> ---
>  drivers/infiniband/hw/mlx5/cq.c               | 11 +++++---

It can safely go to net as we already sent our rdma-rc PR to Linus
and won't have any fixes in drivers/infiniband/hw/mlx5/cq.c in this
cycle.

Acked-by: Leon Romanovsky <leon@kernel.org>

Thanks

>  drivers/net/ethernet/mellanox/mlx5/core/cq.c  | 23 +++++++++++++--
>  .../net/ethernet/mellanox/mlx5/core/en_main.c |  1 -
>  .../ethernet/mellanox/mlx5/core/fpga/conn.c   | 15 +++++-----
>  .../mellanox/mlx5/core/steering/hws/send.c    |  7 -----
>  .../mellanox/mlx5/core/steering/sws/dr_send.c | 28 +++++--------------
>  drivers/vdpa/mlx5/net/mlx5_vnet.c             |  6 ++--
>  include/linux/mlx5/cq.h                       |  1 +
>  8 files changed, 44 insertions(+), 48 deletions(-)

  reply	other threads:[~2025-11-09 11:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-09  9:49 [PATCH net] mlx5: Fix default values in create CQ Tariq Toukan
2025-11-09 11:54 ` Leon Romanovsky [this message]
2025-11-11 14:20 ` patchwork-bot+netdevbpf

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=20251109115402.GJ15456@unreal \
    --to=leon@kernel.org \
    --cc=agoldberger@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dtatulea@nvidia.com \
    --cc=edumazet@google.com \
    --cc=edwards@nvidia.com \
    --cc=gal@nvidia.com \
    --cc=jasowang@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mbloch@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=virtualization@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).