From e716f21b8ee5c99b84a9029f40964d8de1a9c6fb Mon Sep 17 00:00:00 2001 From: wangmenglan Date: Thu, 8 Jun 2023 17:15:46 +0800 Subject: [PATCH] =?UTF-8?q?TFE=20=E5=9C=A8=E5=A4=9A=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8Bbpf=5Fhash=5Fmode=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=B8=8D=E7=AC=A6=E5=90=88=E9=A2=84=E6=9C=9F=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/tfe_packet_io.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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; } }