Skip to content

loader: retry with xdp frags#41967

Merged
julianwiedmann merged 1 commit intomainfrom
pr/vk/xdp/frags
Oct 7, 2025
Merged

loader: retry with xdp frags#41967
julianwiedmann merged 1 commit intomainfrom
pr/vk/xdp/frags

Conversation

@viktor-kurchenko
Copy link
Copy Markdown
Contributor

@viktor-kurchenko viktor-kurchenko commented Oct 1, 2025

The commit adds retry logic in case the XDP program loading failed with the invalid argument error.
The error might indicate that the network interface is configured with a jumbo MTU, so we can retry loading after setting the BPF_F_XDP_HAS_FRAGS flag and hope that the NIC driver is XDP Fragment aware.

The log snippet during testing the retry on Mellanox NICs:

time=2025-10-01T[  895.435879] bond0: (slave enp2s0f0np0): Error -22 calling ndo_bpf
18:56:14.308738377Z level=info msg="No existing link found for program" module=agent.datapath.loader link=/sys/fs/bpf/cilium/devices/bond0/links/cil_xdp_entry progName=cil_xdp_entry
time=2025-10-01T18:56:14.316262698Z level=error msg="loading eBPF program failed, setting XDP frags and retrying" module=agent.datapath.loader error="interface bond0: attaching program cil_xdp_entry using bpf_link: failed to attach link: create link: invalid argument"
time=2025-10-01T18:56:14.323170977Z level=info msg="Fallback node addresses updated" module=agent.datapath.node-address addresses="147.28.240.155 (primary), 2604:1380:4091:3200::1 (primary)" device=*
time=2025-10-01T18:56:14.536337704Z level=info msg="No existing link found for program" module=agent.datapath.loader link=/sys/fs/bpf/cilium/devices/bond0/links/cil_xdp_entry progName=cil_xdp_entry
time=2025-10-01T18:56:15.108612512Z level=info msg="Program attached using bpf_link" module=agent.datapath.loader progName=cil_xdp_entry
Allow to attach Cilium's XDP program on network interfaces that have jumbo MTU configured and support xdp.frags program type.

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Oct 1, 2025
@viktor-kurchenko viktor-kurchenko force-pushed the pr/vk/xdp/frags branch 3 times, most recently from ec4f818 to a74b4a4 Compare October 1, 2025 18:54
@viktor-kurchenko viktor-kurchenko changed the title XDP frags probe loader: retry with xdp frags Oct 1, 2025
@viktor-kurchenko viktor-kurchenko added area/loader Impacts the loading of BPF programs into the kernel. area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. release-note/minor This PR changes functionality that users may find relevant to operating Cilium. labels Oct 1, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Oct 1, 2025
@viktor-kurchenko viktor-kurchenko marked this pull request as ready for review October 1, 2025 19:04
@viktor-kurchenko viktor-kurchenko requested a review from a team as a code owner October 1, 2025 19:04
Copy link
Copy Markdown
Member

@dylandreimerink dylandreimerink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one thing, looks good otherwise.

The commit adds retry logic in case the XDP program loading failed with
the `invalid argument` error. The error might indicate that the network
interface is configured with a jumbo MTU, so we can retry loading after
setting the `BPF_F_XDP_HAS_FRAGS` flag and hope that the NIC driver is XDP
Fragment aware.

Signed-off-by: viktor-kurchenko <viktor.kurchenko@isovalent.com>
@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

/test

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Oct 6, 2025
@julianwiedmann
Copy link
Copy Markdown
Member

👋 very nice! Could you also please give this PR a release-note stanza which describes the user-visible impact of the improvement?

@julianwiedmann julianwiedmann added this pull request to the merge queue Oct 7, 2025
@viktor-kurchenko
Copy link
Copy Markdown
Contributor Author

👋 very nice! Could you also please give this PR a release-note stanza which describes the user-visible impact of the improvement?

Sure, but maybe you can point me to an example? I never did it before.

Merged via the queue into main with commit 62f4856 Oct 7, 2025
403 of 407 checks passed
@julianwiedmann julianwiedmann deleted the pr/vk/xdp/frags branch October 7, 2025 10:21
@cilium-release-bot cilium-release-bot bot moved this to Released in cilium v1.19.0 Feb 3, 2026
@ti-mo ti-mo added the needs-backport/1.18 This PR / issue needs backporting to the v1.18 branch label Feb 23, 2026
@ti-mo ti-mo added the backport-pending/1.18 The backport for Cilium 1.18.x for this PR is in progress. label Feb 23, 2026
@ti-mo ti-mo removed the needs-backport/1.18 This PR / issue needs backporting to the v1.18 branch label Feb 23, 2026
@github-actions github-actions bot added backport-done/1.18 The backport for Cilium 1.18.x for this PR is done. and removed backport-pending/1.18 The backport for Cilium 1.18.x for this PR is in progress. labels Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. area/loader Impacts the loading of BPF programs into the kernel. backport-done/1.18 The backport for Cilium 1.18.x for this PR is done. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.

Projects

No open projects
Status: Released

Development

Successfully merging this pull request may close these issues.

5 participants