๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13877

Re: [PATCH net-next v2 2/3] RDMA/ionic: Use the ionic command timeout for the admin queue

#13877
From: netdev-bot+sashiko
Date: Tue, 10 Nov 2026 12:14
154 lines
13849 bytes
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: an RDMA LIF reset at 2 seconds can still
  happen on the AH busy-wait path.
- [Low] The commit fixes a user-visible bug: a spurious RDMA LIF reset,
  after which every verb fails with -ENODEV.

--

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

This patch changes the RDMA admin queue watchdog in ionic_admin_dwork().
It used a fixed 2 second threshold and now uses HZ * ionic_cmd_timeout(),
which is 5 seconds by default. 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)
>  #define IONIC_ADMIN_WARN	(HZ / 8)
>  
>  /* will poll for admin cq to tolerate and report from missed event */
> @@ -28,6 +26,11 @@
>  /* work queue for polling the event queue and admin cq */
>  struct workqueue_struct *ionic_evt_workq;
>  
> +static unsigned long ionic_admin_timeout(struct ionic_ibdev *dev)
> +{
> +	return HZ * ionic_cmd_timeout(dev->lif_cfg.lif);
> +}
> +

[Severity: Low]
This fixes a user-visible problem, but the patch has no Fixes: tag.
The 2 second IONIC_ADMIN_TIMEOUT removed above was added by f3bdbd42702c
("RDMA/ionic: Create device queues to support admin operations"), which
is in released kernels.

Should this carry a Fixes: tag for that commit?

ionic_admin_timeout() also depends on ionic_cmd_timeout(). That function
does not exist at the baseline. The previous patch in the series, "ionic:
make the command timeout per device", adds it and describes itself as
"No functional change". If this fix is picked for stable without that
patch, it won't build.

Could the commit message mention this dependency?

>  static void ionic_admin_timedout(struct ionic_aq *aq)
>  {
>  	struct ionic_ibdev *dev = aq->dev;
> @@ -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]
Only the watchdog in ionic_admin_dwork() moves to ionic_cmd_timeout()
here. Can the RDMA LIF still be reset after 2 seconds through the AH
busy-wait path?

ionic_create_ah_cmd() and ionic_destroy_ah_cmd() in ionic_controlpath.c
set IONIC_ADMIN_F_BUSYWAIT for non-sleepable callers. In that case
ionic_admin_busy_wait() still gives up after about 2 seconds:

drivers/infiniband/hw/ionic/ionic_admin.c:ionic_admin_busy_wait() {
	for (try_i = 0; try_i < IONIC_ADMIN_BUSY_RETRY_COUNT; ++try_i) {
		if (completion_done(&wr->work))
			return 0;

		mdelay(IONIC_ADMIN_BUSY_RETRY_MS);
		...
	}
	...
	ionic_admin_timedout(aq);
	return -ETIMEDOUT;
}

ionic_admin_timedout() then queues the same reset that the watchdog
uses:

	/* Reset ALL adminq if any one times out */
	if (atomic_read(&aq->admin_state) < IONIC_ADMIN_KILLED)
		queue_work(ionic_evt_workq, &dev->reset_work);

After that, ionic_reset_work() calls ionic_kill_rdma_admin(dev, true),
and every later verb fails with -ENODEV. The commit message describes
this same failure.

This path seems easy to reach. cm_alloc_msg() in
drivers/infiniband/core/cm.c creates its AH without
RDMA_CREATE_AH_SLEEPABLE:

	ah = rdma_create_ah(mad_agent->qp->pd, &cm_id_priv->av.ah_attr, 0);

cm.c also destroys those AHs with flags 0. On RoCE, every IB CM message
therefore goes through the 2 second busy-wait:

cm_alloc_msg()
  rdma_create_ah()
    ionic_create_ah()
      ionic_create_ah_cmd()
        ionic_admin_wait()
          ionic_admin_busy_wait()
            ionic_admin_timedout()

This happens when firmware takes between 2 seconds and cmd_timeout to
service the AH command. It can also happen when ionic_admin_post() puts
the AH command on the queue chosen by raw_smp_processor_id() % aq_count,
behind a slow command. The watchdog now allows that slow command up to
cmd_timeout, but the busy-wait still gives up at 2 seconds.

The kernel-doc for ionic_cmd_timeout() in ionic_api.h calls it the
"device and admin queue command timeout". The busy-wait doesn't follow
it.

Later in the series, "ionic: add devlink param for command timeout"
allows cmd_timeout from 5 to 255 seconds. It says it "replaces the device
command and admin queue timeouts". ionic_admin_busy_wait() is not changed
anywhere in the series, so the gap gets wider.

The commit message says:

    The AH create/destroy busy-wait keeps its fixed 2 second bound.

It doesn't say that reaching this bound still resets the whole RDMA LIF.
Should the busy-wait also be bounded by ionic_cmd_timeout(), or should
its expiry not trigger the LIF reset?

>  			/* Timeout threshold not met */
>  			ibdev_dbg(&dev->ibdev, "no progress after %ums\n",
>  				  (u32)jiffies_to_msecs(jiffies - aq->stamp));

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261105-b4-ionic-cmd-timeout-v2-0-35a9a2aa48b1%40amd.com
Technical Details
Message-ID: <179431289755.994134.3080122667953359752@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360169-linux-kernel-netdev=dewy.ru
References: <20261105-b4-ionic-cmd-timeout-v2-2-35a9a2aa48b1@amd.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360169-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 2/3] RDMA/ionic: Use the ionic command timeout
 for the admin queue
Date: Tue, 10 Nov 2026 12:14:57 +0000
Organization: Usenet Network
Message-ID: <179431289755.994134.3080122667953359752@kernel.org>
References: <20261105-b4-ionic-cmd-timeout-v2-2-35a9a2aa48b1@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="603379"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:dVyvGBXAqel0BUjnnfxliiCRmOc= sha256:FRe65IR2N9DJty6i3da4S7u8uGCpNuoyLPKPHYMqzIc=
	sha1:R8A7TY1pu7xHM0RoVbjzGK+eS2o= sha256:sBDgQpyW21M6IBWEtt6sGevgMa4yunqhM2TxBgM6oKU=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 569C4113B74; Tue, 10 Nov 2026 15:28:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 8sLyPWo6a7vV;
	Tue, 10 Nov 2026 15:28:06 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-360169-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 2F29F113B72; Tue, 10 Nov 2026 15:27:56 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 01CE41281D0; Tue, 10 Nov 2026 12:15:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794312910;
	b=OcjdpxOlqsbygvxP+knu4b1RrCj2vq4QPQgr4CO2K7jo4rXxnZ5GJsRNRqM/s+8hE63K
	 89x0R8N080oG2k/UlZlfaHOUf7fOoBYisxM1QclKM4srrIzVGE8Br8ovCm4cm7wUxoYyp
	 1mWZOLjERD+7PgDOw8tsbMBkWQiGD1TVZhBlKyKShgCTgPSgMMxtI3XtcJFqmcKhSMvXk
	 fffeIiGy4zOnDg9s/EjXrnlehJMaz623SpGRscrPARjP57IxlUiPT4aOG7+4MBwM/7Qyr
	 MYJJAx9JCL9AiuVMCBelI+Fja2kDp8yTF2kJb1Y+6JixZoy7DzOYPQjH2fA5xPt3iUg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794312910;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=qz9Cg/+Lb0BoddJpAlf9vuo5dFigQSPPYLNDQ49b5og=;
	b=2wTrS6JQIs0zMmneNypEBAwPQa63V+solGms5+JP8SVO/Gm8BWK+Jbm3+WtpiBknMwVb
	 AujSQzgAraQIUrXV36BmLmd6ZTFOWE0cBgq2F1JNQ7WDIgqzj6HCGU4p2FRhn8AQltNmZ
	 7Ukpvn1dEKAhdzydll8D5NM/hR9Gy49myE9bSMUs00tP8H4VJPfI6asFxm/dSjeZe68T6
	 6dZMgL9cniQxUaGy7uz5hJZMGfXIZmKMIroNp09vaBNvXWdkVF/DnHlolwK5W6jXoY1+H
	 Mlvy8SjeXXNpGIRqbYuEflUH4m9iYgnyExKY4SVRSL99Y0qjVwX+qOR7opFBaZeezrg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I83LR7wi;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id CF182606A332;
	Tue, 10 Nov 2026 12:15:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I83LR7wi
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794312900;
	b=3+7Vcye8C4xrOb9vSQ41C3bSmvb4vpzCMP7rhch4Q3GAYU6p5SvmSJraTnpjdBY8bu5M
	 Y2E68N43ZEV6uhhYFtIQO+3SPfI5cLIsJjb0nzkQen/BYmDORMOWhHC1F6j6To0HBkrPE
	 DAhdILPLzeaDsKivez85xF0bXevYi5N93EV9exrDgfrnOOgrIE3QkUS2dnkjol8Wf8PzJ
	 eEpEaTj0RPHVL+56+y7INe85G97XkcMUsdjNxmPsyP2AvhlKd2idLkil8cBKxmjTDTVnB
	 NFf8Os53Bcq4ElAAhaKRKnbdSRftNlLmq2O1a5uxtEl0UlWKrtINk116P6877He8e7g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794312900;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=qz9Cg/+Lb0BoddJpAlf9vuo5dFigQSPPYLNDQ49b5og=;
	b=Z/J8JN5VxCEATLYHkDEdxvFHtdSCfND2HGlqe6P/uUz5Xr7MBoYMK+bCVzJC6B0NEIYq
	 wsWGmmxECDvd5cGEEt61Y2eCKKFXggpzR/T2m1PVSX07Mu8XmquH0d8z3xBiO/bQTaUbA
	 XuGCutx732HK75BuGIC93ays2wTs4iwoT0gOtcJ2rBLeCR0zv+s1t/brvhTsaJIm6SvtO
	 HXobPa1MsdmsTVpDEuuFlOtC4y0eugmTpUSvKGliGIuZxzrOjQeyFcW6oVQCNKqTgwr7u
	 d4qR2OhoOPGBFkx4ZkJcFHcBkd1h6yB3Jwj+egaKqqjKbC+t3zDrNQksu8QvAx2XeBQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I83LR7wi;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA92B606A31C;
	Tue, 10 Nov 2026 12:14:59 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D0F01F0089F;
	Tue, 10 Nov 2026 12:14:58 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794312899;
	bh=qz9Cg/+Lb0BoddJpAlf9vuo5dFigQSPPYLNDQ49b5og=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=I83LR7wiT0O/eZpQPZN1xM/PMVVJQkMFyt9p4NCgPMD4V8mZTfREIiqvcAkKoTKN7
	 zNzff4tPoD3ewxUVFgoAXmd9KE1CMw/MWfrUcUGsi4MPI9xcY94GefLmFFtZLrzyvv
	 piD74h9Tj4giYwy5n/joMXw1CfHknf3AOeRJmLORJH++sk6/7aAbxgNZNxzmu7pxoe
	 7PQTOBKojEghR0pPYtL/+eh8DOilPmL0iIjks/4tC2jeEHAInPovQwqrPJnMJxAn8h
	 A7C+Q+beN1r/YGkiwItzNA9acDSKKHuzPKbvWD1c0PIxrvtZKpjh900tlvibYuD9WF
	 LAyRVnvcygujg==
X-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
X-In-Reply-To: <20261105-b4-ionic-cmd-timeout-v2-2-35a9a2aa48b1@amd.com>
X-sashiko-severity: High
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list