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

Function ixgbe_timesync_read_rx_timestamp

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

Source from the content-addressed store, hash-verified

7145}
7146
7147static int
7148ixgbe_timesync_read_rx_timestamp(struct rte_eth_dev *dev,
7149 struct timespec *timestamp,
7150 uint32_t flags __rte_unused)
7151{
7152 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
7153 struct ixgbe_adapter *adapter = dev->data->dev_private;
7154 uint32_t tsync_rxctl;
7155 uint64_t rx_tstamp_cycles;
7156 uint64_t ns;
7157
7158 tsync_rxctl = IXGBE_READ_REG(hw, IXGBE_TSYNCRXCTL);
7159 if ((tsync_rxctl & IXGBE_TSYNCRXCTL_VALID) == 0)
7160 return -EINVAL;
7161
7162 rx_tstamp_cycles = ixgbe_read_rx_tstamp_cyclecounter(dev);
7163 ns = rte_timecounter_update(&adapter->rx_tstamp_tc, rx_tstamp_cycles);
7164 *timestamp = rte_ns_to_timespec(ns);
7165
7166 return 0;
7167}
7168
7169static int
7170ixgbe_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