Article View: linux.kernel.netdev
Article #21794Re: [PATCH net v2 4/5] vmxnet3: drop XDP frames that do not fit in one rx buffer
From: netdev-bot+sashiko
Date: Tue, 24 Nov 2026 13:26
Date: Tue, 24 Nov 2026 13:26
113 lines
12336 bytes
12336 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] In vmxnet3_rq_rx_complete() (drivers/net/vmxnet3/vmxnet3_drv.c),
the patch adds an early exit inside the `rcd->eop && rcd->err` branch:โฆ
- [Low] The patch changes the initialiser in vmxnet3_rq_rx_complete()
(drivers/net/vmxnet3/vmxnet3_drv.c:1618) from `bool skip_page_frags =โฆ
--
vmxnet3: drop XDP frames that do not fit in one rx buffer
With XDP enabled, a frame with sop set but not eop can land in a page_pool
head buffer. It then falls through to the skb path and crashes. This patch
drops such frames and skips their body buffers. It also starts each poll
with skip_page_frags set when no frame is in progress, and avoids counting
a dropped frame twice when its last body buffer has rcd->err set.
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index e8be95c1d9f8e..66f677391bbbc 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -1614,7 +1614,8 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
> adapter->rx_prod_offset, adapter->rx_prod2_offset
> };
> u32 num_pkts = 0;
> - bool skip_page_frags = false;
> + /* A frame dropped at its head may continue in the next poll. */
> + bool skip_page_frags = !rq->rx_ctx.skb;
[Severity: Low]
This initializer runs on every poll in vmxnet3_rq_rx_complete(), with or
without XDP. Does it also change behaviour on the non-XDP rx path?
Before this patch, two head-buffer drops set only the poll-local
skip_page_frags: the netdev_alloc_skb_ip_align() failure and the
dma_map_single() failure.
Suppose the poll ended before the body completion became visible. The next
poll then started with skip_page_frags = false and ctx->skb == NULL, and the
body completion would hit this in the non-sop branch:
BUG_ON(ctx->skb == NULL && !skip_page_frags);
That problem seems to predate 54f00cce1178. With this change the non-XDP
case is fixed as well. Orphan body completions at the start of a poll are
now skipped silently instead of triggering the BUG_ON.
The subject, the Fixes: tag and this sentence in the commit message all
present the change as XDP-only:
"drop such frames: count them in drop_total, reuse the head buffer and
skip the body buffers, as the existing allocation failure path does."
Could the commit message say that the existing allocation failure path had
the same cross-poll problem, and that non-XDP rx behaviour changes too? The
non-XDP issue looks older than the Fixes: commit, so this would help
stable backport triage.
[ ... ]
> @@ -1662,10 +1663,27 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
> rxd->len != rbi->len);
>
> if (unlikely(rcd->eop && rcd->err)) {
> + /* The last body buffer of a frame already dropped */
> + if (!rcd->sop && skip_page_frags)
> + goto rcd_done;
[Severity: Low]
Does this skip assume that every path setting skip_page_frags has already
counted the frame in drop_total?
The head-buffer drops do increment drop_total. Those are the new XDP
oversize drop, the netdev_alloc_skb_ip_align() failure and the
dma_map_single() failure.
The two body-buffer drops later in vmxnet3_rq_rx_complete() set
skip_page_frags without touching drop_total:
if (unlikely(!new_page)) {
rq->stats.rx_buf_alloc_failure++;
dev_kfree_skb(ctx->skb);
ctx->skb = NULL;
skip_page_frags = true;
goto rcd_done;
}
The dma_map_page() failure branch right after it does the same.
Before this patch, suppose the final body completion of such a frame had
rcd->eop && rcd->err set. vmxnet3_rx_error() then counted the frame once in
drop_err and drop_total.
With this check, does that frame go uncounted in both? drop_total feeds
rx_dropped in vmxnet3_get_stats64() and the ethtool drop counters.
Would it make sense to increment drop_total in those two body-path failure
branches? Another option is to limit this skip to drops that were already
counted.
> vmxnet3_rx_error(rq, rcd, ctx, adapter);
> goto rcd_done;
> }
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123124855.1021-1-filzador%40gmail.com
Technical Details
Message-ID:
<179552678888.3135.8339153303682923721@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.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-370380-linux-kernel-netdev=dewy.ruReferences:
<20261123124855.1021-5-filzador@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.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-370380-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v2 4/5] vmxnet3: drop XDP frames that do not fit in one rx buffer Date: Tue, 24 Nov 2026 13:26:28 +0000 Organization: Usenet Network Message-ID: <179552678888.3135.8339153303682923721@kernel.org> References: <20261123124855.1021-5-filzador@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="4143800"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:R0/d2ryBgb3RH7YeKknX6HwUk5A= sha256:v3lNazIyggEw+YuG2s+sCKyJ/rkfJGm5MFjwpZ3xKPY= sha1:C4VMhMnu669z1xpEI23lGbwd70Q= sha256:cmCA0589nYVa33nRXLjKVB11B6jDnkfu92bHY4CNwF0= 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 D687C125E16; Tue, 24 Nov 2026 16:26:51 +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 gKGHoJ3JSV5t; Tue, 24 Nov 2026 16:26:44 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-370380-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 C2DAD125E17; Tue, 24 Nov 2026 16:26:35 +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 0F13B2D172; Tue, 24 Nov 2026 13:26:33 +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=1795526791; b=kxnDzyWMBcWbGs0fZ4NMX2zqR9bA0Bb1aPh81OveW1dfh1jIfhBNFGryahO1GmX28okn O+0hFPWxEs2pdO1vGuzaIUp2F0bzjSCd37tVV2b5wp3MCaUzNun1j6ulLDfAoRPYYLI47 Jqond5WXAqkbq+5QKY4xYQhNpKa7lY/P5lvSABiq6s6QcjsaxXg9PNfD28Ql5llU78Pz2 f6UksfopNsr/jbLlqicul4Q4KAfGwuYMtVn1T7sahEGxBbeVQGf3FJkW2r7JQSiOiy+7L cJiNCqUtBbC4KBlAczvw9+PsHxA3pfL3n9P1pAx1+20OQ/KuzO4IxkAvfMX+ELfRGCQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795526791; 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=BUFMmdOEluzkiFS1/VYvQjPKeZ2ocL8nf6EPYzQ1tVA=; b=JlSIWht/Ua+sYmb04u93t/Q4yFWOYqLUQHUks8YhfzrAiTdZI59Ia6k1vfOVZjKR4ZGa WvITbNG4hQVTcg5CWhyF+RkMyuwp7fkMz2tqATPjD1dEQqUqBg+ZV0xLTE+mGfI51dgQZ wEv1xTv2GkUX4kwwANLjIJAc0BE2JyQplIdiyFfNdEVSI92mJCdqUc1dmzSC8o0vPGR1G hvoN59l8Q209gwdZNfngwfg1F0a7CDZ42YVatKTzt6/wnZeYj5kAzsQawRsJwBkHiu/q9 cSaz3WiqyPSZEttcnxNo/F1jsTuWTn9u8vofKmnGO4STw7COmfikL4P7B+8NxLd/C0g== 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=VgR0xoAW; 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 28772606A32C; Tue, 24 Nov 2026 13:26:31 +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=VgR0xoAW 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=1795526790; b=1dd97NsC/gyLHM7UjhJ7i/ccF5oBkTxqymCGpW9Jtjq/WOdDQr/tBC18ix8uhZs5vcRC TkCXZcyAFXPzF/jw40zHWhn/hOGpaUuXR94FNfx0TbRRchEHsEMqKsAu1MUH7bv1e7+b0 Mb2JKI/vHuarjDLYIDEh63NweW6wd5UznSVUsdvDgg9k94G7SHhuI9UBRSw86TaFYEi5o 9W6iykbJV1Zt8iK3UqUupeB2SDR9RSHvnfHzixDa0u5P1CB9UNIdvncDUio0xN5n/dLBM 0sckGxr5kdlxyenyXw2fIZ2kwgrghYXBONApN1hmjkp/9Y6eU1zyqspqj9cP6ow6sNw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795526790; 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=BUFMmdOEluzkiFS1/VYvQjPKeZ2ocL8nf6EPYzQ1tVA=; b=3eHJ3pJ4wPPYXoLPEYq+tl8W+vcaj3WoxyYi7KBaRRaYEIV8P0BcSOusTWUew66tulIP pd3JHSKXEUPHS85filh3uXYovZfaWLdPp8/NNl2BYzTKejRykE3LRTYijfanuB+eSl4kZ fFd9GoZu4wATrzCwWbESLryijRoRg58iDYZX2AcL0RrMS+G+xTkts/4km7VgQES8otor9 E74A/Z2TnAC9Dt1huvA3KytuOpopRVyGIam9F/t3yJuiVsTGah1P/DAEJ2GQoCDhMi2XF jtjI7EKyZvAyXiBYqHFTaodGWoxv6avD2iW1vO1JpHdpdY8RQzgXw7Nf0gZU2iFom1g== 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=VgR0xoAW; 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 49425606A336; Tue, 24 Nov 2026 13:26:30 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B6A01F000C0; Tue, 24 Nov 2026 13:26:29 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795526790; bh=BUFMmdOEluzkiFS1/VYvQjPKeZ2ocL8nf6EPYzQ1tVA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=VgR0xoAWJuy9cj3Xzg/3436wkn4wGgTYr9Ek6hrvI1e8Hn0fVa4uTPhdeUPwhOTTh b5U+fIbAkEqSeNpvUpCAG+fZpr+WJWkseTLMiEYEuJS9UEbAoeS2u2j3Ug1id9wzIB gU0C9g44INMyloE2qrE0w0/sqaJ9XF/zmz10+69vkwjtxHhosNRprX/6qIs/mbKyDO e0mso1Q8UGjW/TDSXicpUxkDDFIfvj/oEojBrKEebfCr8TRN4KrkiSh0KPVwBtHpC2 WgsFSC7a1eeb24Q+WmAnTUl3If2xT0InhUsJSCBqYigauFGFqHsdrH0wuv2VjUVil+ bGU9sVvY9pANQ== X-Cc: ronak.doshi@broadcom.com, bcm-kernel-feedback-list@broadcom.com, netdev@vger.kernel.org, bpf@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, u9012063@gmail.com X-In-Reply-To: <20261123124855.1021-5-filzador@gmail.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