summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangmenglan <[email protected]>2023-06-06 19:28:56 +0800
committerwangmenglan <[email protected]>2023-06-06 19:28:56 +0800
commit396f8426f9ddf83c7d5f483fef20ab7a92bd7fac (patch)
tree0f0b4bb08fa6db6c40e23e101e9052a4a8890b43
parenta97a90ac7dac59b8db749d4c92a9c1d3979f6acc (diff)
Packet IO支持单向流发送日志v4.8.22-20230606
-rw-r--r--common/src/tfe_packet_io.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/common/src/tfe_packet_io.cpp b/common/src/tfe_packet_io.cpp
index d3c1eae..de6f739 100644
--- a/common/src/tfe_packet_io.cpp
+++ b/common/src/tfe_packet_io.cpp
@@ -1514,6 +1514,7 @@ static int handle_raw_packet_from_nf(struct packet_io *handle, marsio_buff_t *rx
struct packet_io *packet_io = thread->ref_io;
struct packet_io_fs *packet_io_fs = thread->ret_fs_state;
int is_ipv4 = 0;
+ uint8_t flag = 0;
char *header = NULL;
int header_len = 0;
void * logger = thread->logger;
@@ -1548,6 +1549,12 @@ static int handle_raw_packet_from_nf(struct packet_io *handle, marsio_buff_t *rx
throughput_metrics_inc(&s_ctx->c2s_info.rx, 1, raw_len);
else
throughput_metrics_inc(&s_ctx->s2c_info.rx, 1, raw_len);
+
+ flag = tfe_cmsg_get_flag(s_ctx->cmsg);
+ if (flag & TFE_CMSG_FLAG_USER0) {
+ send_event_log(s_ctx, thread_seq, ctx);
+ tfe_cmsg_set_flag(s_ctx->cmsg, TFE_CMSG_FLAG_INIT);
+ }
marsio_send_burst(handle->dev_nf_interface.mr_path, thread_seq, &rx_buff, 1);
return 0;
}
@@ -1640,7 +1647,7 @@ static int handle_raw_packet_from_nf(struct packet_io *handle, marsio_buff_t *rx
throughput_metrics_inc(&packet_io_fs->tap_pkt_tx, 1, raw_len);
}
- uint8_t flag = tfe_cmsg_get_flag(s_ctx->cmsg);
+ flag = tfe_cmsg_get_flag(s_ctx->cmsg);
if (flag & TFE_CMSG_FLAG_USER0) {
send_event_log(s_ctx, thread_seq, ctx);
tfe_cmsg_set_flag(s_ctx->cmsg, TFE_CMSG_FLAG_INIT);