]> git.ipfire.org Git - thirdparty/suricata.git/commit
dpdk: replace TSC clock with GetTime (gettimeofday) function
authorLukas Sismis <lsismis@oisf.net>
Wed, 26 Jun 2024 21:33:52 +0000 (23:33 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 4 Jul 2024 13:39:06 +0000 (15:39 +0200)
commit35dffc6b32edefdccff18710abdb6f7bc6a1145f
treeb2eb8c8854fa93d07a72857afe778f2263ee6291
parenta7af37184356db81286cc35ad49388d49ed6eff1
dpdk: replace TSC clock with GetTime (gettimeofday) function

Getting clock through 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 the real
time.

This commit therefore substitues TSC time retrieval by the standard system
call wrapped in GetTime function - on Linux it is gettimeofday.

Ticket: 7115
src/runmode-dpdk.c
src/source-dpdk.c