Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dpdk: replace TSC clock with GetTime (gettimeofday) function v2 #11409

Closed
wants to merge 1 commit into from

Conversation

lukashino
Copy link
Contributor

Rebase of #11389

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:
v2

  • rebased
    v1
  • initial work

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
Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.43%. Comparing base (653e702) to head (1ac535d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11409      +/-   ##
==========================================
- Coverage   82.45%   82.43%   -0.03%     
==========================================
  Files         938      938              
  Lines      248036   248018      -18     
==========================================
- Hits       204523   204453      -70     
- Misses      43513    43565      +52     
Flag Coverage Δ
fuzzcorpus 60.10% <ø> (ø)
livemode 18.71% <80.00%> (-0.01%) ⬇️
pcap 43.74% <ø> (-0.03%) ⬇️
suricata-verify 61.41% <ø> (+<0.01%) ⬆️
unittests 59.43% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 21355

@victorjulien victorjulien added this to the 8.0 milestone Jul 4, 2024
@victorjulien
Copy link
Member

Merged in #11431, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants