From eea0b39fce532d96149e90c8c9b2e74ee064f25a Mon Sep 17 00:00:00 2001 From: Chunsong Feng Date: Sat, 11 Jan 2020 12:54:40 +0800 Subject: [PATCH] msg/async/dpdk: Fix infinite loop when sending packets tx_pkt_burst loops until the next pointer is null, set next pointer of the last segment nullptr to fix this issue. Signed-off-by: Chunsong Feng Signed-off-by: luo rixin --- src/msg/async/dpdk/DPDK.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msg/async/dpdk/DPDK.cc b/src/msg/async/dpdk/DPDK.cc index c73b6c147eb..48701000cdf 100644 --- a/src/msg/async/dpdk/DPDK.cc +++ b/src/msg/async/dpdk/DPDK.cc @@ -1095,6 +1095,9 @@ DPDKQueuePair::tx_buf* DPDKQueuePair::tx_buf::from_packet_zc( // Update the HEAD buffer with the packet info head->pkt_len = p.len(); head->nb_segs = total_nsegs; + // tx_pkt_burst loops until the next pointer is null, so last_seg->next must + // be null. + last_seg->next = nullptr; set_cluster_offload_info(p, qp, head); @@ -1206,6 +1209,9 @@ DPDKQueuePair::tx_buf* DPDKQueuePair::tx_buf::from_packet_copy(Packet&& p, DPDKQ // head->pkt_len = p.len(); head->nb_segs = nsegs; + // tx_pkt_burst loops until the next pointer is null, so last_seg->next must + // be null. + last_seg->next = nullptr; copy_packet_to_cluster(p, head); set_cluster_offload_info(p, qp, head); -- 2.39.5