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

Function igb_timesync_read_tx_timestamp

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

Source from the content-addressed store, hash-verified

5014}
5015
5016static int
5017igb_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
5018 struct timespec *timestamp)
5019{
5020 struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
5021 struct e1000_adapter *adapter = dev->data->dev_private;
5022 uint32_t tsync_txctl;
5023 uint64_t tx_tstamp_cycles;
5024 uint64_t ns;
5025
5026 tsync_txctl = E1000_READ_REG(hw, E1000_TSYNCTXCTL);
5027 if ((tsync_txctl & E1000_TSYNCTXCTL_VALID) == 0)
5028 return -EINVAL;
5029
5030 tx_tstamp_cycles = igb_read_tx_tstamp_cyclecounter(dev);
5031 ns = rte_timecounter_update(&adapter->tx_tstamp_tc, tx_tstamp_cycles);
5032 *timestamp = rte_ns_to_timespec(ns);
5033
5034 return 0;
5035}
5036
5037static int
5038eth_igb_get_reg_length(struct rte_eth_dev *dev __rte_unused)

Callers

nothing calls this directly

Calls 3

rte_timecounter_updateFunction · 0.85
rte_ns_to_timespecFunction · 0.85

Tested by

no test coverage detected