diff options
Diffstat (limited to 'platform/src/proxy.cpp')
| -rw-r--r-- | platform/src/proxy.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index 2ba022f..910854b 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -75,7 +75,9 @@ struct tfe_thread_ctx * tfe_proxy_thread_ctx_acquire(struct tfe_proxy * ctx) { unsigned int min_thread_id = 0; unsigned int min_load = 0; - + static unsigned int counter=0; + counter++; + /* for (unsigned int tid = 0; tid < ctx->nr_work_threads; tid++) { struct tfe_thread_ctx * thread_ctx = ctx->work_threads[tid]; @@ -84,7 +86,8 @@ struct tfe_thread_ctx * tfe_proxy_thread_ctx_acquire(struct tfe_proxy * ctx) min_thread_id = min_load > thread_load ? tid : min_thread_id; min_load = min_load > thread_load ? thread_load : min_load; } - +*/ + min_thread_id=counter%ctx->nr_work_threads; ATOMIC_INC(&ctx->work_threads[min_thread_id]->load); return ctx->work_threads[min_thread_id]; } @@ -276,19 +279,19 @@ int tfe_proxy_config(struct tfe_proxy * proxy, const char * profile) static const char * __str_stat_spec_map[] = { [STAT_SIGPIPE] = "SIGPIPE", - [STAT_FD_OPEN_BY_KNI_ACCEPT] = "FdRcv", - [STAT_FD_CLOSE_BY_KNI_ACCEPT_FAIL] = "FdRcvFail", - [STAT_FD_INSTANT_CLOSE] = "FdClsInstant", - [STAT_FD_DEFER_CLOSE_IN_QUEUE] = "FdClsDefInQ", - [STAT_FD_DEFER_CLOSE_SUCCESS] = "FdClsDefSuc", - [STAT_STREAM_OPEN] = "StrOpen", - [STAT_STREAM_CLS] = "StrCls", - [STAT_STREAM_CLS_DOWN_EOF] = "StrDownEOF", - [STAT_STREAM_CLS_UP_EOF] = "StrUpEOF", - [STAT_STREAM_CLS_DOWN_ERR] = "StrDownErr", - [STAT_STREAM_CLS_UP_ERR] = "StrUpErr", - [STAT_STREAM_CLS_KILL] = "StrKill", - [STAT_STREAM_TCP_PLAIN] = "Plain", + [STAT_FD_OPEN_BY_KNI_ACCEPT] = "fd_rx", + [STAT_FD_CLOSE_BY_KNI_ACCEPT_FAIL] = "fd_rx_err", + [STAT_FD_INSTANT_CLOSE] = "fd_inst_cls", + [STAT_FD_DEFER_CLOSE_IN_QUEUE] = "fd_dfr_cls", + [STAT_FD_DEFER_CLOSE_SUCCESS] = "fd_dfr_clsd", + [STAT_STREAM_OPEN] = "stm_open", + [STAT_STREAM_CLS] = "stm_cls", + [STAT_STREAM_CLS_DOWN_EOF] = "dstm_eof", + [STAT_STREAM_CLS_UP_EOF] = "ustm_eof", + [STAT_STREAM_CLS_DOWN_ERR] = "dstm_err", + [STAT_STREAM_CLS_UP_ERR] = "ustm_err", + [STAT_STREAM_CLS_KILL] = "stm_kill", + [STAT_STREAM_TCP_PLAIN] = "plain", [STAT_STREAM_TCP_SSL] = "SSL", [TFE_STAT_MAX] = NULL }; |
