Skip to content

Commit 1c16570

Browse files
committed
experiment01-tailgrow: add README.org
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
1 parent c11712a commit 1c16570

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

experiment01-tailgrow/README.org

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+

0 commit comments

Comments
 (0)