Access Hardware Timestamp in eBPF Program
Hi *,
in my program I use CMSGs to access hardware arrival timestamps of an Intel I210 rx queue.
Is there a way to access such timestamps in a XDP eBPF program?
Best regards,
Christoph Kuhr
Quoted 4 lines · Christoph Kuhr
Hi *,
in my program I use CMSGs to access hardware arrival timestamps of an Intel I210 rx queue.
Hi Christoph,
First of all I210 does not support native XDP. It still means that you can use XDP but in so called generic mode which works for all net devices. However it's not as quick as native implementation in the driver, because it operates after skb is allocated.
Actually it's way slower, but it can still be much faster in many cases than regular *sbk* path.
Quoted 1 line
Is there a way to access such timestamps in a XDP eBPF program?
Unfortunately, as of now there is no universal way for XDP programs, even in native mode, to access information taken from hardware, e.g. from Rx descriptor. Technically it would be possible, but there are no interfaces now that would allow common scheme for different drivers. Right now it is possible to convey additional information to xdp buff via data_meta field, but now it's strictly driver specific and XDP programs has no direct information into what is in the data_meta section.
Given that I210 would only work in generic mode, this would be even more difficult since as I checked, with current implementation when skb is *converted* back to xdp_buff it does not support passing data_meta from skb to XDP.
Quoted 3 lines
Best regards,
Christoph Kuhr
Quoted 7 lines · Piotr Raczynski
Quoted 1 line
Is there a way to access such timestamps in a XDP eBPF program?
Unfortunately, as of now there is no universal way for XDP programs, even in native mode, to access information taken from hardware, e.g. from Rx descriptor. Technically it would be possible, but there are no interfaces now that would allow common scheme for different drivers.
Adding this is on the TODO list, though:
https://github.com/xdp-project/xdp-project/blob/master/xdp-project.org#metadata-available-to-programs
-Toke