Why is setting SO_TIMESTAMP not supported for an AF_XDP socket? The user manual of my driver (mlnx 5.0) states that
Incoming packets are time-stamped before they are distributed on the PCI depending on the congestion in the PCI buffers.
To my knowledge, before distributed on the PCI means that there is no Linux Kernel involved (yet) - right?
I tried setting it like this:
int timestamp = SOF_TIMESTAMPING_RX_HARDWARE;
if(setsockopt(xsk_socket__fd(xsk_socket->xsk), SOL_XDP, SO_TIMESTAMP, (int*)×tamp, sizeof(int)) < 0) {
fprintf(stderr, "Failed to set `SO_TIMESTAMP`: %s\n", strerror(errno));
return;
}
And get:
Failed to set
SO_TIMESTAMP: Protocol not available
I copied the definition of SO_XDP from xsk.c (https://github.com/libbpf/libbpf/blob/master/src/xsk.c):
#ifndef SOL_XDP
#define SOL_XDP 283
#endif
I don't understand, why it is not supported...