app/testpmd: reset headroom after txonly packet allocation
[dpdk.git] / app / test-pmd / txonly.c
index d2736b7..8513a06 100644 (file)
@@ -222,6 +222,14 @@ pkt_burst_transmit(struct fwd_stream *fs)
                                return;
                        break;
                }
+
+               /*
+                * Using raw alloc is good to improve performance,
+                * but some consumers may use the headroom and so
+                * decrement data_off. We need to make sure it is
+                * reset to default value.
+                */
+               rte_pktmbuf_reset_headroom(pkt);
                pkt->data_len = tx_pkt_seg_lengths[0];
                pkt_seg = pkt;
                if (tx_pkt_split == TX_PKT_SPLIT_RND)