[PATCH v2] RDMA/cma: Use a separate lockdep class for the listening cm_id

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Nov 19 18:43:48 PST 2026


Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] RDMA/cma: missing Signed-off-by trailer in commit message
- [High] RDMA: debug msleep() in siw_accept(), nvme_rdma_alloc_queue(),
  and nvmet_rdma
--

commit e60962bf8161cfd3de3b001dc6bdc13944ed9245
Author: Shin'ichiro Kawasaki <shinichiro.kawasaki at wdc.com>

> RDMA/cma: Use a separate lockdep class for the listening cm_id
>
> On Nov 18, 2026 / 20:53, Shin'ichiro Kawasaki wrote:
> > On Nov 17, 2026 / 11:48, sashiko-bot at kernel.org wrote:
> > > Thank you for your contribution! Sashiko AI review found 2 potential
> > > issues to consider:
> > > - [Medium] RDMA/cma: unsafe lockdep_set_class() placement in
> > >   rdma_listen()
> > > - [Low] RDMA/cma: unreclassified handler_mutex on
> > >   nvmet_rdma_enable_port() error
> >
> > I think the two issues are valid. The first one means that the approach
> > to reclassify ids in rdma_listen() does not work well. I will think about other
> > solutions. One idea is to go back to the solutions to add a new function to
> > create rdma id. The other idea is to reclassify the rdma ids not for
> > listening. I will try if these approach can address the sashiko issues.
>
> While I worked on the new patch to reclassify the rdma ids not for listening
> but for other requests, I ran a local Sashiko review on it before posting.
> Sashiko made the comment below, quote:

[Severity: High]
The commit message is missing a Signed-off-by: trailer, which is required
under the Developer's Certificate of Origin.

> diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c
> index ed49818793dde..bea7c7aacd678 100644
> --- a/drivers/infiniband/sw/siw/siw_cm.c
> +++ b/drivers/infiniband/sw/siw/siw_cm.c
> @@ -1738,6 +1738,7 @@ int siw_accept(struct iw_cm_id *id, struct iw_cm_conn_param *params)
>  		siw_sk_assign_rtr_upcalls(cep);
>  	} else {
>  		siw_qp_socket_assoc(cep, qp);
> +		msleep(300); /* REPRO: let the host send before ESTABLISHED */
>  		rv = siw_cm_upcall(cep, IW_CM_EVENT_ESTABLISHED, 0);
>  		if (rv)
>  			goto error;
> diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c
> index 32189fdfc0f51..e8c55dfad9d54 100644
> --- a/drivers/nvme/host/rdma.c
> +++ b/drivers/nvme/host/rdma.c
> @@ -583,6 +583,8 @@ static int nvme_rdma_alloc_queue(struct nvme_rdma_queue *queue)
>  	struct sockaddr *src_addr = NULL;
>  	int ret;
>  
> +	if (idx == 2)
> +		msleep(1000); /* REPRO: connect I/O queue 2 later */
>  	mutex_init(&queue->queue_lock);
>  	if (idx && ctrl->ctrl.max_integrity_segments)
>  		queue->pi_support = true;
> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
> index f386c388da188..cde0315ae71e4 100644
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -1673,6 +1673,8 @@ static void nvmet_rdma_queue_established(struct nvmet_rdma_queue *queue)
>  {
>  	unsigned long flags;
>  
> +	if (queue->host_qid)
> +		msleep(10000); /* REPRO: give time to unlink the port */
>  	spin_lock_irqsave(&queue->state_lock, flags);
>  	if (queue->state != NVMET_RDMA_Q_CONNECTING) {
>  		pr_warn("trying to establish a connected queue\n");

[Severity: High]
Were these debug reproducer msleep() calls committed by mistake instead of
the lockdep class change described in the subject?

In nvmet_rdma_queue_established(), sleeping for 10 seconds on every I/O
queue runs inside the RDMA_CM_EVENT_ESTABLISHED callback under
id_priv->handler_mutex on the single-threaded ordered iwcm_wq workqueue.
This stalls CM event processing and rdma_destroy_id() for 10 seconds per
I/O queue, exceeds the default 5-second NVMe admin keep-alive timeout, and
forces open the nvmet_config_sem deadlock window.  siw_accept() and
nvme_rdma_alloc_queue() likewise add unconditional 300 ms and 1000 ms
delays during connection establishment.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/av-vJXx2CZppcnAW@shinmob?part=1



More information about the Linux-nvme mailing list