Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Konstantin Taranov" <kotaranov@linux.microsoft.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next v2 07/10] RDMA/mana_ib: Poll RC completions using PSN and FSN progress
Date: Sat, 03 Oct 2026 06:54:03 +0000	[thread overview]
Message-ID: <20261003065404.440381F0089B@smtp.kernel.org> (raw)
In-Reply-To: <20261003064037.2092669-8-kotaranov@linux.microsoft.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] rdma/mana_ib: unmasked 25-bit PSN passed to hardware doorbell
--

commit 19943f505ee2f816323601ebe8474e1ded5ddb62
Author: Konstantin Taranov <kotaranov@microsoft.com>

    RDMA/mana_ib: Poll RC completions using PSN and FSN progress

    Decode RC receive completions, armed-PSN notifications, and MMQ
    completions. Retire requester and MMQ shadow entries using their
    sequence numbers, honor cross-queue fence dependencies, and suppress
    successful WCs for unsignaled work requests.

> diff --git a/drivers/infiniband/hw/mana/cq.c b/drivers/infiniband/hw/mana/cq.c
> --- a/drivers/infiniband/hw/mana/cq.c
> +++ b/drivers/infiniband/hw/mana/cq.c

[ ... ]

> @@ -390,17 +422,104 @@ static void handle_rq_cqe(struct mana_ib_qp *qp, struct gdma_comp *cqe,

[ ... ]

> +static bool handle_psn_cqe(struct mana_ib_qp *qp, u32 psn,
> +			   struct mana_cq_poll *poll)
> +{
> +	struct mana_ib_dev *mdev = container_of(qp->ibqp.device, struct mana_ib_dev, ib_dev);
> +	struct shadow_wqe_header *shadow_wqe;
> +	struct gdma_queue *recv_q;
> +	bool consumed;
> +	u32 arm_psn;
> +
> +	if (qp->ibqp.qp_type != IB_QPT_RC)
> +		return true;
> +
> +	recv_q = qp->rc_qp.queues[MANA_RC_RECV_QUEUE_REQUESTER].kmem;
> +
> +	consumed = mana_advance_send(qp, false, psn, poll);
> +	if (consumed) {
> +		shadow_wqe = shadow_queue_get_next_to_signal(&qp->shadow_sq);
> +		arm_psn = shadow_wqe ? shadow_wqe->wqe_offset_or_psn : psn + 1;
> +		mana_gd_wq_ring_doorbell_ext(mdev_to_gc(mdev), recv_q, arm_psn,
> +					     SET_ARM_BIT, MANA_PSN_CLIENT_OFFSET);

[Severity: High]
Does this code allow an unmasked 25-bit PSN to be passed to the hardware
doorbell?

If a packet with a PSN of 0xFFFFFF completes and there are no pending signaled
WQEs, shadow_wqe will be NULL, and psn + 1 will evaluate to 0x1000000.

This could cause arm_psn to be set to 0x1000000, which is then passed to
mana_gd_wq_ring_doorbell_ext() and written into the 32-bit tail_ptr field
of the hardware doorbell register.

Could this stall a long-running RC connection and cause it to fail to receive
completions when its PSN wraps? Any application transferring enough data to wrap
the 24-bit PSN (approximately 16 million packets) might trigger this behavior.

> +	}
> +
> +	return consumed;
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261003064037.2092669-1-kotaranov@linux.microsoft.com?part=7

  reply	other threads:[~2026-10-03  6:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-03  6:40 [PATCH rdma-next v2 00/10] RDMA/mana_ib: Add kernel RC and fast registration support Konstantin Taranov
2026-10-03  6:40 ` [PATCH rdma-next v2 01/10] RDMA/mana_ib: Allocate and map fast-registration MRs Konstantin Taranov
2026-10-03  6:55   ` sashiko-bot
2026-10-03  6:40 ` [PATCH rdma-next v2 02/10] RDMA/mana: Create and destroy kernel RC QPs Konstantin Taranov
2026-10-03  6:55   ` sashiko-bot
2026-10-03  6:40 ` [PATCH rdma-next v2 03/10] net/mana: Extend GDMA encoding for new RDMA WQEs Konstantin Taranov
2026-10-03  6:55   ` sashiko-bot
2026-10-03  6:40 ` [PATCH rdma-next v2 04/10] RDMA/mana_ib: Maintain kernel RC QP state Konstantin Taranov
2026-10-03  6:54   ` sashiko-bot
2026-10-03  6:40 ` [PATCH rdma-next v2 05/10] RDMA/mana_ib: Post receive WRs on kernel RC QPs Konstantin Taranov
2026-10-03  6:51   ` sashiko-bot
2026-10-03  6:40 ` [PATCH rdma-next v2 06/10] RDMA/mana_ib: Post send and memory-management WRs on " Konstantin Taranov
2026-10-03  6:58   ` sashiko-bot
2026-10-03  6:40 ` [PATCH rdma-next v2 07/10] RDMA/mana_ib: Poll RC completions using PSN and FSN progress Konstantin Taranov
2026-10-03  6:54   ` sashiko-bot [this message]
2026-10-03  6:40 ` [PATCH rdma-next v2 08/10] RDMA/mana_ib: Flush and notify CQs when kernel QPs enter ERR Konstantin Taranov
2026-10-03  6:58   ` sashiko-bot
2026-10-03  6:40 ` [PATCH rdma-next v2 09/10] RDMA/mana_ib: Handle error CQEs for RC QPs Konstantin Taranov
2026-10-03  6:53   ` sashiko-bot
2026-10-03  6:40 ` [PATCH rdma-next v2 10/10] RDMA/mana_ib: Drain kernel receive and send queues Konstantin Taranov
2026-10-03  7:01   ` 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=20261003065404.440381F0089B@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kotaranov@linux.microsoft.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox