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 v4 08/10] RDMA/mana_ib: Flush and notify CQs when kernel QPs enter ERR
Date: Sat, 10 Oct 2026 07:15:12 +0000	[thread overview]
Message-ID: <sashiko-outbox-166306@kernel.org> (raw)
In-Reply-To: <20261010065443.3554193-9-kotaranov@linux.microsoft.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] rdma/mana_ib: dead code - qp->state is write-only and never read
--

commit 77c71a02dc85cc117e4f58d2a8f85635639fc4ac
Author: Konstantin Taranov <kotaranov@microsoft.com>

    RDMA/mana_ib: Flush and notify CQs when kernel QPs enter ERR
    
    Complete the RC software flush path by adding a kernel QP to the CQ
    error lists when it transitions to the ERR state.
    
    Invoke the CQ handlers after the transition to flush pending work
    requests.

> diff --git a/drivers/infiniband/hw/mana/mana_ib.h b/drivers/infiniband/hw/mana/mana_ib.h
> index 55899b1e2f868..a72bed94c08d7 100644
> --- a/drivers/infiniband/hw/mana/mana_ib.h
> +++ b/drivers/infiniband/hw/mana/mana_ib.h
> @@ -271,6 +271,7 @@ struct mana_ib_qp {
>  	bool pending_mmq_fence;
>  	bool sq_sig_all;
>  	enum ib_mtu mtu;
> +	enum ib_qp_state state;
>  
>  	/* Serializes receive WR posting. */
>  	spinlock_t rq_lock;

[ ... ]

> diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c
> index 74cf80074e54f..31e91cc657ac7 100644
> --- a/drivers/infiniband/hw/mana/qp.c
> +++ b/drivers/infiniband/hw/mana/qp.c

[ ... ]

> @@ -1049,6 +1071,11 @@ static void mana_ib_modify_qp_state(struct ib_qp *ibqp, struct ib_qp_attr *attr,
>  		default:
>  			break;
>  		}
> +		qp->state = attr->qp_state;

[Severity: Low]
Is this state field ever read? 

It appears to be write-only in the driver, including in subsequent patches in
the series. Could this field be removed to save memory and avoid unnecessary
instructions?

> +		if (attr->qp_state == IB_QPS_ERR) {
> +			mana_add_qp_to_error_cqs(qp);
> +			notify = true;
> +		}
>  	}
>  
>  	if (attr_mask & IB_QP_SQ_PSN) {

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

  reply	other threads:[~2026-10-10  7:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10  6:54 [PATCH rdma-next v4 00/10] RDMA/mana_ib: Add kernel RC and fast registration support Konstantin Taranov
2026-10-10  6:54 ` [PATCH rdma-next v4 01/10] RDMA/mana_ib: Allocate and map fast-registration MRs Konstantin Taranov
2026-10-10  7:07   ` sashiko-bot
2026-10-10  6:54 ` [PATCH rdma-next v4 02/10] RDMA/mana: Create and destroy kernel RC QPs Konstantin Taranov
2026-10-10  7:11   ` sashiko-bot
2026-10-10  6:54 ` [PATCH rdma-next v4 03/10] net/mana: Extend GDMA encoding for new RDMA WQEs Konstantin Taranov
2026-10-10  7:11   ` sashiko-bot
2026-10-10  6:54 ` [PATCH rdma-next v4 04/10] RDMA/mana_ib: Maintain kernel RC QP state Konstantin Taranov
2026-10-10  7:13   ` sashiko-bot
2026-10-10  6:54 ` [PATCH rdma-next v4 05/10] RDMA/mana_ib: Post receive WRs on kernel RC QPs Konstantin Taranov
2026-10-10  7:08   ` sashiko-bot
2026-10-10  6:54 ` [PATCH rdma-next v4 06/10] RDMA/mana_ib: Post send and memory-management WRs on " Konstantin Taranov
2026-10-10  7:15   ` sashiko-bot
2026-10-10  6:54 ` [PATCH rdma-next v4 07/10] RDMA/mana_ib: Poll RC completions using PSN and FSN progress Konstantin Taranov
2026-10-10  7:11   ` sashiko-bot
2026-10-10  6:54 ` [PATCH rdma-next v4 08/10] RDMA/mana_ib: Flush and notify CQs when kernel QPs enter ERR Konstantin Taranov
2026-10-10  7:15   ` sashiko-bot [this message]
2026-10-10  6:54 ` [PATCH rdma-next v4 09/10] RDMA/mana_ib: Handle error CQEs for RC QPs Konstantin Taranov
2026-10-10  7:11   ` sashiko-bot
2026-10-10  6:54 ` [PATCH rdma-next v4 10/10] RDMA/mana_ib: Drain kernel receive and send queues Konstantin Taranov
2026-10-10  7:13   ` 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=sashiko-outbox-166306@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