Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: nikhil.rao@amd.com
Cc: brett.creeley@amd.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, abhijit.gangurde@amd.com, allen.hubbe@amd.com,
	jgg@ziepe.ca, leon@kernel.org, jiri@resnulli.us,
	horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org,
	rdunlap@infradead.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-doc@vger.kernel.org, eric.joyner@amd.com,
	ArunKumar.Prakash@amd.com
Subject: Re: [PATCH net-next v3 2/3] RDMA/ionic: Use the ionic command timeout for the admin queue
Date: Mon, 23 Nov 2026 00:59:54 +0000	[thread overview]
Message-ID: <179539559480.3135.11592624744457325166@kernel.org> (raw)
In-Reply-To: <20261119-b4-ionic-cmd-timeout-v3-2-2cdb8fca15fd@amd.com>

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 0 · Low: 1

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] The fix is incomplete: a firmware command that takes 2-5 s,
  which the commit message says is within contract, can still reset the…
- [Low] The commit fixes a user-visible bug but has no Fixes: tag.

--

RDMA/ionic: Use the ionic command timeout for the admin queue

This commit changes the RDMA admin queue watchdog timeout from a fixed
2 seconds to HZ * ionic_cmd_timeout(), which is 5 seconds by default.
The goal is that firmware latency within the ionic command timeout no
longer resets the RDMA LIF. The AH create/destroy busy-wait keeps its
fixed 2 second bound.

> diff --git a/drivers/infiniband/hw/ionic/ionic_admin.c b/drivers/infiniband/hw/ionic/ionic_admin.c
> index 0ccd869ad8e6a..b463ad8b4e804 100644
> --- a/drivers/infiniband/hw/ionic/ionic_admin.c
> +++ b/drivers/infiniband/hw/ionic/ionic_admin.c
> @@ -18,8 +18,6 @@
>  #define IONIC_ADMIN_BUSY_RETRY_COUNT	2000
>  #define IONIC_ADMIN_BUSY_RETRY_MS	1
>  
> -/* admin queue will be considered failed if a command takes longer */
> -#define IONIC_ADMIN_TIMEOUT	(HZ * 2)

[Severity: Low]
Should this have a Fixes: tag? The 2 second IONIC_ADMIN_TIMEOUT removed
here was added by:

Fixes: f3bdbd42702c ("RDMA/ionic: Create device queues to support admin operations")

The commit referenced in the message, ec8ee714736e ("ionic: stretch
heartbeat detection"), has a Fixes: tag for the same firmware latency
reasoning. Without a tag here, stable kernels that ship the ionic RDMA
driver won't pick this up.

A backport would also need the earlier "ionic: make the command timeout
per device" commit, because that commit adds ionic_cmd_timeout().

>  #define IONIC_ADMIN_WARN	(HZ / 8)

[ ... ]

> @@ -294,7 +297,7 @@ static void ionic_admin_dwork(struct work_struct *ws)
>  		}
>  
>  		if (time_is_after_eq_jiffies(aq->stamp +
> -					     IONIC_ADMIN_TIMEOUT)) {
> +					     ionic_admin_timeout(dev))) {

[Severity: High]
Can a firmware command that takes between 2 and 5 seconds still reset
the RDMA LIF through ionic_admin_busy_wait()?

The watchdog now waits HZ * ionic_cmd_timeout(). The busy-wait still
gives up after 2000 x mdelay(1), and then it always escalates:

drivers/infiniband/hw/ionic/ionic_admin.c:ionic_admin_busy_wait() {
	for (try_i = 0; try_i < IONIC_ADMIN_BUSY_RETRY_COUNT; ++try_i) {
		...
		mdelay(IONIC_ADMIN_BUSY_RETRY_MS);
		...
	}

	/*
	 * we timed out. Initiate RDMA LIF reset and indicate
	 * error to caller.
	 */
	ionic_admin_timedout(aq);
	return -ETIMEDOUT;
}

ionic_admin_timedout() queues dev->reset_work. ionic_reset_work() then
calls ionic_kill_rdma_admin(dev, true), and after that every verb fails
with -ENODEV. That looks like the same failure this commit is meant to
fix.

Every non-sleepable AH operation goes through the busy-wait.
ionic_create_ah_cmd() and ionic_destroy_ah_cmd() set
IONIC_ADMIN_F_BUSYWAIT when RDMA_CREATE_AH_SLEEPABLE is not set. ib_cm
reaches this path for every CM MAD:

cm_alloc_msg()
  rdma_create_ah(mad_agent->qp->pd, &cm_id_priv->av.ah_attr, 0)
    ionic_create_ah_cmd()
      ionic_admin_wait()
        ionic_admin_busy_wait()

IPoIB and sa_query also destroy AHs with flags 0.

The slow command doesn't have to be the AH command itself.
ionic_admin_post() picks the AQ with raw_smp_processor_id() % aq_count.
ionic_admin_poll_locked() only accepts completions in ring order
(cqe->admin.cmd_idx must equal aq->q.cons).

Say an AH busy-wait is queued behind a create or modify QP that firmware
takes 3 seconds to finish. The watchdog now allows that latency, but
the busy-wait would still time out at 2 seconds and reset the whole
RDMA LIF.

The commit message says the busy-wait keeps its 2 second bound. It
doesn't say that the busy-wait can still reset the LIF, or that a slow
command ahead of it on the same AQ can trigger that reset.

The later commit "ionic: add devlink param for command timeout" allows
cmd_timeout values up to 255 seconds and doesn't touch
drivers/infiniband. By the end of the series, the gap between the two
deadlines is even larger.

Would it work for the busy-wait to cancel the wr and return -ETIMEDOUT
without a LIF reset when it gives up before cmd_timeout, and leave the
reset to the watchdog? The 2 second spin bound in atomic context could
stay as it is.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119-b4-ionic-cmd-timeout-v3-0-2cdb8fca15fd%40amd.com

  parent reply	other threads:[~2026-11-23  0:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19  0:32 [PATCH net-next v3 0/3] ionic: make the device command timeout configurable Nikhil P. Rao
2026-11-19  0:32 ` [PATCH net-next v3 1/3] ionic: make the command timeout per device Nikhil P. Rao
2026-11-19  0:42   ` sashiko-bot
2026-11-19  0:32 ` [PATCH net-next v3 2/3] RDMA/ionic: Use the ionic command timeout for the admin queue Nikhil P. Rao
2026-11-19  0:42   ` sashiko-bot
2026-11-23  0:59   ` netdev-bot+sashiko [this message]
2026-11-19  0:32 ` [PATCH net-next v3 3/3] ionic: add devlink param for command timeout Nikhil P. Rao
2026-11-19  0:42   ` sashiko-bot
2026-11-23  0:59   ` netdev-bot+sashiko

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=179539559480.3135.11592624744457325166@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=ArunKumar.Prakash@amd.com \
    --cc=abhijit.gangurde@amd.com \
    --cc=allen.hubbe@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=brett.creeley@amd.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=eric.joyner@amd.com \
    --cc=horms@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikhil.rao@amd.com \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    /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