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

Function ixgbe_timesync_enable

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

Source from the content-addressed store, hash-verified

7079}
7080
7081static int
7082ixgbe_timesync_enable(struct rte_eth_dev *dev)
7083{
7084 struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
7085 uint32_t tsync_ctl;
7086 uint32_t tsauxc;
7087
7088 /* Stop the timesync system time. */
7089 IXGBE_WRITE_REG(hw, IXGBE_TIMINCA, 0x0);
7090 /* Reset the timesync system time value. */
7091 IXGBE_WRITE_REG(hw, IXGBE_SYSTIML, 0x0);
7092 IXGBE_WRITE_REG(hw, IXGBE_SYSTIMH, 0x0);
7093
7094 /* Enable system time for platforms where it isn't on by default. */
7095 tsauxc = IXGBE_READ_REG(hw, IXGBE_TSAUXC);
7096 tsauxc &= ~IXGBE_TSAUXC_DISABLE_SYSTIME;
7097 IXGBE_WRITE_REG(hw, IXGBE_TSAUXC, tsauxc);
7098
7099 ixgbe_start_timecounters(dev);
7100
7101 /* Enable L2 filtering of IEEE1588/802.1AS Ethernet frame types. */
7102 IXGBE_WRITE_REG(hw, IXGBE_ETQF(IXGBE_ETQF_FILTER_1588),
7103 (RTE_ETHER_TYPE_1588 |
7104 IXGBE_ETQF_FILTER_EN |
7105 IXGBE_ETQF_1588));
7106
7107 /* Enable timestamping of received PTP packets. */
7108 tsync_ctl = IXGBE_READ_REG(hw, IXGBE_TSYNCRXCTL);
7109 tsync_ctl |= IXGBE_TSYNCRXCTL_ENABLED;
7110 IXGBE_WRITE_REG(hw, IXGBE_TSYNCRXCTL, tsync_ctl);
7111
7112 /* Enable timestamping of transmitted PTP packets. */
7113 tsync_ctl = IXGBE_READ_REG(hw, IXGBE_TSYNCTXCTL);
7114 tsync_ctl |= IXGBE_TSYNCTXCTL_ENABLED;
7115 IXGBE_WRITE_REG(hw, IXGBE_TSYNCTXCTL, tsync_ctl);
7116
7117 IXGBE_WRITE_FLUSH(hw);
7118
7119 return 0;
7120}
7121
7122static int
7123ixgbe_timesync_disable(struct rte_eth_dev *dev)

Callers

nothing calls this directly

Calls 1

ixgbe_start_timecountersFunction · 0.85

Tested by

no test coverage detected