File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # -*- fill-column: 76; -*-
2+ #+TITLE: Experiment01 - Accessing data at packet end
3+ #+OPTIONS: ^:nil
4+
5+ This example shows how to access BPF packet data at XDP =data_end=.
6+ Examples like this are needed, as the programmer needs to convince the
7+ BPF verifier that access bounds are safe.
8+
9+ * Use-case: tail-grow timestamping
10+
11+ The BPF helper =bpf_xdp_adjust_tail= is being extended with
12+ capabilites to grow the packet size at tail. To use this for
13+ anything, we need to demo how to access packet data at XDP =data_end=.
14+
15+ One use-case, which is showing in main example [[file:xdp_prog_kern.c]],
16+ is is to **add timestamps in extended tailroom** at XDP processing
17+ time, which will survive when packet is processed by network-stack
18+ (via XDP_PASS). One way to capture this timestamp is to use
19+ =tcpdump=, which could use this to determine the time spend in
20+ network-stack (on NIC without hardware timestamps).
21+
You can’t perform that action at this time.
0 commit comments