diff options
| author | tongzongzhen <[email protected]> | 2024-05-20 18:51:12 +0800 |
|---|---|---|
| committer | tongzongzhen <[email protected]> | 2024-05-20 18:51:12 +0800 |
| commit | 3245c8e795341123f1f1ac24705490259f9cc8ac (patch) | |
| tree | 028678545d12ac0661293264766a970964a72f5d /service/src | |
| parent | bd53868d73a6785ed85a725aae0a76d7b1f612e9 (diff) | |
fix dp_trace on arp error
Diffstat (limited to 'service/src')
| -rw-r--r-- | service/src/node_bridge.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/service/src/node_bridge.c b/service/src/node_bridge.c index cf018a3..1851d9d 100644 --- a/service/src/node_bridge.c +++ b/service/src/node_bridge.c @@ -351,28 +351,30 @@ static __rte_always_inline uint16_t bridge_node_process(struct rte_graph * graph } /* Clone pkt */ - struct rte_mbuf * mbuf_clone = rte_pktmbuf_clone(mbuf, bridge_main->direct_pool); - if (unlikely(mbuf_clone == NULL)) + // struct rte_mbuf * mbuf_clone = rte_pktmbuf_clone(mbuf, bridge_main->direct_pool); + struct rte_mbuf * mbuf_copy = rte_pktmbuf_copy(mbuf, bridge_main->direct_pool, 0, UINT32_MAX); + if (unlikely(mbuf_copy == NULL)) { stats.pkt_clone_failed++; continue; } /* Populate the egress port information */ - struct mrb_metadata * mrb_meta_clone = mrbuf_cz_data(mbuf_clone, MR_NODE_CTRLZONE_ID); - mrb_meta_clone->port_egress = egress_port; + struct mrb_metadata * mbuf_copy_mrb_meta = mrbuf_cz_data(mbuf_copy, MR_NODE_CTRLZONE_ID); + memset(mbuf_copy_mrb_meta, 0, sizeof(struct mrb_metadata)); + mbuf_copy_mrb_meta->port_egress = egress_port; /* Mark packets for trace*/ - dp_trace_filter_exec(sc_main_get()->trace, mbuf_clone, 0, rte_lcore_id()); + dp_trace_filter_exec(sc_main_get()->trace, mbuf_copy, 0, rte_lcore_id()); /* Check if tracing is enabled for the current Mbuf */ - if (unlikely(dp_trace_record_can_emit(mbuf, DP_TRACE_MEASUREMENT_TYPE_TRACE))) + if (unlikely(dp_trace_record_can_emit(mbuf_copy, DP_TRACE_MEASUREMENT_TYPE_TRACE))) { - gen_store_trace_info_clone(node, mbuf_clone, BRIDGE_NEXT_ETH_EGRESS); + gen_store_trace_info_clone(node, mbuf_copy, BRIDGE_NEXT_ETH_EGRESS); } /* Send clone pkt */ - rte_node_enqueue(graph, node, BRIDGE_NEXT_ETH_EGRESS, (void **)&mbuf_clone, 1); + rte_node_enqueue(graph, node, BRIDGE_NEXT_ETH_EGRESS, (void **)&mbuf_copy, 1); } node_enqueue: |
