diff options
| author | 童宗振 <[email protected]> | 2024-05-17 01:50:30 +0000 |
|---|---|---|
| committer | 童宗振 <[email protected]> | 2024-05-17 01:50:30 +0000 |
| commit | bd53868d73a6785ed85a725aae0a76d7b1f612e9 (patch) | |
| tree | 05ad61ad2ca5705666fbf72587954a04cddf1082 | |
| parent | 64ad4ff87c581a0b91d56fb4a69d52996c7a0e72 (diff) | |
Fix send pkt measurement lossv4.8.10-20240517
| -rw-r--r-- | app/src/rawio.c | 18 | ||||
| -rw-r--r-- | infra/src/dp_trace.c | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/app/src/rawio.c b/app/src/rawio.c index 27d6237..451eb98 100644 --- a/app/src/rawio.c +++ b/app/src/rawio.c @@ -242,6 +242,7 @@ int marsio_send_burst_with_options(struct mr_sendpath * sendpath, queue_id_t sid } /* 线程运行情况统计 */ + // thread_info.instance maybe null.Because the marsio_thread_init function may not have been executed yet if (thread_info.instance != NULL) { thread_id_t tid = thread_info.thread_id; @@ -249,6 +250,23 @@ int marsio_send_burst_with_options(struct mr_sendpath * sendpath, queue_id_t sid thread_info.instance->stat[tid].packet_send_length = packet_total_len(_mbufs, nr_mbufs); } + for (int i = 0; i < nr_mbufs; i++) + { + if (marsio_dp_trace_measurements_can_emit(sendpath->instance, mbufs[i], DP_TRACE_MEASUREMENT_TYPE_TELEMETRY)) + { + marsio_dp_trace_measurement_emit_fmt(sendpath->instance, mbufs[i], DP_TRACE_MEASUREMENT_TYPE_TELEMETRY, + "app_send", "packet tx, dev=%s, qid=%u, hash=%u", + sendpath->vdev->devsym, sid, hash[i]); + } + + if (marsio_dp_trace_measurements_can_emit(sendpath->instance, mbufs[i], DP_TRACE_MEASUREMENT_TYPE_TRACE)) + { + marsio_dp_trace_measurement_emit_fmt(sendpath->instance, mbufs[i], DP_TRACE_MEASUREMENT_TYPE_TRACE, + "app_send", "packet tx, dev=%s, qid=%u, hash=%u", + sendpath->vdev->devsym, sid, hash[i]); + } + } + vnode_mirror_enqueue_bulk(sendpath->target_vdi->vnode_tx_prod, sid, _mbufs, hash, nr_mbufs); int ret = vnode_mirror_rt_object_retrieve(sendpath->target_vdi->vnode_tx_prod, sid, _mbufs, nr_mbufs); if (ret > 0) diff --git a/infra/src/dp_trace.c b/infra/src/dp_trace.c index 2ca343a..ef6a0c7 100644 --- a/infra/src/dp_trace.c +++ b/infra/src/dp_trace.c @@ -608,7 +608,7 @@ static inline void dp_trace_buffer_initialize(struct dp_trace_process * trace, s inet_ntop(AF_INET, &ipv4_hdr->dst_addr, dp_trace_buffer->inner_dst_addr_str, sizeof(dp_trace_buffer->inner_dst_addr_str)); } - else if (this_layer_type_mask & LAYER_TYPE_IPV6) + else if (this_layer_type_mask == LAYER_TYPE_IPV6) { struct rte_ipv6_hdr ipv6_hdr_copy; const struct rte_ipv6_hdr * ipv6_hdr = |
