| 3035 | } |
| 3036 | |
| 3037 | static int |
| 3038 | ngbe_timesync_read_rx_timestamp(struct rte_eth_dev *dev, |
| 3039 | struct timespec *timestamp, |
| 3040 | uint32_t flags __rte_unused) |
| 3041 | { |
| 3042 | struct ngbe_hw *hw = ngbe_dev_hw(dev); |
| 3043 | struct ngbe_adapter *adapter = ngbe_dev_adapter(dev); |
| 3044 | uint32_t tsync_rxctl; |
| 3045 | uint64_t rx_tstamp_cycles; |
| 3046 | uint64_t ns; |
| 3047 | |
| 3048 | tsync_rxctl = rd32(hw, NGBE_TSRXCTL); |
| 3049 | if ((tsync_rxctl & NGBE_TSRXCTL_VLD) == 0) |
| 3050 | return -EINVAL; |
| 3051 | |
| 3052 | rx_tstamp_cycles = ngbe_read_rx_tstamp_cyclecounter(dev); |
| 3053 | ns = rte_timecounter_update(&adapter->rx_tstamp_tc, rx_tstamp_cycles); |
| 3054 | *timestamp = rte_ns_to_timespec(ns); |
| 3055 | |
| 3056 | return 0; |
| 3057 | } |
| 3058 | |
| 3059 | static int |
| 3060 | ngbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev, |
nothing calls this directly
no test coverage detected