luigirizzo / netmap

Automatically exported from code.google.com/p/netmap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time resolution on rx sync

vvsvvsvvs opened this issue · comments

Time resolution of microtime() is not enough for bursts of 1. There is a need for ktime_get_ts64().
How to reproduce:
run the bridge on the same interface with burst equal to 1 (network->stack->userland mode) and take timestamp of the ring (ring->ts),
ping the netmap host from another computer like
ping -s1000 -q -i 0.00001 1.2.3.4
You will get timestamp difference of 0 for up to 100 packets on average computer with 1Gbit iface.

Point: rings_move(..) in bridge.c.

IMO you should be using hardware timestamps for this level of precision.

I sent a PR for this: https://github.com/luigirizzo/netmap/pull/877/files