From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: <tkusters@aweta.nl>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
"Alexei Starovoitov" <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Stanislav Fomichev <sdf@fomichev.me>,
Sven Auhagen <sven.auhagen@voleatech.de>,
Richard Cochran <richardcochran@gmail.com>,
"Kurt Kanzenbach" <kurt@linutronix.de>,
<intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <bpf@vger.kernel.org>,
Paul Moses <p@1g4.org>, <stable@vger.kernel.org>,
Piotr Kwapulinski <piotr.kwapulinski@intel.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
Alexander Nowlin <alexander.nowlin@intel.com>
Subject: Re: [PATCH net v4 0/2] igb: only strip the Rx timestamp header from the first buffer of a frame
Date: Mon, 2 Nov 2026 14:28:55 +0100 [thread overview]
Message-ID: <auiQF5ZxaBDza8xq@boxer> (raw)
In-Reply-To: <20261102-igb-rx-ts-fix-v4-0-8785124c5d23@aweta.nl>
On Mon, Nov 02, 2026 at 10:58:12AM +0100, Tjerk Kusters via B4 Relay wrote:
> With Rx hardware timestamping enabled (e.g. by ptp4l), igb strips the
> 16-byte inline timestamp header from every Rx buffer of a frame instead
> of only from the first one. A continuation buffer that starts with 8
> zero bytes loses 16 bytes, so jumbo frames with zero payload arrive
> short and are dropped.
>
> v3 used skb == NULL to find the first buffer of a frame. The Sashiko
> AI review pointed out that this does not hold when an XDP program
> consumes the first buffer of a frame that spans several buffers, so v3
> was sent back for rework.
>
> The same question came up for igc. There, Maciej suggested not to track
> frame boundaries in the data path, but to make sure that frames never
> span several buffers while XDP is attached [1]. Paul Moses' igc v3 does
> that [2]. This version follows the same approach for igb:
>
> 1/2 limits the receive length (RLPML, or the PF pool's VMOLR with VFs)
> to the configured frame size while XDP is attached, and leaves
> room for the timestamp header in the XDP buffer size checks.
> 2/2 is v3, unchanged in code, with a note that it relies on 1/2.
> The Reviewed-by and Tested-by tags of v3 are kept for that reason.
>
> Not addressed here: the AF_XDP zero-copy Rx path. igb_clean_rx_irq_zc()
> has the same unguarded strip, and with 2 KiB UMEM chunks the hardware
> buffer is rounded down to 1 KiB, so frames span descriptors there. The
> igc counterpart is Maciej's buffer-size patch in [2]. I do not use
> AF_XDP and cannot test it, so I would prefer to leave that to someone
> who can.
I assume review bots will give you a hard time if you don't address this
within your series. Seems you have HW handy plus you do use LLM so I don't
see why you couldn't ask it to address AF_XDP zc rx ?
FWIW blessed user space tool has always been xdpsock:
https://github.com/xdp-project/bpf-examples/tree/main/AF_XDP-example
so you can ask llm to run this in rxdrop mode on receiver side and feed it
with some traffic from peer side and then see that frames were not
fragmented.
It's easier for you to cover this as you have HW.
>
> How to reproduce
> ----------------
> Receiver with igb (eth0), peer with MTU 8228. hwstamp_ctl turns on Rx
> timestamping with filter ALL, no ptp4l needed; this ping method is
> taken from Paul's igc report. One host with two ports also works if
> the sending port is moved into its own network namespace.
>
> 1) Truncated jumbo frames (patch 2)
>
> receiver: ip link set eth0 mtu 8228
> hwstamp_ctl -i eth0 -r 1
> peer: ping -c 5 -M do -s 8200 -p 00 <receiver>
>
> Without the series there are no replies, and IpExtInTruncatedPkts
> goes up by one per frame. With the series all requests are answered.
>
> 2) XDP consumes the first buffer (patch 1)
>
> receiver: ip link set eth0 mtu 3000
> hwstamp_ctl -i eth0 -r 1
> xdp-filter load -m native eth0
> xdp-filter ip <peer> -m src
> tcpdump -nn -e -i eth0 'ether src 00:00:00:00:00:00'
> peer: ping -c 3 -M do -s 8200 -p 00 <receiver>
>
> At MTU 3000 XDP can attach, but without patch 1 the MAC still accepts
> the 8242-byte frames, which then span three Rx buffers. xdp-filter
> drops the first one, and the rest reaches the stack as a separate
> frame with all-zero MAC addresses:
>
> without the series 5154 bytes (header stripped twice)
> v3 alone 5170 bytes (stripped once)
> this series no frame; rx_long_length_errors +1 per frame
>
> Tested on an I350, kernel 6.14.9 with these patches, with the steps
> above: results as listed. The v3 line is from an earlier run with an
> XDP program dropping ICMP. Also checked: XDP attach at MTU 3030 works,
> at MTU 3046 it is refused, as is an MTU change to 3046 with XDP
> attached. With two VFs allocated (booted with pci=realloc), step 2
> gives the same picture: three leftover frames without the series, none
> with it, as the PF pool limit in VMOLR drops the frames.
> Not tested: PAGE_SIZE >= 8192.
>
> The patches, their descriptions and this cover letter were prepared
> with the help of an AI coding assistant (Claude). I reviewed them and
> ran the tests above on my test bench.
>
> [1] https://lore.kernel.org/all/20261025065154.2037149-1-p@1g4.org/
> [2] https://lore.kernel.org/all/20261028083344.3047350-1-p@1g4.org/
>
> Changes in v4:
> - New patch 1: limit the receive length while XDP is attached, so that
> skb == NULL reliably marks the first buffer (Sashiko review), as
> done for igc.
> - Patch 2: no code change; added a note that it relies on patch 1.
> - Link to v3: https://patch.msgid.link/20260625-igb-rx-ts-fix-v3-1-99b3efa08dca@aweta.nl
>
> ---
> Tjerk Kusters (2):
> igb: do not let XDP frames span more than one Rx buffer
> igb: only strip Rx timestamp header on the first buffer of a frame
>
> drivers/net/ethernet/intel/igb/igb_main.c | 37 ++++++++++++++++++++++---------
> 1 file changed, 26 insertions(+), 11 deletions(-)
> ---
> base-commit: 2d3090a8aeb596a26935db0955d46c9a5db5c6ce
> change-id: 20260619-igb-rx-ts-fix-cd70585ee316
>
> Best regards,
> --
> Tjerk Kusters <tkusters@aweta.nl>
>
>
next prev parent reply other threads:[~2026-11-02 13:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 9:58 Tjerk Kusters via B4 Relay
2026-11-02 9:58 ` [PATCH net v4 1/2] igb: do not let XDP frames span more than one Rx buffer Tjerk Kusters via B4 Relay
2026-11-03 11:16 ` netdev-bot+sashiko
2026-11-02 9:58 ` [PATCH net v4 2/2] igb: only strip Rx timestamp header on the first buffer of a frame Tjerk Kusters via B4 Relay
2026-11-03 11:16 ` netdev-bot+sashiko
2026-11-02 13:28 ` Maciej Fijalkowski [this message]
2026-11-02 14:55 ` [PATCH net v4 0/2] igb: only strip the Rx timestamp header from " Tjerk Kusters
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=auiQF5ZxaBDza8xq@boxer \
--to=maciej.fijalkowski@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=alexander.nowlin@intel.com \
--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=netdev@vger.kernel.org \
--cc=p@1g4.org \
--cc=pabeni@redhat.com \
--cc=piotr.kwapulinski@intel.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=richardcochran@gmail.com \
--cc=sdf@fomichev.me \
--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®