[RFC,4/8] pdump: stamp packets with current timestamp
Checks
Commit Message
Put the current cycle count in as timestamp when
they are placed in the ring for packet capture.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/librte_pdump/rte_pdump.c | 2 ++
1 file changed, 2 insertions(+)
@@ -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;
}
}