TSG-14930 TFE支持发送控制报文给SAPP

This commit is contained in:
wangmenglan
2023-05-09 22:12:38 +08:00
parent fecc023418
commit 542f4cbdfa
12 changed files with 296 additions and 334 deletions

View File

@@ -13,7 +13,7 @@
#include <tfe_cmsg.h>
#include <proxy.h>
#include "io_uring.h"
#include "tfe_metrics.h"
#include "tfe_packet_io_fs.h"
#include "tfe_tcp_restore.h"
#include "acceptor_kni_v4.h"
#include "tap.h"
@@ -40,7 +40,7 @@ void acceptor_ctx_destory(struct acceptor_kni_v4 * ctx)
if (ctx)
{
packet_io_destory(ctx->io);
global_metrics_destory(ctx->metrics);
packet_io_fs_destory(ctx->packet_io_fs);
free(ctx);
ctx = NULL;
@@ -72,8 +72,8 @@ struct acceptor_kni_v4 *acceptor_ctx_create(const char *profile)
goto error_out;
}
ctx->metrics = global_metrics_create();
if (ctx->metrics == NULL)
ctx->packet_io_fs = packet_io_fs_create();
if (ctx->packet_io_fs == NULL)
{
goto error_out;
}
@@ -87,7 +87,7 @@ error_out:
static void *worker_thread_cycle(void *arg)
{
struct acceptor_thread_ctx *thread_ctx = (struct acceptor_thread_ctx *)arg;
struct packet_io_thread_ctx *thread_ctx = (struct packet_io_thread_ctx *)arg;
struct packet_io *handle = thread_ctx->ref_io;
int pkg_len = 0;
@@ -190,13 +190,13 @@ struct acceptor_kni_v4 *acceptor_kni_v4_create(struct tfe_proxy *proxy, const ch
acceptor_ctx->work_threads[i].session_table = session_table_create();
acceptor_ctx->work_threads[i].ref_io = acceptor_ctx->io;
acceptor_ctx->work_threads[i].ref_proxy = proxy;
acceptor_ctx->work_threads[i].ref_metrics = acceptor_ctx->metrics;
acceptor_ctx->work_threads[i].ret_fs_state = acceptor_ctx->packet_io_fs;
acceptor_ctx->work_threads[i].ref_acceptor_ctx = acceptor_ctx;
acceptor_ctx->work_threads[i].session_table_need_reset = 0;
}
for (int i = 0; i < acceptor_ctx->nr_worker_threads; i++) {
struct acceptor_thread_ctx *thread_ctx = &acceptor_ctx->work_threads[i];
struct packet_io_thread_ctx *thread_ctx = &acceptor_ctx->work_threads[i];
if (pthread_create(&thread_ctx->tid, NULL, worker_thread_cycle, (void *)thread_ctx) < 0)
{
goto error_out;