Put the current cycle count in as timestamp when
they are placed in the ring for packet capture.

Signed-off-by: Stephen Hemminger <[email protected]>
---
 lib/librte_pdump/rte_pdump.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index 830decef91e2..41f2ec17a26b 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -75,6 +75,7 @@ pdump_copy(uint16_t port, struct rte_mbuf **pkts,
        unsigned i;
        int ring_enq;
        uint16_t d_pkts = 0;
+       uint64_t now = rte_get_tsc_cycles();
        struct rte_mbuf *dup_bufs[nb_pkts];
        struct pdump_rxtx_cbs *cbs;
        struct rte_ring *ring;
@@ -88,6 +89,7 @@ pdump_copy(uint16_t port, struct rte_mbuf **pkts,
                p = rte_pktmbuf_copy(pkts[i], mp, 0, UINT32_MAX);
                if (p) {
                        p->port = port;
+                       p->timestamp = now;
                        dup_bufs[d_pkts++] = p;
                }
        }
-- 
2.20.1

Reply via email to