-
Notifications
You must be signed in to change notification settings - Fork 1.7k
dpdk: use DPDK EAL threads for workers v5.1 #14691
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
caab5fa
6059f64
61b22f1
8904cfd
f675be2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,11 +57,13 @@ struct TmSlot_; | |
|
|
||
| /** \brief Per thread variable structure */ | ||
| typedef struct ThreadVars_ { | ||
| pthread_t t; | ||
| uint64_t thread_id; | ||
| /** function pointer to the function that runs the packet pipeline for | ||
| * this thread. It is passed directly to pthread_create(), hence the | ||
| * void pointers in and out. */ | ||
| void *(*tm_func)(void *); | ||
| void (*tm_spawn)(struct ThreadVars_ *); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are these in ThreadVars and not a global thread API table of sorts?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the answer is in
thread |
||
| void (*tm_join)(struct ThreadVars_ *); | ||
|
|
||
| char name[16]; | ||
| char *printable_name; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,10 @@ typedef void (*ThreadExitPrintStatsFunc)(ThreadVars *, void *); | |
| typedef struct TmModule_ { | ||
| const char *name; | ||
|
|
||
| /** thread management, if unspecified, falls back to pthreads */ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need these in a TmModule instead of globally?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the DPDK capture method, we only need to create DPDK lcores for worker threads.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is mainly because a single DPDK lcore is not intended to run multiple separate threads.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so the dpdk threading support is only a partial replacement for the pthreads inside a single process? Some threads use the dpdk logic, other pure pthreads?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correct. DPDK threads still use pthreads at the core so they are compatible but they should be manipulated through DPDK calls ideally.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With regards to global setting, we could have thread management callbacks on the level of thread families so it does not need to be stored within ThreadVars directly and repeatedly. |
||
| void (*ThreadSpawn)(ThreadVars *); | ||
| void (*ThreadJoin)(ThreadVars *); | ||
|
|
||
| /** thread handling */ | ||
| TmEcode (*ThreadInit)(ThreadVars *, const void *, void **); | ||
| void (*ThreadExitPrintStats)(ThreadVars *, void *); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pthread_tis an opaque type that we can't assume to fit in auint64_t