| f3527e0b | 14-Jan-2021 |
Feifei Wang <[email protected]> |
examples/eventdev: move ethdev stop to the end
Move eth stop code from "signal_handler" function to the end of "main" function. There are two reasons for this:
First, this improves code maintenance
examples/eventdev: move ethdev stop to the end
Move eth stop code from "signal_handler" function to the end of "main" function. There are two reasons for this:
First, this improves code maintenance and makes code look simple and clear. Based on this change, after receiving the interrupt signal, "fdata->done" is set as 1. Then the main thread will wait all worker lcores to jump out of the loop. Finally, the main thread will stop and then close eth dev port.
Second, for older version, the main thread first stops eth dev port and then waits the end of worker lcore. This may cause errors because it may stop the eth dev port which worker lcores are using. This moving change can fix this by waiting all worker threads to exit and then stop the eth dev port.
In the meanwhile, remove wmb in signal_handler.
This is because when the main lcore receive the stop signal, it stores 1 into fdata->done. And then the worker lcores load "fdata->done" and jump out of the loop to stop running. Nothing should be stored after updating fdata->done, so the wmb is unnecessary.
Fixes: 085edac2ca38 ("examples/eventdev_pipeline: support Tx adapter") Cc: [email protected]
Suggested-by: Ruifeng Wang <[email protected]> Signed-off-by: Feifei Wang <[email protected]> Reviewed-by: Ruifeng Wang <[email protected]> Reviewed-by: Honnappa Nagarahalli <[email protected]> Acked-by: Harry van Haaren <[email protected]> Acked-by: Pavan Nikhilesh <[email protected]>
show more ...
|
| 198b5448 | 14-Jan-2021 |
Feifei Wang <[email protected]> |
examples/eventdev: add info output for main core
When the main core is set as tx/rx/sched/worker core, it also needs to print some information to show this. Thus, add info output for the main core,
examples/eventdev: add info output for main core
When the main core is set as tx/rx/sched/worker core, it also needs to print some information to show this. Thus, add info output for the main core, and add a "dump" function to print core information for the sake of code simplicity and easy maintenance.
In the meanwhile, fix the count error. For the variable "worker_idx", it should be incremented when the core is set as worker core. However, when the main core is set as rx/tx/sched core, the worker_idx is also incremented. Though this error may not have a substantial impact due to that the main core is the last launched core, but it should be corrected from the perspective of code correctness.
Fixes: 1094ca96689c ("doc: add SW eventdev pipeline to sample app guide") Cc: [email protected]
Signed-off-by: Feifei Wang <[email protected]> Reviewed-by: Ruifeng Wang <[email protected]>
show more ...
|