From: Chunsong Feng Date: Sat, 11 Jan 2020 04:54:40 +0000 (+0800) Subject: msg/async/dpdk: Fix infinite loop when sending packets X-Git-Tag: v15.1.0~197^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eea0b39fce532d96149e90c8c9b2e74ee064f25a;p=ceph.git 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 --- diff --git a/src/msg/async/dpdk/DPDK.cc b/src/msg/async/dpdk/DPDK.cc index c73b6c147eb61..48701000cdfb5 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);