The fact is i am a beginner in such programming. How can I get timestamp in the xdp program. A detail step by step instruction would be helpful for me. Right now, even I linked the the header library in the makefile with -l flag but it is not working. Echoing the path
Receive nic rx timestamp for every rx packet.
In kernel v6.3 the
bpf_xdp_metadata_rx_timestampkfunc was added which adds exactly this functionality.In kernek v6.5 support for the igc driver was added.
According to example code found in the kernel selftests this should work (disclaimer: have not personally tested this):
Note that before the addition of this kfunc this info is also available, but only in program that use __sk_buff contexts, so not XDP.