TSG-18285 TFE的Packet IO模块支持重复流量识别

This commit is contained in:
luwenpeng
2023-12-29 17:25:18 +08:00
parent 9d3dcce1ab
commit cbd98507a2
30 changed files with 4064 additions and 1572 deletions

View File

@@ -20,7 +20,8 @@
#include "tfe_packet_io.h"
#include "tfe_session_table.h"
#include "tfe_fieldstat.h"
#include "dablooms.h"
#include "timestamp.h"
void * g_packet_io_logger = NULL;
@@ -82,6 +83,12 @@ struct acceptor_kni_v4 *acceptor_ctx_create(const char *profile, void *logger)
{
struct acceptor_kni_v4 *ctx = ALLOC(struct acceptor_kni_v4, 1);
MESA_load_profile_int_def(profile, "PACKET_IO", "dup_packet_filter_enable", (int *)&(ctx->dup_packet_filter_enable), 1);
MESA_load_profile_int_def(profile, "PACKET_IO", "dup_packet_filter_capacity", (int *)&(ctx->dup_packet_filter_capacity), 1000000);
MESA_load_profile_int_def(profile, "PACKET_IO", "dup_packet_filter_timeout", (int *)&(ctx->dup_packet_filter_timeout), 10);
// MESA_load_profile not support double
ctx->dup_packet_filter_error_rate = 0.00001;
MESA_load_profile_int_def(profile, "PACKET_IO", "firewall_sids", (int *)&(ctx->firewall_sids), 1000);
MESA_load_profile_int_def(profile, "PACKET_IO", "proxy_sids", (int *)&(ctx->proxy_sids), 1001);
MESA_load_profile_int_def(profile, "PACKET_IO", "service_chaining_sids", (int *)&(ctx->sce_sids), 1002);
@@ -240,6 +247,10 @@ struct acceptor_kni_v4 *acceptor_kni_v4_create(struct tfe_proxy *proxy, const ch
acceptor_ctx->work_threads[i].ret_fs_state = acceptor_ctx->packet_io_fs;
acceptor_ctx->work_threads[i].logger = packet_io_logger;
acceptor_ctx->work_threads[i].session_table_need_reset = 0;
if (acceptor_ctx->dup_packet_filter_enable)
{
acceptor_ctx->work_threads[i].dup_packet_filter = expiry_dablooms_init(acceptor_ctx->dup_packet_filter_capacity, acceptor_ctx->dup_packet_filter_error_rate, timestamp_get_sec(), acceptor_ctx->dup_packet_filter_timeout);
}
}
for (int i = 0; i < acceptor_ctx->nr_worker_threads; i++) {