> For the skb, the timestamp is read from the header before the XDP
> program runs, so XDP_PASS keeps it even if the program changes the
> packet. XDP therefore works with rx timestamping enabled.
> 
> Add xmo_rx_timestamp so XDP programs can read the timestamp with
> bpf_xdp_metadata_rx_timestamp(). It returns -ENODATA if timestamping
> is not enabled or the device did not timestamp the packet. Install the
> metadata ops also if only VIRTIO_NET_F_RX_TSTAMP is negotiated;
> rx_hash returns -ENODATA then.
> 
> Like the hash, the timestamp is copied into struct virtnet_xdp_buff
> before the program runs, so the callback still works after the program
> changed the headroom with bpf_xdp_adjust_head() or
> bpf_xdp_adjust_meta().
> 
> Signed-off-by: Steffen Trumtrar <[email protected]>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/20261112-v6-7-topic-virtio-net-ptp-v5-0-7ab67b572...@pengutronix.de?part=8


Reply via email to