| 7145 | } |
| 7146 | |
| 7147 | static int |
| 7148 | ixgbe_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 | |
| 7169 | static int |
| 7170 | ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev, |
nothing calls this directly
no test coverage detected