diff options
| author | 2026-11-10 15:24:17 +0100 | |
|---|---|---|
| committer | 2026-11-10 15:24:18 +0100 | |
| commit | ead744fd1ce03e735b50cb6b2c8863063c619149 (patch) | |
| tree | 5f5c43cfcc0fdb04bc1520103a4fab5b6705aa10 /tools/perf/tests/shell/test_stackcollapse_python.sh | |
| parent | net: dsa: microchip: initialize the IRQ access mutex (diff) | |
| parent | selftests: drv-net: ping: test generic XDP redirect to cpumap (diff) | |
Merge branch 'net-fix-mac_len-of-skbs-copied-by-generic-xdp'
Tianyi Gao says:
====================
net: fix mac_len of skbs copied by generic XDP
Generic XDP copies the skb before it runs a program with frags support.
The copy happens when the skb is cloned, nonlinear, or has less than 256
bytes of headroom. skb_pp_cow_data() makes the copy, but it does not
copy mac_len. After XDP, the skb has mac_len 0.
Two places after generic XDP move skb->data by mac_len:
- On XDP_REDIRECT to a cpumap, cpu_map_generic_redirect() pulls mac_len
bytes, the length of the Ethernet header. Then it queues the skb to
the target CPU. With mac_len 0, the IP layer on that CPU sees the
Ethernet header and drops the packet.
- On XDP_PASS, the skb can go on to tc ingress with a BPF program
attached (tcx, cls_bpf or act_bpf). Before it runs the program, tc
pushes mac_len bytes, the length of the Ethernet header. With
mac_len 0, skb->data stays at the IP header. Therefore, the program
reads the IP header as the Ethernet header.
Patch 1 copies mac_len in skb_pp_cow_data(). Patch 2 adds a test to
drivers/net/ping.py. The test redirects packets to a cpumap in generic
XDP. On netdevsim, the test fails without patch 1.
====================
Link: https://patch.msgid.link/20261103200036.65764-2-tianyi@cloudflare.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/perf/tests/shell/test_stackcollapse_python.sh')
0 files changed, 0 insertions, 0 deletions
