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

Function ngbe_timesync_read_tx_timestamp

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

Source from the content-addressed store, hash-verified

3057}
3058
3059static int
3060ngbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
3061 struct timespec *timestamp)
3062{
3063 struct ngbe_hw *hw = ngbe_dev_hw(dev);
3064 struct ngbe_adapter *adapter = ngbe_dev_adapter(dev);
3065 uint32_t tsync_txctl;
3066 uint64_t tx_tstamp_cycles;
3067 uint64_t ns;
3068
3069 tsync_txctl = rd32(hw, NGBE_TSTXCTL);
3070 if ((tsync_txctl & NGBE_TSTXCTL_VLD) == 0)
3071 return -EINVAL;
3072
3073 tx_tstamp_cycles = ngbe_read_tx_tstamp_cyclecounter(dev);
3074 ns = rte_timecounter_update(&adapter->tx_tstamp_tc, tx_tstamp_cycles);
3075 *timestamp = rte_ns_to_timespec(ns);
3076
3077 return 0;
3078}
3079
3080static int
3081ngbe_get_reg_length(struct rte_eth_dev *dev __rte_unused)

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