From: sashiko-bot@kernel.org
To: "Tjerk Kusters" <tkusters@aweta.nl>
Cc: intel-wired-lan@lists.osuosl.org, bpf@vger.kernel.org
Subject: Re: [PATCH net v7 1/3] igb: do not let XDP frames span more than one Rx buffer
Date: Sat, 21 Nov 2026 11:11:14 +0000 [thread overview]
Message-ID: <sashiko-outbox-226971@kernel.org> (raw)
In-Reply-To: <20261120-igb-rx-ts-fix-v7-1-63b03045978e@aweta.nl>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] igb: missing IGB_TS_HDR_LEN room in 2 KiB build_skb buffers
with XDP
--
commit 91c56c1d76e1bd0d76622dd294c28474abad9f0e
Author: Tjerk Kusters <tkusters@aweta.nl>
igb: do not let XDP frames span more than one Rx buffer
This commit limits RLPML and VMOLR to the configured maximum frame size while
XDP is attached, accounts for the inline Rx timestamp header when checking if
a frame fits in one Rx buffer, and prevents rx-all or legacy-rx changes from
bypassing those limits.
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 ce91dda00ec0e..5f1a5e2240e64 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
[ ... ]
> @@ -2886,6 +2946,27 @@ static int igb_setup_tc(struct net_device *dev, enum tc_setup_type type,
> }
> }
>
> +/* Check that a frame fits in one Rx buffer together with the inline Rx
> + * timestamp header, for the buffer size igb_set_rx_buffer_len() selects.
> + * The ring flags are only updated when the rings are configured, so they
> + * are not used here. For build_skb rings the frame is limited to
> + * IGB_MAX_FRAME_BUILD_SKB, which is below the 2 KiB hardware buffer size
> + * even with the header.
> + */
> +static bool igb_xdp_frame_fits(struct igb_adapter *adapter, int max_frame)
> +{
> +#if (PAGE_SIZE < 8192)
> + if (!(adapter->flags & IGB_FLAG_RX_LEGACY)) {
> + if (max_frame <= IGB_MAX_FRAME_BUILD_SKB &&
> + !IGB_2K_TOO_SMALL_WITH_PADDING)
> + return true;
[Severity: High]
Can a frame with an inline Rx timestamp overflow into skb_shared_info on a
2 KiB build_skb buffer?
Although IGB_MAX_FRAME_BUILD_SKB + IGB_TS_HDR_LEN fits inside the 2048-byte
hardware buffer size in SRRCTL, DMA on a build_skb buffer starts at
IGB_SKB_PAD and must leave SKB_DATA_ALIGN(sizeof(struct skb_shared_info))
bytes at the end of the 2 KiB slice:
drivers/net/ethernet/intel/igb/igb.h:igb_skb_pad() {
...
else
rx_buf_len = IGB_RXBUFFER_1536;
/* if needed make room for NET_IP_ALIGN */
rx_buf_len -= NET_IP_ALIGN;
return igb_compute_pad(rx_buf_len);
}
Because igb_skb_pad() sets IGB_SKB_PAD to
SKB_WITH_OVERHEAD(IGB_RXBUFFER_2048) - IGB_MAX_FRAME_BUILD_SKB without
reserving IGB_TS_HDR_LEN (16 bytes), only IGB_MAX_FRAME_BUILD_SKB bytes are
available between the DMA start offset and skb_shared_info.
When hardware Rx timestamping is enabled (E1000_RXDADV_STAT_TSIP) and RLPML
or VMOLR allows frames up to max_frame_size (or IGB_MAX_FRAME_BUILD_SKB), the
MAC strips the 4-byte FCS and prepends the 16-byte timestamp, writing
wire_len + 12 bytes from IGB_SKB_PAD. A frame with wire_len between
IGB_MAX_FRAME_BUILD_SKB - 11 and IGB_MAX_FRAME_BUILD_SKB (for example at MTU
1500..1510) pushes xdp.data_end up to 12 bytes past
SKB_WITH_OVERHEAD(IGB_RXBUFFER_2048). On XDP_PASS, igb_build_skb() ->
napi_build_skb() zeroes skb_shared_info over the end of the payload and
__skb_put() advances skb->tail past skb->end, triggering skb_over_panic() on
a later skb_put() or skb_copy(); on XDP_TX or XDP_REDIRECT,
xdp_update_frame_from_buff() hits XDP_WARN and drops the frame.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-igb-rx-ts-fix-v7-0-63b03045978e@aweta.nl?part=1
next prev parent reply other threads:[~2026-11-21 11:11 UTC|newest]
Thread overview: 9+ 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
2026-11-20 11:10 ` 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
2026-11-20 11:10 ` Tjerk Kusters via B4 Relay
2026-11-21 11:11 ` sashiko-bot [this message]
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
2026-11-20 11:10 ` Tjerk Kusters via B4 Relay
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
2026-11-20 11:10 ` Tjerk Kusters via B4 Relay
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=sashiko-outbox-226971@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=sashiko-reviews@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.