# # ptp4l on the wasm32-hwjs arm: an ordinary clock on the UDPv4 transport over # lo, timestamped in software. # # time_stamping is the one value that is not a preference. Upstream's shipped # /etc/linuxptp/ptp4l.conf is a copy of configs/default.cfg, which asks for # `hardware': clock_create() then has no way to reach a PHC index and exits with # "PTP device not specified and automatic determination is not supported". This # target has no PTP hardware clock at all, so `software' -- which pins phc_index # to -1 and disciplines CLOCK_REALTIME -- is the only arm that runs here. # # UDPv4 is chosen over the default-adjacent L2 for a kernel reason: the wasm32 # defconfig leaves CONFIG_PACKET unset, so AF_PACKET does not exist and the raw # Ethernet transport cannot open a socket at all. # [global] time_stamping software network_transport UDPv4 delay_mechanism E2E clock_type OC # # free_running is a WORKAROUND, and it is the difference between this daemon # running and not existing on this image. clock_create() calls # clockadj_get_freq() for any clock that is not CLOCK_INVALID, and that function # does not return an error -- it exit(1)s. clock_adjtime(2) has no entry at [305] # in the wasm32 syscall table and returns ENOSYS, so a disciplining ptp4l dies # before it opens a port: no port state machine, no management interface, no # socket. `free_running 1' pins clkid to CLOCK_INVALID, the one arm # clock_create() guards that call with, so everything except steering the clock # comes up -- and steering is what this target cannot do in any case. # # BRINTOS-WORKAROUND: brintos/linux#106 remove # free_running 1 # # Every value below is deliberately NOT the compiled-in default, so a management # reply that echoes one cannot be a default wearing a configured value's clothes. # Defaults, from config.c: clockIdentity is generated from the interface MAC, # domainNumber 0, priority1 128, priority2 128, clockClass 248. # # The clock identity is in the EUI-64-from-MAC shape linuxptp itself generates # (xxxxxx.fffe.xxxxxx) with a locally-administered OUI, so it is well-formed # without claiming an assigned one. # clockIdentity e2c1a6.fffe.1226ff domainNumber 44 priority1 101 priority2 202 clockClass 187 # # The self-test scores what the process wrote, so the log goes to stderr rather # than to a syslog socket that need not exist. # use_syslog 0 verbose 1 logging_level 6 # # NOT the default /var/run/ptp4l, and not a preference either. Binding an # AF_LOCAL socket creates a socket inode, and the guest root is served by the # host-directory mount provider, which represents regular files ONLY -- the # runtime says so itself, `virtio_fs: backend refusal -> errno 1: mknod: only # regular files are representable on the host-directory store'. So uds_open()'s # bind() returns EPERM for any path on /, port_open() of the UDS-RW port fails, # and clock_create() returns NULL. /tmp is tmpfs on this image (`#56 mounted # tmpfs -> /tmp') and represents a socket node correctly. # # The read-only port is moved for the same reason and in the same breath: # clock_create() opens uds_ro_address too, and fails identically on it. # # This works around no defect -- a store that backs a guest root with host # directories cannot represent a socket, which is a property of that store and # not a bug in it -- so it carries no BRINTOS-WORKAROUND marker. It does mean # `pmc -u' needs `-s' to FIND this ptp4l, and `-i' for its own local socket, # since pmc.c hardcodes /var/run/pmc.$pid when -i is absent. 88-linuxptp.test # passes both. # # It still needs `-d 44' to be HEARD by it. port_ignore() drops a management # message whose header domainNumber differs from the clock's, and the UDS port # is filtered by that same function -- port_is_uds() exempts only non-management # traffic from it. So a non-default domainNumber is a decision about the # criterion command, not just about the reply it prints: 88-linuxptp.test scores # both halves, the addressed query answering and the bare one staying silent. # uds_address /tmp/ptp4l uds_ro_address /tmp/ptp4lro # # lo is this image's only interface. It carries no MAC, which is precisely why # clockIdentity is set above rather than generated. # [lo]