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

Function igb_timesync_read_rx_timestamp

dpdk/drivers/net/e1000/igb_ethdev.c:4994–5014  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4992}
4993
4994static int
4995igb_timesync_read_rx_timestamp(struct rte_eth_dev *dev,
4996 struct timespec *timestamp,
4997 uint32_t flags __rte_unused)
4998{
4999 struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
5000 struct e1000_adapter *adapter = dev->data->dev_private;
5001 uint32_t tsync_rxctl;
5002 uint64_t rx_tstamp_cycles;
5003 uint64_t ns;
5004
5005 tsync_rxctl = E1000_READ_REG(hw, E1000_TSYNCRXCTL);
5006 if ((tsync_rxctl & E1000_TSYNCRXCTL_VALID) == 0)
5007 return -EINVAL;
5008
5009 rx_tstamp_cycles = igb_read_rx_tstamp_cyclecounter(dev);
5010 ns = rte_timecounter_update(&adapter->rx_tstamp_tc, rx_tstamp_cycles);
5011 *timestamp = rte_ns_to_timespec(ns);
5012
5013 return 0;
5014}
5015
5016static int
5017igb_timesync_read_tx_timestamp(struct rte_eth_dev *dev,

Callers

nothing calls this directly

Calls 3

rte_timecounter_updateFunction · 0.85
rte_ns_to_timespecFunction · 0.85

Tested by

no test coverage detected