On 6/4/20 7:30 AM, Federico Parola wrote: > Hello everybody, > I'm implementing a token bucket algorithm to apply rate limit to traffic and I need the timestamp of packets to update the bucket. To get this information I'm using the bpf_ktime_get_ns() helper but I've discovered it has a non negligible impact on performance. I've seen there is work in progress to make hardware timestamps available to XDP programs, but I don't know if this feature is already available. Is there a faster way to retrieve this information? > Thanks for your attention. > bpf_ktime_get_ns should be fairly light. What kind of performance loss are you seeing with it? XDP does not support access to h/w timestamps at the moment.