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

Function ngbe_timesync_enable

dpdk/drivers/net/ngbe/ngbe_ethdev.c:2979–3010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2977}
2978
2979static int
2980ngbe_timesync_enable(struct rte_eth_dev *dev)
2981{
2982 struct ngbe_hw *hw = ngbe_dev_hw(dev);
2983 uint32_t tsync_ctl;
2984
2985 /* Stop the timesync system time. */
2986 wr32(hw, NGBE_TSTIMEINC, 0x0);
2987 /* Reset the timesync system time value. */
2988 wr32(hw, NGBE_TSTIMEL, 0x0);
2989 wr32(hw, NGBE_TSTIMEH, 0x0);
2990
2991 ngbe_start_timecounters(dev);
2992
2993 /* Enable L2 filtering of IEEE1588/802.1AS Ethernet frame types. */
2994 wr32(hw, NGBE_ETFLT(NGBE_ETF_ID_1588),
2995 RTE_ETHER_TYPE_1588 | NGBE_ETFLT_ENA | NGBE_ETFLT_1588);
2996
2997 /* Enable timestamping of received PTP packets. */
2998 tsync_ctl = rd32(hw, NGBE_TSRXCTL);
2999 tsync_ctl |= NGBE_TSRXCTL_ENA;
3000 wr32(hw, NGBE_TSRXCTL, tsync_ctl);
3001
3002 /* Enable timestamping of transmitted PTP packets. */
3003 tsync_ctl = rd32(hw, NGBE_TSTXCTL);
3004 tsync_ctl |= NGBE_TSTXCTL_ENA;
3005 wr32(hw, NGBE_TSTXCTL, tsync_ctl);
3006
3007 ngbe_flush(hw);
3008
3009 return 0;
3010}
3011
3012static int
3013ngbe_timesync_disable(struct rte_eth_dev *dev)

Callers

nothing calls this directly

Calls 4

ngbe_dev_hwFunction · 0.85
ngbe_start_timecountersFunction · 0.85
wr32Function · 0.50
rd32Function · 0.50

Tested by

no test coverage detected