]> git.droids-corp.org - dpdk.git/blobdiff - app/test-pmd/txonly.c
app/testpmd: add mempool with external data buffers
[dpdk.git] / app / test-pmd / txonly.c
index 539043c34745d1311c236ffc11044543c6fe0a17..871cf6c1547f51e4d443959715960393860007bd 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);