diff options
| author | 刘畅 <[email protected]> | 2023-03-28 10:35:04 +0000 |
|---|---|---|
| committer | 刘畅 <[email protected]> | 2023-03-28 10:35:04 +0000 |
| commit | 54d7bdfd760309474ed2bd13f7940d96fc007451 (patch) | |
| tree | 955c23b1cd46b6837a2a6cb69b1a411e396b22ee /shaping/src/main.cpp | |
| parent | daac158a2890ab58a826ae973a2e775625d6af07 (diff) | |
| parent | d6e6708cbeefcb90e09bb5fa76133d8f56a7f6ad (diff) | |
Merge branch 'shaping_fieldstat3' into 'rel'v1.1.0
Shaping fieldstat3
See merge request liuchang/shaping-engine!1
Diffstat (limited to 'shaping/src/main.cpp')
| -rw-r--r-- | shaping/src/main.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/shaping/src/main.cpp b/shaping/src/main.cpp index 16f0aa8..476816f 100644 --- a/shaping/src/main.cpp +++ b/shaping/src/main.cpp @@ -8,29 +8,10 @@ #include "shaper_marsio.h" #include "shaper_session.h" -static int thread_set_affinity(int core_id) -{ - int num_cores = sysconf(_SC_NPROCESSORS_ONLN); - if (core_id < 0 || core_id >= num_cores) - { - return EINVAL; - } - - cpu_set_t cpuset; - CPU_ZERO(&cpuset); - CPU_SET(core_id, &cpuset); - - return pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); -} - static void *shaper_thread_loop(void *data) { struct shaping_thread_ctx *ctx = (struct shaping_thread_ctx *)data; - if (ctx->cpu_mask >= 0) - { - thread_set_affinity(ctx->cpu_mask); - } marsio_thread_init(ctx->marsio_info->instance); //loop to process pkts |
