summaryrefslogtreecommitdiff
path: root/common/src/tfe_packet_io.cpp
diff options
context:
space:
mode:
authorwangmenglan <[email protected]>2023-06-08 17:15:46 +0800
committerwangmenglan <[email protected]>2023-06-08 17:17:10 +0800
commite716f21b8ee5c99b84a9029f40964d8de1a9c6fb (patch)
tree3cac2c0ca02c69312f9e283b6537bf2added1189 /common/src/tfe_packet_io.cpp
parentdb5530aa568d66eec2caf18eed067e1ccceb197d (diff)
TFE 在多线程模式下bpf_hash_mode配置不符合预期时,启动失败v4.8.23-20230608
Diffstat (limited to 'common/src/tfe_packet_io.cpp')
-rw-r--r--common/src/tfe_packet_io.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/src/tfe_packet_io.cpp b/common/src/tfe_packet_io.cpp
index de6f739..a522a57 100644
--- a/common/src/tfe_packet_io.cpp
+++ b/common/src/tfe_packet_io.cpp
@@ -1815,9 +1815,16 @@ struct packet_io *packet_io_create(const char *profile, int thread_num, cpu_set_
if (handle->config.tap_allow_mutilthread)
{
+ if (handle->config.bpf_hash_mode != 2 || handle->config.bpf_hash_mode != 4)
+ {
+ TFE_LOG_ERROR(logger, "%s: under mutilthread mode, bpf_hash_mode[%d] invalid.", LOG_TAG_PKTIO, handle->config.bpf_hash_mode);
+ goto error_out;
+ }
+
handle->config.tap_bpf_ctx = bpf_obj_load(handle->config.bpf_obj, thread_num, handle->config.bpf_hash_mode, handle->config.bpf_debug_log);
if (handle->config.tap_bpf_ctx == NULL)
{
+ TFE_LOG_ERROR(logger, "%s: under mutilthread mode, Unable to load bpf object.", LOG_TAG_PKTIO);
goto error_out;
}
}