Article View: linux.kernel.netdev
Article #26362Re: [PATCH net] net/mlx5e: Fix the missing WQE count of large striding RQs
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 12:17
Date: Thu, 03 Dec 2026 12:17
104 lines
12205 bytes
12205 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
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] The commit message says "The ICOSQ is already sized for the
UMR WQEs of the whole RQ, so posting them in one refill fits." That…
--
net/mlx5e: Fix the missing WQE count of large striding RQs
This commit widens the missing WQE count and loop counter in
mlx5e_post_rx_mpwqes(), and the umr_in_progress, umr_last_bulk and
umr_completed fields of struct mlx5e_rq, from u8 to u16. Before this, the
u8 truncation limited each striding RQ to 255 posted WQEs even when the
ring was configured larger.
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> index 1586cb2404c01..63ac293bfceb4 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
[ ... ]
> @@ -933,11 +933,11 @@ static void mlx5e_reclaim_mpwqe_pages(struct mlx5e_rq *rq, int head,
> INDIRECT_CALLABLE_SCOPE bool mlx5e_post_rx_mpwqes(struct mlx5e_rq *rq)
> {
> struct mlx5_wq_ll *wq = &rq->mpwqe.wq;
> - u8 umr_completed = rq->mpwqe.umr_completed;
> + u16 umr_completed = rq->mpwqe.umr_completed;
> struct mlx5e_icosq *sq = rq->icosq;
> bool reclaimed = false;
> int alloc_err = 0;
> - u8 missing, i;
> + u16 missing, i;
[Severity: Medium]
The commit message says:
The ICOSQ is already sized for the UMR WQEs of the whole RQ, so posting
them in one refill fits.
Now that missing and i are u16, mlx5e_post_rx_mpwqes() can post up to
RQ size - 1 UMRs in a single refill. Before, the u8 capped that at 255.
Is the ICOSQ sizing really enough to cover this?
In mlx5e_build_icosq_log_wq_sz() in en/params.c, the comment asks for
(PAGE_SIZE - (max WQE size - MLX5_SEND_WQE_BB)) useful bytes per page.
The code does this instead:
useful_space = PAGE_SIZE - mlx5e_get_max_sq_wqebbs(mdev) + MLX5_SEND_WQE_BB;
mlx5e_get_max_sq_wqebbs() returns a count of WQEBBs (up to 16), not
bytes. With 4K pages that makes useful_space 4144, which is larger than
PAGE_SIZE.
So the estimate reserves no room for the page-edge NOPs that
mlx5e_icosq_get_next_pi() inserts. For 10-WQEBB UMRs that is 4 NOPs per
64-WQEBB page, about 6.7% overhead. This calculation dates back to commit
0b9c86c78586c2. The 255 in-flight cap has been hiding it until now.
Neither mlx5e_alloc_rx_mpwqe() nor mlx5e_xsk_alloc_rx_mpwqe() checks for
room in the ICOSQ. Both just advance sq->pc and write sq->db.wqe_info[pi].
c->rq and c->xskrq share c->icosq, and both can be refilled from empty in
the same NAPI poll. Two paths lead there:
mlx5e_xsk_disable_locked()
mlx5e_activate_rq(&c->rq); /* while the XSK RQ is still active */
mlx5e_rx_reporter_err_icosq_cqe_recover()
re-activates both RQs
I could not find a valid configuration that actually overflows.
Power-of-two rounding and mlx5e_mpwrq_validate_xsk() seem to keep the
footprint within the ICOSQ. The margins are thin, though. For example,
with non-ECPF, 4K pages, umr_wqebbs = 10 and an XSK RQ twice the size of
the regular RQ, the worst case is about 4081 of 4096 WQEBBs.
What if some device capability combination does go over? Then pc - cc
would exceed the ICOSQ size, and in-flight UMR WQEs and wqe_info[]
entries would be overwritten. mlx5e_poll_ico_cq() could also credit
umr_completed to the wrong RQ, and this could underflow the u16:
rq->mpwqe.umr_in_progress -= umr_completed;
Would it make sense to fix the useful_space calculation, so that the max
WQE size is in bytes, before full-ring refills rely on it? Or should the
commit message be reworded so it does not depend on that sizing?
> u16 head;
>
> if (unlikely(!test_bit(MLX5E_RQ_STATE_ENABLED, &rq->state)))
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202121422.3422569-1-tariqt%40nvidia.com
Technical Details
Message-ID:
<179630022795.3146.4180735893350917415@kernel.org>Path:
mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376586-linux-kernel-netdev=dewy.ruReferences:
<20261202121422.3422569-1-tariqt@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376586-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] net/mlx5e: Fix the missing WQE count of large striding RQs Date: Thu, 03 Dec 2026 12:17:07 +0000 Organization: Usenet Network Message-ID: <179630022795.3146.4180735893350917415@kernel.org> References: <20261202121422.3422569-1-tariqt@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2484728"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:8xbikTVa/fAjmckUO40vE7guKMY= sha256:HH58Y4+zSOp4SD4itj1eArLM/Q4dcH3/ACIWghh6ldQ= sha1:DsK/XBq54LgX78iICHMcCdx2gzY= sha256:xc3/ZXeYs4twFdavYqYGFRn97gbsPq8QSz/tM0KwxA4= 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 54023117931; Thu, 3 Dec 2026 15:17:56 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.64 X-Spam-Status: No, score=-3.64 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, 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 EASUDyeOkCwC; Thu, 3 Dec 2026 15:17:53 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376586-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 3C53E11792D; Thu, 3 Dec 2026 15:17:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id B26492D697; Thu, 3 Dec 2026 12:17: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=1796300235; b=XxHCdS0AOxvEmXG0oU1oAcaF8l45VrbxCXve/vFa4aZbKFHCKWp13hMGjdO/II8ZC2dU p1Kyip01XGADPuZ9scjo0bs23dM2iyyT5YGOYA5BnibZNGSyF7o/+60bZ024lS66x11JK lBPI9W/KBw3mnsZ6y/VNfTHP2KDGDN/9BXqH6rOaiojJfTcrO1JYkns+heqWdEZIDpyYn yJT0aK9PsRx1cE8JuiGg0Ae0uERVteVKLV1NF9vwxbZMVyQ++znEssZ7ZAm19IB8DqbRx krOVmiIvvl/O07L+LHiG5Gh5j9XhBrAGZdCL9DyYAdX1Lh8RDu9qvH63mXQp7FTbTJg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796300235; 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=x8IMyr1BQRdOyi/NQme8NgeyIj4qFnfsmDqDa3DFA/I=; b=PXK0nnk2b7nMzJvOZxlTy0AlG08c9DRsgelR1OQNKUCMbui+ORFw/g8hu0BdwsiiEzMR Hiywv6Fw32ADP+Xa827hg3WJiyOYyrPVfEy2yFzcMWJGkZTGJuH31tHRu/3jP0NeyC1kg mpgXRuuiFHG/EdQOdrR4gh0FiUA7v6yC5j6qsygEpKeZn3YukL4t41843kMEwkchSCult PXT6eMHQYvV6gUb2Vw2k16onKWHL8Pw1MfaQZg1rzNvDNBq2QgpnH8s74qx6QTZSzYXC+ Cr+sGCkCwZACy7b5eD0+p7k8yfRtWTtC9VwgTb3W81D5MYMfROjDffz3+GwnkhF8QQQ== 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=BWRTq4TE; 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 8AE57606A33D; Thu, 3 Dec 2026 12:17:15 +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=BWRTq4TE 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=1796300229; b=k5awfig8oW13yvfO0f/HTcsgXCuIrxvmKqSkAbGE3Dew8HbXuqRNSDMLw0wLXwAKyj1X wVXqeGrhv1O/SWNW63c4BgJJ7QRW8eQKnd4tb9qS2wJBUPRBYyxeD8ebEk4SmePM8wq7m eWozHquyhJmhdv5oJNcpGhxv5WY4Rt4HZBI708/C8ORhqUnDBMDmFACXizte7CDnmYTjD SUofxLvK+g0SDa9/Mq39+57hDXmV8vElNgeQcsNO2bmvV4k6MP37Fa3cN36gqTpwblleq mYochADHhY6cUvIW33WhaHybm2jmBtSYEKDkzTV4BTfqt3q7B5KeiMuFN9ZuZZaG49g== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796300229; 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=x8IMyr1BQRdOyi/NQme8NgeyIj4qFnfsmDqDa3DFA/I=; b=A9wlJw9F4RAj6NSYjVn5qdxzodg8/2XTjOjG0PItcaVD4Gt3LxrYo6SH8HjjOPZHrL6G c3DuU7ONELs/m3y1Jp/8WLZZzpXQYVEkQiumQRd/q7SYuaDGG8Y86hcraja5/OhJYyMz1 35M6D9ZuIUWVUG6FslLsvmGIWILL8EW16sS/gCcYSUDuLL5I2W43IvuO5DtTS92HqgHW9 5thOS3U6I1+Qdaw+352+gCcem2NaXm1VhMVSj2/3rhrEAIzWhZU3STCVYJsIws6Twpbqe Qd0mVUBrKwzBUgngUic6/7MxwnBBGblXTKCegVu9zg57Gfzhm6oJbw3YExNay/qazdg== 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=BWRTq4TE; 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 A9A76606A332; Thu, 3 Dec 2026 12:17:09 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E33B1F00896; Thu, 3 Dec 2026 12:17:08 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796300229; bh=x8IMyr1BQRdOyi/NQme8NgeyIj4qFnfsmDqDa3DFA/I=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=BWRTq4TEMw7RXakxNQdS9a00KxvKHFfd4M7cyr5T2YZCs6ldfelI5sfGDKnDTkqol RoxvOobzBR0zEVILPBWfUd/D/xh3+MPTvD4yFvvI3BHWiDoIF0QhB/QO2YKPWhQzYo 1sbu5BuG5r7ikFFwFREyu1H+IGqP1Iu54x5enwuutMMwrQWWJd2uOnCaLEnsFNxdDV UpJYY3E3rqPmy2W5f5L3p/vMb52sMfhMk6Pi7C4tgPv06KOZQdnz01MGOD46HBOZt2 OQh4MxyWhE1jwQwgWErRsaojtcBLDgk48yssG+soa+m5GuJsdskYT40w8S99okBRoV yfmYoP+dHFUGw== X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, willemb@google.com, dtatulea@nvidia.com, gal@nvidia.com, leon@kernel.org, linux-rdma@vger.kernel.org, mbloch@nvidia.com, saeedm@mellanox.com, saeedm@nvidia.com, tariqt@mellanox.com X-In-Reply-To: <20261202121422.3422569-1-tariqt@nvidia.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