ONESYNC

OneSync Diag commands

ONESYNC

Control the OneSync time-synchronisation firmware and its peer-to-peer (P2P) PTP mode. Init and DeInit start and stop the kernel-side time-sync support (KNET sync) together with the firmware.

Sub-command words can be abbreviated to their capital letters; the P2P words (init, set, show, port_config, …) are all lower case, so any prefix of them is accepted. The built-in help lists ONESYNC SyncCHecK PORT=<> LANE=<>, but the shell does not implement it and prints ONESYNC: Invalid option SyncCHecK.

Without OneSync firmware the firmware commands fail. SONiC on Trident 3 does not use OneSync: onesync p2p show config fails with cmd_knetsync_p2p_instance_show() Error .., (FCN Return= -17) (-17 is the SDK’s “Feature not initialized”), followed by the SAI shell’s Failed to execute the diagnostic command. Error: Operation failed. onesync hostloglevel still answers, from the host side.

Safety

Sub-command

Effect

HOSTLOGLeVeL (no argument), SyncTSget, p2p show …

Read-only.

Init, DeInit, HOSTLOG, HOSTLOGLeVeL <mask>, SYNCTRIGger, p2p init, p2p set …

Change time-sync firmware state. DeInit also stops the kernel-side time-sync support.

Unvalidated

drivshell> onesync synctsget
ONESYNC Init

Initialise OneSync. On failure prints Failed to init OneSync: <error>.

Unvalidated

drivshell> onesync init
ONESYNC DeInit

Shut OneSync down.

Unvalidated

drivshell> onesync deinit
ONESYNC HOSTLOG [ON | OFF]

Start (ON) or stop (OFF) the firmware’s host log.

Unvalidated

drivshell> onesync hostlog on
ONESYNC HOSTLOGLeVeL [<log_level>]

Without an argument, print which log categories are enabled and disabled (Debugging is enabled for: …), followed by OneSync Firmware: hostlogging level set to 0x<mask> with the current mask (0x0 when nothing is enabled). With an argument, set the categories and print the same line with the new mask. Categories: bs_info, bs_err, bs_verb, pktio_info, pktio_err, pktio_verb, gpio_info, gpio_err, gpio_verb, phc, config, pdelay_info, pdelay_pktio, pdelay_err, p2p_dbg_data.

Hardware-validated

drivshell> onesync hostloglevel
Debugging is enabled for:


Debugging is disabled for:

bs_info bs_err bs_verb pktio_info pktio_err pktio_verb
gpio_info gpio_err gpio_verb phc config pdelay_info
pdelay_pktio pdelay_err p2p_dbg_data

OneSync Firmware: hostlogging level set to 0x0
ONESYNC SYNCTRIGger AlignInPin=<pin> FreqInPin=<pin> FREQHZ=<hz> PHYID=<id>

Configure the external sync source and echo it as sync_trigger_cfg: alignment:… freq:… freq_hz:… phyid:…. Only 4 kHz is supported (Only 4Khz frequency is currently supported.).

Unvalidated

drivshell> onesync synctrigger aligninpin=0 freqinpin=1 freqhz=4000 phyid=0
ONESYNC SyncTSget

Print the last sync timestamp, Sync_ts[0x<ts>]. Read-only.

Unvalidated

drivshell> onesync syncts
ONESYNC p2p <init | set | show> …

Peer-to-peer PTP configuration:

  • p2p init NumPorts=<n> IsTwoStep=<0|1> ID=<clock_id>

  • p2p set port_config port=<port> …, p2p set encap_hdr ACTion=<0|1|2>, p2p set syncpdu_config … (keys as in the built-in help)

  • p2p show config, p2p show port_config port=<port>, p2p show port_stats port=<port>, p2p show syncpdu_config port=<port>, p2p show syncpdu_stats port=<port>

init and set change the firmware configuration; show is read-only.

Hardware-validated

drivshell> onesync p2p show config

cmd_knetsync_p2p_instance_show() Error .., (FCN Return= -17)

Failed to execute the diagnostic command. Error: Operation failed.

Built-in help

ONESYNC Init
  Initialize onesync firmware
ONESYNC DeInit
  DeInitialize onesync firmware
ONESYNC HOSTLOG [ON|OFF]
  Enable hostlog for onesync firmware
ONESYNC HOSTLOGLeVeL <log_level>
  Hostlog level for onesync firmware
ONESYNC SYNCTRIGger AlignInPin=<> FreqInPin=<> FREQHZ=<> PHYID=<>
  Configure external source information to sync to.
ONESYNC SyncTSget
  Fetch Sync timestamp.
ONESYNC SyncCHecK PORT=<> LANE=<>
  Compare Sync timestamps from switch and PHY port.
ONESYNC p2p init NumPorts=<num_ports> IsTwoStep=<0/1> ID=<clock_id>
  Init P2P configuration of onesync firmware
ONESYNC p2p set port_config  port=<port_id> MyMAC=<macaddr> DstMAC=<macaddr> MultiCast=<Y/n> Prio=<prio>  Vlan=<tag>
                enable=<0/1> domain=<domain_num> logPdelayReqInterval=<no> PortType=<num>
  Set P2P port configuration of onesync firmware
ONESYNC p2p set encap_hdr ACTion=<0/1/2>
  Configure action type to fwd PDelRsp w/ TS info(0:None; 1:Fwd to host; 2:Encap with preconfig hdr and send).
ONESYNC p2p set syncpdu_config enable=<0/1> tx_port=<port_id> rx_port=<port_id> domain=<domain_num> logSyncPktInterval=<no>
  Set  Sync Pkt Configuration of port onesync firmware
ONESYNC p2p show config
  Show P2P configuration of onesync firmware
ONESYNC p2p show port_config port=<port_id>
  Show P2P port configuration of onesync firmware
ONESYNC p2p show port_stats port=<port_id>
  Show P2P Pkt stats of port onesync firmware
ONESYNC p2p show syncpdu_config port=<port_id>
  Show P2P Sync Pkt configuration of port onesync firmware
ONESYNC p2p show syncpdu_stats port=<port_id>
  Show P2P Sync Pkt configuration of port onesync firmware