Article View: linux.kernel.netdev
Article #27247Re: [PATCH net-next v13 5/5] net: mana: use the reported HWC queue depth
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 04:36
Date: Sat, 05 Dec 2026 04:36
195 lines
15283 bytes
15283 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · 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).
- [Medium] HWC bring-up now fails with -EPROTO if the PF does not report
non-zero values for HWC_INIT_DATA_QUEUE_DEPTH,…
- [Low] Beyond rebuilding the queues, the patch makes the PF-reported
MAX_REQUEST/MAX_RESPONSE values enforced limits on every channel,…
--
net: mana: use the reported HWC queue depth
This patch rebuilds the hardware channel at the PF-reported queue depth
when the descriptors fit in the fixed 4 KiB rings and the reported message
sizes match the bootstrap allocations. Otherwise it keeps the depth-one
bootstrap queues. It also uses the reported MAX_REQUEST and MAX_RESPONSE
values as per-request admission limits, and falls back to a depth-one
channel if the rebuilt channel fails its test.
> diff --git a/drivers/net/ethernet/microsoft/mana/hw_channel.c b/drivers/net/ethernet/microsoft/mana/hw_channel.c
> index 5c2385c4e1620..34987ee19a31e 100644
> --- a/drivers/net/ethernet/microsoft/mana/hw_channel.c
> +++ b/drivers/net/ethernet/microsoft/mana/hw_channel.c
[ ... ]
> @@ -1115,32 +1166,176 @@ void mana_hwc_free_retained_channel(struct gdma_context *gc)
> gc->hwc.gdma_context = NULL;
> }
>
> -static int mana_hwc_create_bootstrap_channel(struct hw_channel_context *hwc)
> +static int
> +mana_hwc_validate_report(struct hw_channel_context *hwc,
> + const struct mana_hwc_init_report *report,
> + u32 expected_depth, bool check_depth,
> + bool require_exact_msg_sizes)
> +{
> + if (!report->queue_depth || !report->max_req_msg_size ||
> + !report->max_resp_msg_size) {
> + dev_err(hwc->dev,
> + "HWC: invalid maxima depth=%u req=%u resp=%u\n",
> + report->queue_depth, report->max_req_msg_size,
> + report->max_resp_msg_size);
> + return -EPROTO;
> + }
[ ... ]
> +static int mana_hwc_finish_channel(struct hw_channel_context *hwc,
> + const struct mana_hwc_init_report *report)
> +{
> + int err;
> +
> + /* The VF receives up to MAX_REQUEST and sends up to MAX_RESPONSE. */
> + hwc->rx_msg_size_limit = report->max_req_msg_size;
> + hwc->tx_msg_size_limit = report->max_resp_msg_size;
> +
> + err = mana_hwc_test_channel(hwc);
> + if (err)
> + dev_err(hwc->dev, "Failed to test HWC: %d\n", err);
> +
> + return err;
> +}
[ ... ]
> +static int mana_hwc_prepare_channel(struct hw_channel_context *hwc)
> +{
> + struct mana_hwc_init_report report;
> + u16 rebuild_depth;
> + int err;
> +
> + err = mana_hwc_build_channel(hwc,
> + HW_CHANNEL_VF_BOOTSTRAP_QUEUE_DEPTH,
> + &report);
> + if (err)
> + return err;
> +
> + err = mana_hwc_validate_report(hwc, &report, 0, false, false);
> + if (err)
> + return err;
[Severity: Medium]
Suppose the PF never sends HWC_INIT_DATA_QUEUE_DEPTH,
HWC_INIT_DATA_MAX_REQUEST or HWC_INIT_DATA_MAX_RESPONSE, or sends zero for
one of them. Does this now fail the whole probe on the depth-one bootstrap
channel?
These fields start at zero from kzalloc_obj(), and
mana_hwc_establish_channel() also clears them before ESTABLISH_HWC:
hwc->hwc_init_q_depth_max = 0;
hwc->hwc_init_max_req_msg_size = 0;
hwc->hwc_init_max_resp_msg_size = 0;
So a missing event leaves a zero in the report. The -EPROTO from
mana_hwc_validate_report() then propagates up:
mana_gd_setup()
mana_hwc_create_channel()
mana_hwc_prepare_channel()
mana_hwc_validate_report() -> -EPROTO
mana_gd_setup() then does:
err = mana_hwc_create_channel(gc);
if (err)
goto remove_irq;
and the device fails to probe.
Before this patch, mana_hwc_create_bootstrap_channel() received
q_depth_max, max_req_msg_size and max_resp_msg_size and threw them away.
The depth-one channel worked whatever the PF reported.
The commit message says "Otherwise keep the bootstrap queues". With a
missing or zero report, the result is a probe failure instead.
The zero check seems to be needed only because mana_hwc_finish_channel()
now uses the reported sizes as admission limits. Would falling back to
HW_CHANNEL_MAX_REQUEST_SIZE and HW_CHANNEL_MAX_RESPONSE_SIZE on the
bootstrap path keep the old behaviour?
> +
> + if (!mana_hwc_depth_fits(report.queue_depth)) {
> + dev_warn(hwc->dev,
> + "HWC depth %u exceeds ring capacity, keeping bootstrap\n",
> + report.queue_depth);
> + } else if (report.queue_depth >
> + HW_CHANNEL_VF_BOOTSTRAP_QUEUE_DEPTH &&
> + (report.max_req_msg_size != HW_CHANNEL_MAX_REQUEST_SIZE ||
> + report.max_resp_msg_size != HW_CHANNEL_MAX_RESPONSE_SIZE)) {
> + dev_warn(hwc->dev,
> + "HWC maxima req=%u resp=%u differ from rebuild policy %u/%u, keeping bootstrap\n",
> + report.max_req_msg_size, report.max_resp_msg_size,
> + HW_CHANNEL_MAX_REQUEST_SIZE,
> + HW_CHANNEL_MAX_RESPONSE_SIZE);
> + } else if (report.queue_depth >
> + HW_CHANNEL_VF_BOOTSTRAP_QUEUE_DEPTH) {
> + rebuild_depth = report.queue_depth;
> + return mana_hwc_rebuild_channel(hwc, rebuild_depth, &report);
> + }
> +
> + return mana_hwc_finish_channel(hwc, &report);
[Severity: Low]
The "keeping bootstrap" branches fall through to here. That means
mana_hwc_finish_channel() applies the PF-reported maxima even when the
bootstrap queues are kept:
hwc->rx_msg_size_limit = report->max_req_msg_size;
hwc->tx_msg_size_limit = report->max_resp_msg_size;
mana_hwc_try_get_msg_index() now rejects every request above those
limits:
req_limit = mana_hwc_get_max_req_size(hwc);
resp_limit = min(hwc->rx_msg_size_limit, hwc->max_req_msg_size);
if (req_len > req_limit || resp_len > resp_limit) {
...
return -EMSGSIZE;
}
Suppose a PF reports maxima below 4 KiB and smaller than an existing
request, such as the gdma_verify_ver_req sent during probe. Could requests
that used to succeed on the bootstrap channel now fail with -EMSGSIZE?
mana_gd_create_dma_region() and mana_ib_gd_create_dma_region() also change.
They now limit and batch CREATE_DMA_REGION and ADD_PAGES messages with
mana_hwc_get_max_req_size() instead of hwc->max_req_msg_size, the RQ
stride. When both reported values equal the HW_CHANNEL_* constants, the
result matches the old code.
The commit message only says "MAX_RESPONSE limits what the VF can send;
MAX_REQUEST limits what it can receive." Could it mention that these limits
also apply when the bootstrap queues are kept? Could it also mention that
drivers/infiniband/hw/mana/main.c changes under this net: mana: subject?
> }
>
> int mana_hwc_create_channel(struct gdma_context *gc)
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/hwc-v13.ab4ca86c3bf24a51ad8a84cc8a0220d1.0%40linux.microsoft.com
Technical Details
Message-ID:
<179644540466.3146.14682429380154028120@kernel.org>Path:
mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377834-linux-kernel-netdev=dewy.ruReferences:
<hwc-v13.ab4ca86c3bf24a51ad8a84cc8a0220d1.5@linux.microsoft.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377834-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v13 5/5] net: mana: use the reported HWC queue depth Date: Sat, 05 Dec 2026 04:36:44 +0000 Organization: Usenet Network Message-ID: <179644540466.3146.14682429380154028120@kernel.org> References: <hwc-v13.ab4ca86c3bf24a51ad8a84cc8a0220d1.5@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2954296"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Sl7byrXxPDb3/mBh78WDs8NAj5U= sha256:WB6RTHDXcWswHKNitwtfiHQ+SKchitrQBFKcQUvnGDc= sha1:vdUY13OjrGHh/vKA5LQv9mVk2T0= sha256:ODjQ6eOUQkcmK8rb8gOWKhp97HlstaUwqBbe1BZ4qYg= 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 2A58F117D6D; Sat, 5 Dec 2026 07:37:12 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.642 X-Spam-Status: No, score=-3.642 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.142, 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] 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 Z2KG38vhSH1I; Sat, 5 Dec 2026 07:37:05 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-377834-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id D45AE117D6C; Sat, 5 Dec 2026 07:36:56 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id E672D605566; Sat, 5 Dec 2026 04:36:54 +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=1796445408; b=ZDZlG94/P7w+Nz0CegojuJGogkUIUvgEfgFFgjYQXIn2O2mvh2NNz2iv52GE+K9/5RyO S1OZ+cNx3l7EsD/BHghw3VninM1cys+kOQaVICOqVHIz1rGOJKejZYbYylngTqIOIeCrs CUiF8vXXl458Ft4l/CkK9Gvih1RF7gt1UdqKAhpgmNcc1x8i26B7rRXQRi4wybEwx7vEr KvE3PciKP+fisWwTTb+PKwuGUSgfKmsrG14fgY40IGG6d4PC+Syaz3UgWDn3uLABbdP+l VsibQlb3Amg70oGv98jcqcKNFghE47gIBpEgSYLk5wJU6DwHSmUR2L3nOWDUgGaGFiQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796445408; 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=pWpwmUt+sdpL0cxZDRxlWUyZ3FwaAKKYPq+Dhhegm0Y=; b=HSvB7kIES7zIN7Q/eau2aNTgd3i0bCU5M5eXpDkMJxiRRozZ44WlSEIiAyHRrinS6sb+ sbADURDMhesgy9hzxRKryAmDAwjg1xadqx38iG44tnqsPRNsNC/AIZOnlczdgvfYbjrbQ h9+dh2nX7Xf/iBkapqTYTHjc7JVbfiy+ezqAsIheCJ82ME/4clHLQ/iV+QE6o/b5ofU+3 VPumHujuDgj/2vbQnQtQlnIyfnopXfi9B3jTtO9nj+oa2zyv1gc0CYrJ7yxZKTd3UIFOp evMC5AWnRaHCN7OTvVS+E9bw0eEozhkp5jt1oBbVoWITZkvsbF6X7aQI9sACAilW+ZA== 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=f8W6oLpp; 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 F38F2606A684; Sat, 5 Dec 2026 04:36:47 +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=f8W6oLpp 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=1796445407; b=jsFcPeQhOAfZBIQ8MqWlyeOCJ0iRBW+iyHGNTseRS/8X+zDlF11h21jnsA95qewRw2Ds nT1ZdqpF+VGs1AyK3RuHW/ot1Ns4rWV4m4NZjhYUSWHZOgoVFpvZ6Kfq7o7z7GLFCBp/f xiv0yMoEEXdrT+3J2up/kh8KWwSEgbft1WRu83pmP9Sj8IBT2c/YXMNAXRrNmzgxFtx5Y /lpYOP3vY9uYdXtCmP5Th0fpkG2UQLx6MAouFeDr+GGkCkFwDDI0ND/dt/XHvGcXzANHZ 3goeVZTQY02+YRVPYfy7zO8EQ1G4bmO8XJY7owEQhO4jqj9y6jhLkcUEgRohUQH8qhA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796445407; 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=pWpwmUt+sdpL0cxZDRxlWUyZ3FwaAKKYPq+Dhhegm0Y=; b=ptDHxhmj/a7bZea/JIDtBf8S51DQ1qTa3k+1cRSudkILdOqbly7+cqJRoBrVzKfMTySC NrADoQUry/O2lf2DRD3qKfPe5LoqBL07EM7MnHErISPcsSrn2uuw8EefSRpLBRT9769pS 3DPlZ+nGkjOmhjfmLusPtvr5c10a5ittdhntZ0uRr/ySCCnYi91LkwVysbZfHktDBw+ig fFAK7n8LMHeB9bYMa7Gr4xVkk5nS8cZyAehlmAyfVCGmd99US4zeK/MvxH3wp/4PYWosJ YnMhZMRg33HMayIv3Xh2icpomiyprLL5X/DZ7Rdy4tBvyPpEK4TB5CraFgcB1Ni9H9A== 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=f8W6oLpp; 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 211A2606A33A; Sat, 5 Dec 2026 04:36:46 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29EEE1F00A12; Sat, 5 Dec 2026 04:36:45 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796445406; bh=pWpwmUt+sdpL0cxZDRxlWUyZ3FwaAKKYPq+Dhhegm0Y=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=f8W6oLpp2hGetkcRqR9JIHQFcWoYIMsFehkcLALTenfl8hzy4ds2wD6Suo+rdSJMd dogbKh9y4i8hx0K7uYRdcpC0b/x73yrLA5cI+HCtUqa0lxjMFJZViv1lVcFk7luweF OJOPo4qXeyVa/1KJI6fYteyYs+zOUzJdbUMwWkTMGjLAaqdcm2rfyHZ8zQMGFE8dL1 DsQMwsfvzuYS+EWhTBbRTfNUofyyey0sC8LEWxbWkAoz3LXoaSVneki8L+DU1683CZ H3LUfLbBZpU9n3CPiyXh2aOHFIl+HzHyG4vxhnNB8NizBFwxrBxjI/fldPUtWZZCVx Le9ZTVRaDvV3g== X-Cc: longli@kernel.org, kotaranov@microsoft.com, kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com, edumazet@google.com, andrew+netdev@lunn.ch, jgg@ziepe.ca, leon@kernel.org, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, shradhagupta@linux.microsoft.com, horms@kernel.org, ernis@linux.microsoft.com, stephen@networkplumber.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, gargaditya@linux.microsoft.com, kees+treewide@kernel.org, kees@kernel.org, mawasthi@linux.microsoft.com, weh@microsoft.com, edumazet@kernel.org X-In-Reply-To: <hwc-v13.ab4ca86c3bf24a51ad8a84cc8a0220d1.5@linux.microsoft.com> X-sashiko-severity: Medium 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 X-Received-Bytes: 15086