app/testpmd: add mempool with external data buffers
[dpdk.git] / app / test-pmd / txonly.c
index 539043c..871cf6c 100644 (file)
@@ -159,7 +159,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,
        uint8_t i;
 
        if (unlikely(tx_pkt_split == TX_PKT_SPLIT_RND))
-               nb_segs = random() % tx_pkt_nb_segs + 1;
+               nb_segs = rte_rand() % tx_pkt_nb_segs + 1;
        else
                nb_segs = tx_pkt_nb_segs;
 
@@ -170,7 +170,8 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,
 
        rte_pktmbuf_reset_headroom(pkt);
        pkt->data_len = tx_pkt_seg_lengths[0];
-       pkt->ol_flags = ol_flags;
+       pkt->ol_flags &= EXT_ATTACHED_MBUF;
+       pkt->ol_flags |= ol_flags;
        pkt->vlan_tci = vlan_tci;
        pkt->vlan_tci_outer = vlan_tci_outer;
        pkt->l2_len = sizeof(struct rte_ether_hdr);