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

Function ixgbe_timesync_read_tx_timestamp

dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:7169–7188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7167}
7168
7169static int
7170ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
7171 struct timespec *timestamp)
7172{
7173 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
7174 struct ixgbe_adapter *adapter = dev->data->dev_private;
7175 uint32_t tsync_txctl;
7176 uint64_t tx_tstamp_cycles;
7177 uint64_t ns;
7178
7179 tsync_txctl = IXGBE_READ_REG(hw, IXGBE_TSYNCTXCTL);
7180 if ((tsync_txctl & IXGBE_TSYNCTXCTL_VALID) == 0)
7181 return -EINVAL;
7182
7183 tx_tstamp_cycles = ixgbe_read_tx_tstamp_cyclecounter(dev);
7184 ns = rte_timecounter_update(&adapter->tx_tstamp_tc, tx_tstamp_cycles);
7185 *timestamp = rte_ns_to_timespec(ns);
7186
7187 return 0;
7188}
7189
7190static int
7191ixgbe_get_reg_length(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