diff options
| author | wangmenglan <[email protected]> | 2023-05-15 16:41:59 +0800 |
|---|---|---|
| committer | wangmenglan <[email protected]> | 2023-05-15 16:41:59 +0800 |
| commit | b931a3dc58dead4e02cda48813bdffd2e2d072c0 (patch) | |
| tree | dc6a7bf00c7bfdaa166e060d640da1aa780798ed /common/include | |
| parent | 935aa7235e05b508ca7c989c2b54abad45bc2c1f (diff) | |
packet io增加fieldstat状态统计v4.8.12-20230515
Diffstat (limited to 'common/include')
| -rw-r--r-- | common/include/tfe_ctrl_packet.h | 4 | ||||
| -rw-r--r-- | common/include/tfe_mpack.h | 17 | ||||
| -rw-r--r-- | common/include/tfe_packet_io.h | 12 | ||||
| -rw-r--r-- | common/include/tfe_packet_io_fs.h | 37 | ||||
| -rw-r--r-- | common/include/tfe_raw_packet.h | 12 |
5 files changed, 34 insertions, 48 deletions
diff --git a/common/include/tfe_ctrl_packet.h b/common/include/tfe_ctrl_packet.h index fbdd277..162b142 100644 --- a/common/include/tfe_ctrl_packet.h +++ b/common/include/tfe_ctrl_packet.h @@ -39,8 +39,8 @@ void ctrl_packet_parser_init(struct ctrl_pkt_parser *handler); // return 0 : success // return -1 : error -int ctrl_packet_parser_parse(struct ctrl_pkt_parser *handler, const char *data, size_t length); -void ctrl_packet_parser_dump(struct ctrl_pkt_parser *handler); +int ctrl_packet_parser_parse(void *ctx, const char* data, size_t length, void *logger); +void ctrl_packet_parser_dump(struct ctrl_pkt_parser *handler, void *logger); #ifdef __cpluscplus } diff --git a/common/include/tfe_mpack.h b/common/include/tfe_mpack.h deleted file mode 100644 index 299cbbf..0000000 --- a/common/include/tfe_mpack.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _TFE_MPACK_H -#define _TFE_MPACK_H - -#ifdef __cpluscplus -extern "C" -{ -#endif - -#include "tfe_cmsg.h" - -int parse_messagepack(const char* data, size_t length, void *ctx); - -#ifdef __cpluscplus -} -#endif - -#endif
\ No newline at end of file diff --git a/common/include/tfe_packet_io.h b/common/include/tfe_packet_io.h index eaf1d74..23c3bde 100644 --- a/common/include/tfe_packet_io.h +++ b/common/include/tfe_packet_io.h @@ -33,14 +33,13 @@ struct packet_io_thread_ctx struct tap_ctx *tap_ctx; struct session_table *session_table; - struct sf_metrics *sf_metrics; struct packet_io *ref_io; - struct packet_io_fs *ret_fs_state; - struct policy_enforcer *ref_enforcer; struct tfe_proxy *ref_proxy; + struct packet_io_fs *ret_fs_state; struct acceptor_kni_v4 *ref_acceptor_ctx; + void *logger; int session_table_need_reset; }; @@ -80,10 +79,9 @@ struct acceptor_kni_v4 int proxy_sids; int sce_sids; int nr_worker_threads; - int cpu_affinity_mask[TFE_THREAD_MAX]; - cpu_set_t coremask; + struct packet_io *io; struct packet_io_fs *packet_io_fs; struct packet_io_thread_ctx work_threads[TFE_THREAD_MAX]; @@ -96,10 +94,10 @@ int is_enable_iouring(struct packet_io *handle); void tfe_tap_ctx_destory(struct tap_ctx *handler); struct tap_ctx *tfe_tap_ctx_create(void *ctx); -int packet_io_thread_init(struct packet_io *handle, struct packet_io_thread_ctx *thread_ctx); +int packet_io_thread_init(struct packet_io *handle, struct packet_io_thread_ctx *thread_ctx, void *logger); void packet_io_thread_wait(struct packet_io *handle, struct packet_io_thread_ctx *thread_ctx, int timeout_ms); void packet_io_destory(struct packet_io *handle); -struct packet_io *packet_io_create(const char *profile, int thread_num, cpu_set_t *coremask); +struct packet_io *packet_io_create(const char *profile, int thread_num, cpu_set_t *coremask, void *logger); int packet_io_polling_nf_interface(struct packet_io *handle, int thread_seq, void *ctx); void handle_decryption_packet_from_tap(const char *data, int len, void *args); diff --git a/common/include/tfe_packet_io_fs.h b/common/include/tfe_packet_io_fs.h index e935f07..d05c992 100644 --- a/common/include/tfe_packet_io_fs.h +++ b/common/include/tfe_packet_io_fs.h @@ -18,23 +18,28 @@ struct throughput_metrics struct packet_io_fs { - struct throughput_metrics raw_pkt_rx; // 累计值 - struct throughput_metrics raw_pkt_tx; // 累计值 + struct throughput_metrics raw_pkt_rx; // 累计值 + struct throughput_metrics raw_pkt_tx; // 累计值 - struct throughput_metrics hit_policy; // 累计值 + struct throughput_metrics decrypt_tx; // 累计值 + struct throughput_metrics decrypt_rx; // 累计值 - struct throughput_metrics decrypt_tx; // 累计值 - struct throughput_metrics decrypt_rx; // 累计值 + struct throughput_metrics raw_bypass; // 累计值 + struct throughput_metrics decrypt_rxdrop; // 累计值 - struct throughput_metrics ctrl_pkt_rx; // 累计值 - struct throughput_metrics ctrl_pkt_tx; // 累计值 + struct throughput_metrics ctrl_pkt_rx; // 累计值 + struct throughput_metrics ctrl_pkt_tx; // 累计值 - struct throughput_metrics tap_pkt_rx; // 累计值 - struct throughput_metrics tap_pkt_tx; // 累计值 - struct throughput_metrics tap_c_pkt_rx; // 累计值 - struct throughput_metrics tap_c_pkt_tx; // 累计值 - struct throughput_metrics tap_s_pkt_rx; // 累计值 - struct throughput_metrics tap_s_pkt_tx; // 累计值 + struct throughput_metrics keepalived_pkt_rx; // 累计值 + struct throughput_metrics keepalived_pkt_tx; // 累计值 + + struct throughput_metrics tap_pkt_rx; // 累计值 + struct throughput_metrics tap_pkt_tx; // 累计值 + struct throughput_metrics tap_pkt_rxdrop; // 累计值 + struct throughput_metrics tap_c_pkt_rx; // 累计值 + struct throughput_metrics tap_c_pkt_tx; // 累计值 + struct throughput_metrics tap_s_pkt_rx; // 累计值 + struct throughput_metrics tap_s_pkt_tx; // 累计值 uint64_t ctrl_pkt_opening_num; // 累计值 uint64_t ctrl_pkt_active_num; // 累计值 @@ -42,14 +47,14 @@ struct packet_io_fs uint64_t ctrl_pkt_resetall_num; // 累计值 uint64_t ctrl_pkt_error_num; // 累计值 - uint64_t session_nums; // 瞬时值 - uint64_t send_log; // 瞬时值 + uint64_t session_num; // 瞬时值 + uint64_t session_log; // 瞬时值 screen_stat_handle_t fs_handle; int fs_id[128]; }; -struct packet_io_fs *packet_io_fs_create(); +struct packet_io_fs *packet_io_fs_create(const char *profile); void packet_io_fs_destory(struct packet_io_fs *handle); void packet_io_fs_dump(struct packet_io_fs *handle); diff --git a/common/include/tfe_raw_packet.h b/common/include/tfe_raw_packet.h index a360b71..91f75ff 100644 --- a/common/include/tfe_raw_packet.h +++ b/common/include/tfe_raw_packet.h @@ -78,19 +78,19 @@ struct raw_pkt_parser void raw_packet_parser_init(struct raw_pkt_parser *handler, uint64_t pkt_trace_id, enum layer_type expect_type, uint16_t expect_results_num); // return most inner payload -const void *raw_packet_parser_parse(struct raw_pkt_parser *handler, const void *data, size_t length); +const void *raw_packet_parser_parse(struct raw_pkt_parser *handler, const void *data, size_t length, void *logger); // return 0 : success // return -1 : error -int raw_packet_parser_get_most_inner_tuple4(struct raw_pkt_parser *handler, struct addr_tuple4 *addr); -int raw_packet_parser_get_most_outer_tuple4(struct raw_pkt_parser *handler, struct addr_tuple4 *addr); +int raw_packet_parser_get_most_inner_tuple4(struct raw_pkt_parser *handler, struct addr_tuple4 *addr, void *logger); +int raw_packet_parser_get_most_outer_tuple4(struct raw_pkt_parser *handler, struct addr_tuple4 *addr, void *logger); // return 0 : success // return -1 : error -int raw_packet_parser_get_most_inner_address(struct raw_pkt_parser *handler, struct addr_tuple4 *addr); -int raw_packet_parser_get_most_outer_address(struct raw_pkt_parser *handler, struct addr_tuple4 *addr); +int raw_packet_parser_get_most_inner_address(struct raw_pkt_parser *handler, struct addr_tuple4 *addr, void *logger); +int raw_packet_parser_get_most_outer_address(struct raw_pkt_parser *handler, struct addr_tuple4 *addr, void *logger); -uint64_t raw_packet_parser_get_hash_value(struct raw_pkt_parser *handler, enum ldbc_method method, int dir_is_internal); +uint64_t raw_packet_parser_get_hash_value(struct raw_pkt_parser *handler, enum ldbc_method method, int dir_is_internal, void *logger); #ifdef __cpluscplus } |
