Open
Description
Some services need to get a timestamp to implement an aging mechanism. eBPF provides the bpf_ktime_get_ns
helper, however we identified this function is slow in different benchmarks.
pcn-simplebride
[1] and pcn-iptables
[2] implement this by having a map that stores a timestamp that is updated by a thread in user-space, this solution is not ideal as each cube instance has a different thread just to update the timestamp.
This feature should be implemented directly in polycube, having a single thread for all the system to update that counter.
[1] 9a58dd3
[2] https://github.com/polycube-network/polycube/blob/master/src/services/pcn-iptables/src/modules/ConntrackTableUpdate.cpp#L110