]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/dpdk: Fix infinite loop when sending packets 32691/head
authorChunsong Feng <fengchunsong@huawei.com>
Sat, 11 Jan 2020 04:54:40 +0000 (12:54 +0800)
committerluo rixin <luorixin@huawei.com>
Fri, 17 Jan 2020 03:55:51 +0000 (11:55 +0800)
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 <fengchunsong@huawei.com>
Signed-off-by: luo rixin <luorixin@huawei.com>
src/msg/async/dpdk/DPDK.cc

index c73b6c147eb614a27e16c78898416a7474543e9f..48701000cdfb52fa2f07498a27cbd32fb8262847 100644 (file)
@@ -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);