gk: convert all batched lookups into coroutines#370
gk: convert all batched lookups into coroutines#370AltraMayor wants to merge 4 commits intomasterfrom
Conversation
AltraMayor
left a comment
There was a problem hiding this comment.
gk: add support to coroutines
mengxiang0811
left a comment
There was a problem hiding this comment.
gk: add support to coroutines
mengxiang0811
left a comment
There was a problem hiding this comment.
gk: add support to coroutines
mengxiang0811
left a comment
There was a problem hiding this comment.
gk: move processing of front packets to coroutines
|
The code has incorporated all the feedback. |
ce44b94 to
a93ecb0
Compare
mengxiang0811
left a comment
There was a problem hiding this comment.
gk: add support to coroutines
|
This pull request needs to resolve the conflicts. |
547c8a1 to
cb555c1
Compare
Library CORO implements coroutines.
eac1227 to
da3a660
Compare
|
Below is the performance evaluation of the master branch with our updated scripts: |
|
Below is the performance evaluation after applying this pull request: |
|
Below is the CPU cycles profiling with 3 lcores + 2^25 flow entries: Below is the memory loads profiling with 3 lcores + 2^25 flow entries: Below is the stats with 3 lcores + 2^25 flow entries: Note that the above profiling results are after applying the pull request. |
This patch gets everything set up to do the work of gk_proc() inside coroutines, but no work is actually moved into coroutines. The following patches gradually move the work of gk_proc() into coroutines.
|
Below is the performance evaluation after applying the latest updated pull request: Below is the CPU cycles profiling with 3 lcores + 2^25 flow entries: Below is the memory loads profiling with 3 lcores + 2^25 flow entries: Below is the stats with 3 lcores + 2^25 flow entries: |
This patch moves the following work to coroutines: 1. scanning of the flow table; 2. processing of front packets. Besides moving the processing of front packets to coroutines this patch streamlines the code to better fit the new model. For example, this patch simplifies the parameters of process_flow_entry() and its subordinate functions: gk_process_request(), gk_process_granted(), gk_process_declined(), and gk_process_bpf().
This patch prefetches the transmission fields of a packet when it is ready to be prepared for transmission.
436ab22 to
e52bbf2
Compare
AltraMayor
left a comment
There was a problem hiding this comment.
gk: move some work to coroutines
| if (likely(has_rss)) { | ||
| task->task_hash = pkt->hash.rss; |
There was a problem hiding this comment.
We must rewrite pkt->hash.rss with pkt->hash.rss >> rss_bits, where rss_bits is pkt->hash.rss are constant for a given GK instance.
GK blocks batch lookups to the flow table and the LPM table. This pull request reverts these batched lookups back to single lookups and moves the code into coroutines.