TFE适配MRZCPD的分流算法的变更;并增加分流的调试日志
This commit is contained in:
@@ -1536,6 +1536,22 @@ static int handle_raw_packet_from_nf(struct packet_io *handle, marsio_buff_t *rx
|
||||
if (node == NULL) {
|
||||
throughput_metrics_inc(&packet_io_fs->raw_pkt_rx, 1, raw_len);
|
||||
throughput_metrics_inc(&packet_io_fs->raw_bypass, 1, raw_len);
|
||||
|
||||
if (thread->ref_acceptor_ctx->debug)
|
||||
{
|
||||
struct addr_tuple4 inner_addr;
|
||||
struct raw_pkt_parser raw_parser;
|
||||
memset(&inner_addr, 0, sizeof(struct addr_tuple4));
|
||||
raw_packet_parser_init(&raw_parser, 0, LAYER_TYPE_ALL, 8);
|
||||
raw_packet_parser_parse(&raw_parser, (const void *)raw_data, raw_len, logger);
|
||||
raw_packet_parser_get_most_inner_tuple4(&raw_parser, &inner_addr, logger);
|
||||
uint16_t ipid = raw_packet_parser_get_most_inner_ipid(&raw_parser);
|
||||
|
||||
char *str = addr_tuple4_to_str(&inner_addr);
|
||||
TFE_LOG_ERROR(logger, "packet from nf %lu: %s (ipid: %u) miss session table", meta.session_id, str, ipid);
|
||||
free(str);
|
||||
}
|
||||
|
||||
marsio_send_burst(handle->dev_nf_interface.mr_path, thread_seq, &rx_buff, 1);
|
||||
return -1;
|
||||
}
|
||||
@@ -1913,6 +1929,7 @@ int packet_io_polling_nf_interface(struct packet_io *handle, int thread_seq, voi
|
||||
{
|
||||
marsio_buff_t *rx_buff = rx_buffs[j];
|
||||
int raw_len = marsio_buff_datalen(rx_buff);
|
||||
char *raw_data = marsio_buff_mtod(rx_buff);
|
||||
|
||||
if (is_downstream_keepalive_packet(rx_buff))
|
||||
{
|
||||
@@ -1926,6 +1943,21 @@ int packet_io_polling_nf_interface(struct packet_io *handle, int thread_seq, voi
|
||||
continue;
|
||||
}
|
||||
|
||||
if (thread->ref_acceptor_ctx->debug)
|
||||
{
|
||||
struct addr_tuple4 inner_addr;
|
||||
struct raw_pkt_parser raw_parser;
|
||||
memset(&inner_addr, 0, sizeof(struct addr_tuple4));
|
||||
raw_packet_parser_init(&raw_parser, 0, LAYER_TYPE_ALL, 8);
|
||||
raw_packet_parser_parse(&raw_parser, (const void *)raw_data, raw_len, thread->logger);
|
||||
raw_packet_parser_get_most_inner_tuple4(&raw_parser, &inner_addr, thread->logger);
|
||||
uint16_t ipid = raw_packet_parser_get_most_inner_ipid(&raw_parser);
|
||||
|
||||
char *str = addr_tuple4_to_str(&inner_addr);
|
||||
TFE_LOG_DEBUG(thread->logger, "recv packet %s (ipid: %u)", str, ipid);
|
||||
free(str);
|
||||
}
|
||||
|
||||
if (marsio_buff_is_ctrlbuf(rx_buff))
|
||||
{
|
||||
throughput_metrics_inc(&packet_io_fs->raw_pkt_rx, 1, raw_len);
|
||||
@@ -2041,6 +2073,15 @@ void handle_raw_packet_from_tap(const char *data, int len, void *args)
|
||||
struct session_node *node = session_table_search_by_addr(thread->session_table, &inner_addr);
|
||||
if (node == NULL) {
|
||||
throughput_metrics_inc(&packet_io_fs->tap_pkt_rxdrop, 1, len);
|
||||
|
||||
if (thread->ref_acceptor_ctx->debug)
|
||||
{
|
||||
char *str = addr_tuple4_to_str(&inner_addr);
|
||||
uint16_t ipid = raw_packet_parser_get_most_inner_ipid(&raw_parser);
|
||||
TFE_LOG_ERROR(logger, "packet from tap %s (ipid: %u) miss session table", str, ipid);
|
||||
free(str);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user