From: netdev-bot+sashiko@kernel.org
To: tkusters@aweta.nl
Cc: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
sdf@fomichev.me, sven.auhagen@voleatech.de,
richardcochran@gmail.com, kurt@linutronix.de,
sriram.yagnaraman@ericsson.com, intel-wired-lan@lists.osuosl.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, maciej.fijalkowski@intel.com, p@1g4.org,
stable@vger.kernel.org
Subject: Re: [PATCH net v7 3/3] igb: do not split AF_XDP zero-copy frames over several Rx buffers
Date: Tue, 24 Nov 2026 11:28:57 +0000 [thread overview]
Message-ID: <179551973728.3135.7219099542453397459@kernel.org> (raw)
In-Reply-To: <20261120-igb-rx-ts-fix-v7-3-63b03045978e@aweta.nl>
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] This is a hardware-dependent DMA bound.
--
igb: do not split AF_XDP zero-copy frames over several Rx buffers
The patch programs SRRCTL.BSIZEPKT for AF_XDP zero-copy rings with the
same 2 KiB or 3 KiB buffer size as the other rings. Before, it used the
XSK frame size rounded down to 1 KiB. To keep DMA inside the XSK frame,
it relies on the receive length limit and adds checks on pool bind, MTU
change, ring setup and VF enable, so that the frame plus the timestamp
header fits.
Link: https://lore.kernel.org/all/20261028083344.3047350-3-p@1g4.org/
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index a59ee6575c560..d3165ae97b00d 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
[ ... ]
> @@ -4846,9 +4882,13 @@ void igb_setup_srrctl(struct igb_adapter *adapter, struct igb_ring *ring)
> u32 srrctl = 0;
> u32 buf_size;
>
> - if (ring->xsk_pool)
> - buf_size = xsk_pool_get_rx_frame_size(ring->xsk_pool);
> - else if (ring_uses_large_buffer(ring))
> + /* SRRCTL.BSIZEPKT has a 1 KiB granularity, so programming the XSK
> + * frame size would round it down and split frames over several
> + * buffers. XSK rings use the same buffer size as the other rings.
> + * While XDP is attached, the receive length limit keeps frames
> + * within the XSK frame, see igb_xsk_frame_fits().
> + */
> + if (ring_uses_large_buffer(ring))
> buf_size = IGB_RXBUFFER_3072;
> else
> buf_size = IGB_RXBUFFER_2048;
[Severity: Medium]
After this change, BSIZEPKT can be larger than the XSK frame. With 2 KiB
aligned chunks and the default headroom, the XSK frame is 1792 bytes, but
BSIZEPKT is now 2048 (or 3072 with the 3K buffer flag). Before, BSIZEPKT
was never larger than the XSK frame, so the MAC could not DMA past it,
whatever the packet length.
The commit message says the receive length limit is now the only thing
that keeps the MAC inside the frame. Does that limit cover every ingress
path once VFs are enabled?
With VFs, igb_set_rlpml() leaves the global RLPML at MAX_JUMBO_FRAME_SIZE
and limits the PF only through its pool's VMOLR:
if (igb_xdp_is_enabled(adapter)) {
pool_rlpml = min(pool_rlpml, adapter->max_frame_size);
if (!vfn)
rlpml = min(rlpml, adapter->max_frame_size);
}
wr32(E1000_RLPML, rlpml);
igb_vmm_control() turns on loopback and replication whenever VFs exist:
if (adapter->vfs_allocated_count) {
igb_vmdq_set_loopback_pf(hw, true);
igb_vmdq_set_replication_pf(hw, true);
A VF can also raise its own pool limit to 9728 with the
E1000_VF_SET_LPE mailbox message, which igb_set_vf_rlpml() handles.
The patch explicitly allows VFs to be enabled while a zero-copy socket
is bound to PF queue 0. So this setup can be reached: XDP and a 2 KiB
chunk XSK pool on PF queue 0, plus VFs assigned to guests.
Suppose the 82576/i350 internal switch does not apply the destination
pool's VMOLR.RLPML to VF-to-PF loopback frames. Could a VF then send a
jumbo frame to the PF MAC address and make the MAC write up to BSIZEPKT
bytes from the DMA start of the XSK frame?
For the second 2 KiB chunk of a 4 KiB page, the frame ends exactly at
the page boundary. That would mean writing 256 bytes past the page, or
1280 bytes with 3K buffers. Aligned-mode UMEM pages are DMA-mapped one
at a time, so those bytes would go into unrelated memory, or cause a
fault when an IOMMU is present.
The tests in the commit message only used wire frames from a peer. Was
the loopback path tested? One example would be a VF with MTU 9000
sending to the PF while a 2 KiB chunk zero-copy socket is bound to PF
queue 0.
igb_xsk_frame_fits() compares max_frame + IGB_TS_HDR_LEN with the XSK
frame size. It never compares the XSK frame size with the programmed
BSIZEPKT, so it would not catch an ingress path that skips the per-pool
length check.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261120-igb-rx-ts-fix-v7-0-63b03045978e%40aweta.nl
prev parent reply other threads:[~2026-11-24 11:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 11:10 [PATCH net v7 0/3] igb: only strip the Rx timestamp header from the first buffer of a frame Tjerk Kusters via B4 Relay
2026-11-20 11:10 ` [PATCH net v7 1/3] igb: do not let XDP frames span more than one Rx buffer Tjerk Kusters via B4 Relay
2026-11-24 11:28 ` netdev-bot+sashiko
2026-11-20 11:10 ` [PATCH net v7 2/3] igb: only strip Rx timestamp header on the first buffer of a frame Tjerk Kusters via B4 Relay
2026-11-22 13:20 ` Tore Sinding Bekkedal
2026-11-20 11:10 ` [PATCH net v7 3/3] igb: do not split AF_XDP zero-copy frames over several Rx buffers Tjerk Kusters via B4 Relay
2026-11-24 11:28 ` netdev-bot+sashiko [this message]
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=179551973728.3135.7219099542453397459@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=p@1g4.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=richardcochran@gmail.com \
--cc=sdf@fomichev.me \
--cc=sriram.yagnaraman@ericsson.com \
--cc=stable@vger.kernel.org \
--cc=sven.auhagen@voleatech.de \
--cc=tkusters@aweta.nl \
/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
all inboxes | Powered by JetHome®