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

Function ice_timesync_read_tx_timestamp

dpdk/drivers/net/ice/ice_ethdev.c:6403–6428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6401}
6402
6403static int
6404ice_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
6405 struct timespec *timestamp)
6406{
6407 struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
6408 struct ice_adapter *ad =
6409 ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
6410 uint8_t lport;
6411 uint64_t ts_ns, ns, tstamp;
6412 const uint64_t mask = 0xFFFFFFFF;
6413 int ret;
6414
6415 lport = hw->port_info->lport;
6416
6417 ret = ice_read_phy_tstamp(hw, lport, 0, &tstamp);
6418 if (ret) {
6419 PMD_DRV_LOG(ERR, "Failed to read phy timestamp");
6420 return -1;
6421 }
6422
6423 ts_ns = ice_tstamp_convert_32b_64b(hw, ad, 1, (tstamp >> 8) & mask);
6424 ns = rte_timecounter_update(&ad->tx_tstamp_tc, ts_ns);
6425 *timestamp = rte_ns_to_timespec(ns);
6426
6427 return 0;
6428}
6429
6430static int
6431ice_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta)

Callers

nothing calls this directly

Calls 4

ice_read_phy_tstampFunction · 0.85
rte_timecounter_updateFunction · 0.85
rte_ns_to_timespecFunction · 0.85

Tested by

no test coverage detected