From: netdev-bot+sashiko@kernel.org
To: filzador@gmail.com
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
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 [thread overview]
Message-ID: <179552678888.3135.8339153303682923721@kernel.org> (raw)
In-Reply-To: <20261123124855.1021-5-filzador@gmail.com>
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
next prev parent reply other threads:[~2026-11-24 13:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 12:48 [PATCH net v2 0/5] vmxnet3: fix native XDP crash on oversized frames and XDP loss on reset Philipp Sudakas
2026-11-23 12:48 ` [PATCH net v2 1/5] vmxnet3: clear rx_ctx.skb after a data ring XDP verdict Philipp Sudakas
2026-11-23 12:48 ` [PATCH net v2 2/5] vmxnet3: keep the previous XDP program when attaching fails Philipp Sudakas
2026-11-24 13:26 ` netdev-bot+sashiko
2026-11-23 12:48 ` [PATCH net v2 3/5] vmxnet3: limit the XDP MTU to the rx head buffer size Philipp Sudakas
2026-11-23 12:48 ` [PATCH net v2 4/5] vmxnet3: drop XDP frames that do not fit in one rx buffer Philipp Sudakas
2026-11-24 13:26 ` netdev-bot+sashiko [this message]
2026-11-23 12:48 ` [PATCH net v2 5/5] vmxnet3: keep the XDP program across device resets Philipp Sudakas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179552678888.3135.8339153303682923721@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=filzador@gmail.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ronak.doshi@broadcom.com \
--cc=sdf@fomichev.me \
--cc=u9012063@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox