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

Fm backport/v1 #12254

Open
wants to merge 2 commits into
base: main-7.0.x
Choose a base branch
from
Open

Conversation

victorjulien
Copy link
Member

FM fixes backport.

inashivb and others added 2 commits December 9, 2024 20:52
(cherry picked from commit f97b4ec)
In multi instance flow manager setups, each flow manager gets a slice
of the hash table to manage. Due to a logic error in the chunked
scanning of the hash slice, instances beyond the first would always
rescan the same (first) subslice of their slice.

The `pos` variable that is used to keep the state of what the starting
position for the next scan was supposed to be, was treated as if it held
a relative value. Relative to the bounds of the slice. It was however,
holding an absolute position. This meant that when doing it's bounds
check it was always considered out of bounds. This would reset the sub-
slice to be scanned to the first part of the instances slice.

This patch addresses the issue by correctly handling the fact that the
value is absolute.

Bug: OISF#7365.

Fixes: e9d2417 ("flow/manager: adaptive hash eviction timing")
(cherry picked from commit ae072d5)
Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.19%. Comparing base (9be2eca) to head (48916b1).

Additional details and impacted files
@@             Coverage Diff             @@
##           main-7.0.x   #12254   +/-   ##
===========================================
  Coverage       83.19%   83.19%           
===========================================
  Files             922      922           
  Lines          260888   260888           
===========================================
+ Hits           217048   217050    +2     
+ Misses          43840    43838    -2     
Flag Coverage Δ
fuzzcorpus 64.19% <0.00%> (-0.01%) ⬇️
suricata-verify 63.38% <100.00%> (-0.01%) ⬇️
unittests 62.37% <0.00%> (ø)

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

Copy link
Contributor

@jufajardini jufajardini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistent with the original backports. I understand we'll still have to wait on QA results, but from code alone, it looks good.

Comment on lines +387 to 392
* \param td FM timeout thread instance
* \param f head of the evicted list
*/
static void FlowManagerHashRowClearEvictedList(
FlowManagerTimeoutThread *td, Flow *f, SCTime_t ts, FlowTimeoutCounters *counters)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth/ important to add the missing params to the docs, or not worthy waiting for another iteration? (I suppose not 🤔 )

@suricata-qa
Copy link

WARNING:

ERROR: QA failed on SURI_TLPR1_alerts_cmp.

field baseline test %
SURI_TLPW2_autofp_stats_chk
.uptime 145 140 96.55%
SURI_TLPR1_stats_chk
.app_layer.flow.ftp 33163 36871 111.18%
.app_layer.error.http.parser 699 728 104.15%
.app_layer.error.ssh.parser 124 128 103.23%

Pipeline 23765

@victorjulien victorjulien added the needs baseline update QA will need a new base line label Dec 10, 2024
@victorjulien victorjulien marked this pull request as draft December 10, 2024 09:30
@victorjulien
Copy link
Member Author

Setting to draft to avoid merge before 7.0.8, as this is postponed to 7.0.9.

@victorjulien victorjulien marked this pull request as ready for review December 12, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs baseline update QA will need a new base line
Development

Successfully merging this pull request may close these issues.

5 participants