]> git.ipfire.org Git - thirdparty/suricata.git/commit
dpdk: replace TSC clock with GetTime (gettimeofday) function 11492/head 11511/head
authorLukas Sismis <lsismis@oisf.net>
Sun, 14 Jul 2024 09:08:49 +0000 (11:08 +0200)
committerLukas Sismis <lukas.sismis@gmail.com>
Sun, 14 Jul 2024 09:12:06 +0000 (11:12 +0200)
commitee9aad22f72d28e620c1da68967448121247a99f
treeca1f4835834bb773c091c0ab0f2df9da0442ed11
parentf74fa898cf59705a981c7235091fcc535c0583ba
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: 7116

(cherry picked from commit 35dffc6b32edefdccff18710abdb6f7bc6a1145f)
src/runmode-dpdk.c
src/source-dpdk.c
src/source-dpdk.h