suricata
suricata copied to clipboard
dpdk: replace TSC clock with GetTime (gettimeofday) function v1
Getting time through the Time Stamp Counter (TSC) can be precise and fast, however only for a short duration of time. The implementation across CPUs seems to vary. The original idea is to increment the counter with every tick. Then dividing the delta of CPU ticks by the CPU frequency can return the time that passed. However, the CPU clock/frequency can change over time, resulting in uneven incrementation of TSC. On some CPUs, this is handled by extra logic. As a result, obtaining time through this method might drift from real-time.
This commit therefore substitutes TSC time retrieval by the standard system call wrapped in the GetTime function - on Linux it is gettimeofday.
Ticket: 7115 https://redmine.openinfosecfoundation.org/issues/7115
Describe changes: v1
- initial work