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

af-packet: speed up thread sync during startup #11828

Closed
wants to merge 1 commit into from

Conversation

victorjulien
Copy link
Member

Threads are initialized sequentially to allow for a predictable mapping of threads and queues. Not all parts of the start up need to be done sequentially. The setting up of the rings can be very expensive, taking of a couple of hundred milliseconds. The ring setup doesn't need to be done sequentially though.

This patch releases the thread early, after bind but before the ring setups.

Ticket: #7272.

Replace #11806

https://redmine.openinfosecfoundation.org/issues/7272

Threads are initialized sequentially to allow for a predictable mapping
of threads and queues. Not all parts of the start up need to be done
sequentially. The setting up of the rings can be very expensive, taking
of a couple of hundred milliseconds. The ring setup doesn't need to be
done sequentially though.

This patch releases the thread early, after bind but before the ring
setups.

Ticket: OISF#7272.
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

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

Project coverage is 82.59%. Comparing base (c55c7d6) to head (e818aeb).
Report is 179 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11828      +/-   ##
==========================================
+ Coverage   82.57%   82.59%   +0.01%     
==========================================
  Files         912      912              
  Lines      249357   249358       +1     
==========================================
+ Hits       205918   205961      +43     
+ Misses      43439    43397      -42     
Flag Coverage Δ
fuzzcorpus 60.59% <0.00%> (+0.03%) ⬆️
livemode 18.76% <75.00%> (+0.03%) ⬆️
pcap 44.07% <0.00%> (-0.04%) ⬇️
suricata-verify 62.01% <0.00%> (+0.01%) ⬆️
unittests 58.93% <0.00%> (-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 22793

Copy link
Contributor

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

Thanks for the work.

CI : ok
Commits segmentation : ok
Commit messages : ok
Git ID set : ok
CLA : you already contributed
Doc update : not needed
Redmine ticket : thanks for the ticket
Rustfmt : no rust
Tests : I do not think we have a good way to test such optimizations, do we ?
Dependencies added: none
Code : good

@catenacyber
Copy link
Contributor

@victorjulien are you not merging this ?

@victorjulien
Copy link
Member Author

I think I saw one case where this didn't start up, but I did not record it. So want to do some more testing.

@victorjulien victorjulien marked this pull request as draft November 28, 2024 08:53
@victorjulien
Copy link
Member Author

I've been running this in a loop for a long time, and under load. Haven't seen issues.

@victorjulien victorjulien added this to the 8.0 milestone Dec 4, 2024
@victorjulien victorjulien marked this pull request as ready for review December 4, 2024 10:36
@victorjulien
Copy link
Member Author

Merged in #12222, thanks!

@victorjulien victorjulien deleted the af-packet-startup/v3 branch January 15, 2025 09:07
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