MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ngbe_timesync_read_rx_timestamp

Function ngbe_timesync_read_rx_timestamp

dpdk/drivers/net/ngbe/ngbe_ethdev.c:3037–3057  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3035}
3036
3037static int
3038ngbe_timesync_read_rx_timestamp(struct rte_eth_dev *dev,
3039 struct timespec *timestamp,
3040 uint32_t flags __rte_unused)
3041{
3042 struct ngbe_hw *hw = ngbe_dev_hw(dev);
3043 struct ngbe_adapter *adapter = ngbe_dev_adapter(dev);
3044 uint32_t tsync_rxctl;
3045 uint64_t rx_tstamp_cycles;
3046 uint64_t ns;
3047
3048 tsync_rxctl = rd32(hw, NGBE_TSRXCTL);
3049 if ((tsync_rxctl & NGBE_TSRXCTL_VLD) == 0)
3050 return -EINVAL;
3051
3052 rx_tstamp_cycles = ngbe_read_rx_tstamp_cyclecounter(dev);
3053 ns = rte_timecounter_update(&adapter->rx_tstamp_tc, rx_tstamp_cycles);
3054 *timestamp = rte_ns_to_timespec(ns);
3055
3056 return 0;
3057}
3058
3059static int
3060ngbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,

Callers

nothing calls this directly

Calls 6

ngbe_dev_hwFunction · 0.85
ngbe_dev_adapterFunction · 0.85
rte_timecounter_updateFunction · 0.85
rte_ns_to_timespecFunction · 0.85
rd32Function · 0.50

Tested by

no test coverage detected