Skip to content

Commit ac85f58

Browse files
committed
experiment01-tailgrow: describe xdp_tailgrow_parse code
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
1 parent 1c16570 commit ac85f58

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

experiment01-tailgrow/README.org

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ The BPF helper =bpf_xdp_adjust_tail= is being extended with
1212
capabilites to grow the packet size at tail. To use this for
1313
anything, we need to demo how to access packet data at XDP =data_end=.
1414

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
15+
One use-case is to *add timestamps in extended tailroom* at XDP
16+
processing time, which will survive when packet is processed by
17+
network-stack (via XDP_PASS). One way to capture this timestamp is to
18+
use =tcpdump=, which could use this to determine the time spend in
2019
network-stack (on NIC without hardware timestamps).
2120

21+
In main example [[file:xdp_prog_kern.c]], the =xdp_tailgrow_parse= code
22+
implements this by parsing up-to the IP-layer, and using the
23+
IP-headers total-length field ([[https://elixir.bootlin.com/linux/v5.6.10/source/include/uapi/linux/ip.h#L97][iphdr->tot_len]]). See the code for the
24+
strange bounding checks needed to convince the verifier. Notice, this
25+
is limited to IPv4 ICMP packets for testing purposes.

0 commit comments

Comments
 (0)