TSG-14930 TFE支持发送控制报文给SAPP
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
#include <tfe_plugin.h>
|
||||
#include <tfe_cmsg.h>
|
||||
#include <tfe_resource.h>
|
||||
#include <tfe_packet_io.h>
|
||||
#include <tfe_packet_io_fs.h>
|
||||
|
||||
#include <platform.h>
|
||||
#include <proxy.h>
|
||||
@@ -53,8 +55,6 @@
|
||||
#include <key_keeper.h>
|
||||
#include <watchdog_3rd_device.h>
|
||||
|
||||
#include "tfe_metrics.h"
|
||||
|
||||
/* Breakpad */
|
||||
#include <MESA/breakpad_mini.h>
|
||||
|
||||
@@ -292,7 +292,8 @@ static void __gc_handler_cb(evutil_socket_t fd, short what, void * arg)
|
||||
FS_operate(ctx->fs_handle, ctx->fs_id[i], 0, FS_OP_SET, ATOMIC_READ(&(ctx->stat_val[i])));
|
||||
}
|
||||
|
||||
// global_metrics_dump(ctx->kni_v4_acceptor->acceptor->metrics);
|
||||
if (ctx->kni_v4_acceptor != NULL)
|
||||
packet_io_fs_dump(ctx->kni_v4_acceptor->packet_io_fs);
|
||||
|
||||
FS_passive_output(ctx->fs_handle);
|
||||
return;
|
||||
|
||||
@@ -1533,6 +1533,7 @@ void tfe_stream_destory(struct tfe_stream_private * stream)
|
||||
|
||||
if (stream->cmsg)
|
||||
{
|
||||
tfe_cmsg_set_flag(stream->cmsg, TFE_CMSG_FLAG_USER0);
|
||||
tfe_cmsg_destroy(stream->cmsg);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user