net/octeontx2: support read clock
authorHarman Kalra <hkalra@marvell.com>
Sun, 28 Jul 2019 09:09:45 +0000 (09:09 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 29 Jul 2019 10:24:39 +0000 (12:24 +0200)
commit122135e73cd2feeffe0edf0ecedd7c629aec229f
treecc540853998259147391add5721ed123335167cc
parentbd992b2adc3d652c1e2c64145b3e48de8483063a
net/octeontx2: support read clock

This patch implements read clock api whose purpose is to return
raw clock ticks. Using this API real time ticks spent in
processing a packet can be known:
    <read_clock val at any time> - mbuf->timestamp

Calling mbox for reading raw clock ticks in fastpath is very
expensive so its value is derived from time stamp counter(tsc)
using freq multiplier (ratio of raw clock ticks and tsc) and clock
delta (by how much tsc is lagging from raw clock value).

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/octeontx2/otx2_mbox.h
drivers/net/octeontx2/otx2_ethdev.c
drivers/net/octeontx2/otx2_ethdev.h
drivers/net/octeontx2/otx2_ptp.c