Article View: linux.kernel.netdev
Article #5099Re: [PATCH net-next v8 3/5] net: stmmac: drop multi-buffer frames in XDP mode
From: netdev-bot+sashiko
Date: Mon, 19 Oct 2026 17:38
Date: Mon, 19 Oct 2026 17:38
102 lines
11957 bytes
11957 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message does not describe what the patch actually
does, and it hides changes to the non-XDP RX path.
--
net: stmmac: drop multi-buffer frames in XDP mode
When an XDP program is attached, stmmac_rx() now drops any frame that
spans more than one descriptor, or that uses the second buffer of a
descriptor. This prevents the XDP program from running on partial
frames. Both XDP_CONSUMED and XDP_TX/XDP_REDIRECT now finish the packet
via next instead of re-parsing the following descriptor.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index efa88cd359dac..e929cc0f23125 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -5888,18 +5888,23 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
> if (priv->extend_desc)
> stmmac_rx_extended_status(priv, &priv->xstats, rx_q->dma_erx + entry);
>
> - if (unlikely(status & discard_frame)) {
> - page_pool_put_page(rx_q->page_pool, buf->page, 0, true);
> - buf->page = NULL;
> + if (unlikely(!error && (status & discard_frame))) {
> error = 1;
> if (!priv->hwts_rx_en)
> rx_errors++;
> }
[Severity: Low]
The commit message says the patch will:
"mark it as errored as soon as a non-last descriptor, or a descriptor
using its second buffer, is seen while an XDP program is attached,
drain and release every descriptor - including the last."
Is this description accurate? This hunk removes the only
page_pool_put_page() call on the error path in stmmac_rx(). After the
patch, none of the drop paths returns a page to the page_pool. That
covers the hardware discard_frame drop, the new XDP SG drop and the new
buf2 drop.
The dropped buffers stay in rx_q->buf_pool[], and stmmac_rx_refill()
reuses them in place because it only allocates when the slot is empty:
stmmac_rx_refill() {
...
if (!buf->page) {
buf->page = page_pool_alloc_pages(rx_q->page_pool, gfp);
...
}
The reuse itself looks safe. All three drop checks run before any
dma_sync_single_for_cpu() or net_prefetch() on the buffer.
The new !error guard also changes rx_errors from once per descriptor
carrying discard_frame to once per frame. Both changes apply whether or
not an XDP program is attached, but the subject says "in XDP mode".
On dwmac100/dwmac1000, the previous patch in this series makes non-last
descriptors report discard_frame | rx_not_ls. So an errored frame
spread over N descriptors used to add N-1 or N to rx_errors, and now
adds 1.
Separately, the new buf2 drop in the later hunk doesn't set error, even
though the message says the frame is marked as errored:
if (unlikely(stmmac_xdp_is_enabled(priv) && buf2_len)) {
rx_dropped++;
goto next;
}
It only behaves the same way because, in XDP mode, that descriptor is
always the last one.
This patch carries a Fixes: tag for net/stable. Could the commit message
describe the in-place buffer reuse and the rx_errors accounting change
for the non-XDP path? The later "net: stmmac: rework stmmac_rx to
support XDP rx multi-buff" patch keeps both the !error guard and the
in-place reuse, so it doesn't change the picture here.
> - if (unlikely(error && (status & rx_not_ls)))
> - goto read_again;
> + /* We do not support SG in XDP mode */
> + if (unlikely(!error && (status & rx_not_ls) &&
> + stmmac_xdp_is_enabled(priv))) {
> + rx_dropped++;
> + error = 1;
> + }
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261018-stmmac-rx-mb-v8-0-5f58c0b25849%40oss.qualcomm.com
Technical Details
Message-ID:
<179243151663.3135.5003290847659035107@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348764-linux-kernel-netdev=dewy.ruReferences:
<20261018-stmmac-rx-mb-v8-3-5f58c0b25849@oss.qualcomm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348764-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v8 3/5] net: stmmac: drop multi-buffer frames in XDP mode Date: Mon, 19 Oct 2026 17:38:36 +0000 Organization: Usenet Network Message-ID: <179243151663.3135.5003290847659035107@kernel.org> References: <20261018-stmmac-rx-mb-v8-3-5f58c0b25849@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3695007"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:DK0pwzOgdZxK8us39F8EAQaPivo= sha256:BzvEEujUr92w1IrVKLNrFngccyRC9S/zrfDhJk1ps94= sha1:R7/RwBa7NFp+rr7X9FXW+r4mS2o= sha256:9g7Zwr9cVRtgtNuXmxc7poBBawGJ7+yQV1qZK5r1LsY= 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 9AC33110AE9; Mon, 19 Oct 2026 22:25:23 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.729 X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, 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 6q65_VeRXrOn; Mon, 19 Oct 2026 22:25:20 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-348764-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id BA2CB110ACE; Mon, 19 Oct 2026 22:25:11 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 2F6EBC6BFF; Mon, 19 Oct 2026 17:39:17 +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=1792431529; b=lSTdytjHb3Zg/IirVJGWsS9Y5ptsLcnloo3KiZ/oVjHvf4Loym6FVqB/hAh743elrKgz N8F72xVumQZmAV/6swK8xevf9k3+CH34pK+FPvrR/8HpPR0nCQkrp0nsgDIaBlfFa6wDw qCHbZkdaNH6QGlg5BSEM1hOKLWpkVWfztuHa2c7y4cEoiFF5Z8d1CBcHVqZGWj7jup2nl gnbD9cZvFLRJ6QvKQIgC9Ke5EN/IdDYK5hNX+tpkUIapt5inzQ4uZehqvizyqqjBwLtDx U3LXLKiJE2S5kL/PPwlIi+F6PC35/ncCGEeJ43Xd8sJ9NyPwUgz5Vzy8ZgaE686qI4Q== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792431529; 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=l/5je6k7rCChD+zg8W/wKE+SGiPLHXlmUObVm64cOV8=; b=CV3J1mWWhpai9N6jCnzIa7Rj0LoVT3ojCk0T298EjXMhj5qdX07qPxDY/KNUk9o39pps skgUK0Cj1qf/83sAneeeqPLGRq3lwnXTLadnobfYSxefTf2cxrKmGgrGfgEFAEEGpaujN nsrwAsPa1BByJxz+l56OgKAZyKaD7M69JOv955Kc5Q2JSsjcFCiS7uJweD1mPlI75/9jr tkTa3Xl5zMpzZrVGka7ibk46lcVL3RkHQ2MLK2P0j2kgccP6ZJijLd1oxnlFDmeNA2ghO 6PqpAFpDG0KtSqhO35Ua2o+Zbo2fer4v5UuOunZmrbzm+BJFDDhnqMqU9Ibs67oHcbg== 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=Ec+TTAVM; 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 B665060A2638; Mon, 19 Oct 2026 17:38:44 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Ec+TTAVM 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=1792431518; b=0BZk2OWgroyUeS+ctYSS+NcAgi4Jq6H2vUh58jNgfHUTb5uwF8uMyPqHQlQtMaFwC1fv ui/lt2jgK+X0kfEtZUEirOLYiNUIRofamjJPsKG97sUkf9W02q8hTiqg9kicis2MkUTvj yq5Byf8+uz2wbqkICTTE5VNbpEzhfuFzERxZT9Vx/sIi1zMXYtfcJGLXQ1+SEjvV/5mct /Ux2PofvnJG5jh2YcH3tgYcUoXlBsXYegAhn3CZ7sFGNv7kLSwpJfw1AfmLl98BCLypqT 5HSiUZQrEJ2JHFPG59cSzjE5F51bhOJHP4nxs+3GfmrD8tnH8gpyhl/uI73QaSgeTjg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792431518; 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=l/5je6k7rCChD+zg8W/wKE+SGiPLHXlmUObVm64cOV8=; b=pyxkaLFlRZt2lHb3Gd3HrcwnmAA0r+mlWl4vfXYXMw19knVX5tfXTyWRxjxNp0atnVlK oaOs+DuFWkgcslVaYkQTNcGwFfCbhhea76pSA8m0YLqzoRxiPe+ZhDNmZPM3m+yhzgKFX ktiQaGxjYeWDe6Vuo2sm1rqTj8phRE6MSHvcThbbHz8GDI47vp8D0G+UHPwc+GcAlc/ts MOu+kCxTXdPkv1Lg3tmZYRADxHtdMpko3vNjGZGIHEeQceHGCQKtWkWEZmx+lT9K3VgKH 3ARvn3HUbdKDgBBiLI+NS20K0pLtZMTCpDI+CtTb6Zdrpjn4rf+S0NXgwi2oF3VvrUw== 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=Ec+TTAVM; 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 96AED606A322; Mon, 19 Oct 2026 17:38:38 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EB011F000C6; Mon, 19 Oct 2026 17:38:37 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792431518; bh=l/5je6k7rCChD+zg8W/wKE+SGiPLHXlmUObVm64cOV8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Ec+TTAVMpIXnFvD3nnTuDnPrPed7rwt5u8bfmSlR8IOnUSHLngT9RYARtt2t4nrbL LQoXxFhwLOkwulgWgarnktUCn6GpT1Tzp1CpkEgMn35qU90OeBhOE2WVgoZb5hGt0d C7Gq8DVAmV89ixvQSkgdjP3gE/QpCg+NUDTr4M8LvCZHtLYM4e2+bxgPWNZvKFeFiO m8yOYkvZzAlqdeGPDiOnbFMigbsHAy/aSQnfcM/82KPVN7JyYrb6ZtGpQB35C7et0g a7kdrttnaeX4+2Vet0T8g5Q4XFtq+FhHC2oL4PZfPZRDMTiRnK55T3uhLmHG3YYxy2 W4vaWUPvoV4ZQ== X-Cc: maxime.chevallier@bootlin.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, Jose.Abreu@synopsys.com, boon.leong.ong@intel.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org X-In-Reply-To: <20261018-stmmac-rx-mb-v8-3-5f58c0b25849@oss.qualcomm.com> X-sashiko-severity: Low 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