PPSi:7d10c34187f8e30d9bfb32942481136cb2d29c34 commitshttps://ohwr.org/project/ppsi/commits/7d10c34187f8e30d9bfb32942481136cb2d29c342016-10-25T12:52:24Zhttps://ohwr.org/project/ppsi/commit/7d10c34187f8e30d9bfb32942481136cb2d29c34trivial: remove unsed in/outbound_latency2016-10-25T12:52:24ZAlessandro Rubinirubini@gnudd.com
While it may make sense to setup constant delay somewhere (for WR we
define them, for instance), the legacy implementation was unused and
wrong.
Unused because nobody sets it (even if we could do it in the config
file). Wrong because inbound is never used, and both are global and
not per-port.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/5e0e5a623675d50ec56514d51f87a8a348818032general: make delay mechanism configurable and fix defaults2016-10-25T12:52:24ZAlessandro Rubinirubini@gnudd.com
Now this is the behaviour for the choice:
arch-bare-*
if you select P2P, it's built and selected. Default is E2E_ONLY.
arch-sim
arch-unix
arch-wrs
The P2P is built by default configuration, and the mechanism
is selected at configuration time. Default is E2E. If you
choose E2E_ONLY and configure pdelay, it will ignore the config.
(Suboptimal but I'm lazy: do *not* use E2E_ONLY for those archs.
arch-wrpc
The default is e2e until changed at run time.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/8699f7d5ffacf086ba454a8ad23d2831cbc1b6ccgeneral: move delay mechanism from global to per-port2016-10-25T12:52:24ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/c07764dde5c2be1e012ad88b71e2ad99dc66b2datrivial: Kconfig: remove two wrong lines with no effect2016-10-25T12:52:24ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/39ca8a68fa25ff04c8ba667fe5355a94dcc736e8Merge branch 'adam-shmem'2016-09-30T09:29:35ZAdam Wujekadam.wujek@cern.ch
Uplift shmem from wr-switch-sw repo.
Fix previous uplift of shmem and improve debug printout.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9297"><a href="https://ohwr.org/awujek" title="adam.wujek@cern.ch"><img alt="Adam Wujek's avatar" src="https://secure.gravatar.com/avatar/bee62ad02d8f8c7c40900167722fb9d3?s=32&d=identicon" class="avatar s16 avatar-inline" title="Adam Wujek"></a><a href="https://ohwr.org/awujek" title="adam.wujek@cern.ch">Adam Wujek</a> <<a href="mailto:adam.wujek@cern.ch" title="adam.wujek@cern.ch">adam.wujek@cern.ch</a>></span>https://ohwr.org/project/ppsi/commit/669743b99916006aa327910ca2bee5856e728265arch-wrs: printout more details when wrs_shm_write is called2016-09-30T09:27:36ZAdam Wujekadam.wujek@cern.ch
Commit based on the commit from wrs-switch-sw described below.
userspace/libwr: printout more details when wrs_shm_write is called
It might be usefull to know whether caller wanted to lock or unlock the shmem
and which shmem.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9297"><a href="https://ohwr.org/awujek" title="adam.wujek@cern.ch"><img alt="Adam Wujek's avatar" src="https://secure.gravatar.com/avatar/bee62ad02d8f8c7c40900167722fb9d3?s=32&d=identicon" class="avatar s16 avatar-inline" title="Adam Wujek"></a><a href="https://ohwr.org/awujek" title="adam.wujek@cern.ch">Adam Wujek</a> <<a href="mailto:adam.wujek@cern.ch" title="adam.wujek@cern.ch">adam.wujek@cern.ch</a>></span>https://ohwr.org/project/ppsi/commit/18b0f27d914bba6965b82ffa311428f644a9516aarch-wrs: in shmem, use pointers to structs intead of void pointers2016-09-30T09:25:58ZAdam Wujekadam.wujek@cern.ch
Commit based on the commit from wrs-switch-sw described below.
Apply changes to the arch-wrs/wrs-startup.c to follow declaration change of
wrs_shm_alloc.
userspace/libwr: in shmem, use pointers to structs intead of void pointers
In shared memory functions take as parameters pinters to structures instead
of void pointers. By this compiler will warn when wrong type of pointer is
passed. For example when pointer to the data in shmem is passed instead of
pointer to the header.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9297"><a href="https://ohwr.org/awujek" title="adam.wujek@cern.ch"><img alt="Adam Wujek's avatar" src="https://secure.gravatar.com/avatar/bee62ad02d8f8c7c40900167722fb9d3?s=32&d=identicon" class="avatar s16 avatar-inline" title="Adam Wujek"></a><a href="https://ohwr.org/awujek" title="adam.wujek@cern.ch">Adam Wujek</a> <<a href="mailto:adam.wujek@cern.ch" title="adam.wujek@cern.ch">adam.wujek@cern.ch</a>></span>https://ohwr.org/project/ppsi/commit/0920900666c8b4f969adf3fc8c37fc7241e0b684arch-wrs: fix commit "improve locking of shmem"2016-09-30T09:03:30ZAdam Wujekadam.wujek@cern.ch
The commit:
<a href="/project/ppsi/commit/15076cb6b1b82ebb1752baeec2d24d8018f1d276" data-original="15076cb6" data-link="false" data-link-reference="false" data-project="10763" data-commit="15076cb6b1b82ebb1752baeec2d24d8018f1d276" data-reference-type="commit" data-container="body" data-placement="bottom" title="arch-wrs: improve locking of shmem" class="gfm gfm-commit has-tooltip">15076cb6</a> arch-wrs: improve locking of shmem
didn't fully apply the patch from the wr-switch repo.
This commit apply changes to arch-wrs/shmem.c that were missed
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9297"><a href="https://ohwr.org/awujek" title="adam.wujek@cern.ch"><img alt="Adam Wujek's avatar" src="https://secure.gravatar.com/avatar/bee62ad02d8f8c7c40900167722fb9d3?s=32&d=identicon" class="avatar s16 avatar-inline" title="Adam Wujek"></a><a href="https://ohwr.org/awujek" title="adam.wujek@cern.ch">Adam Wujek</a> <<a href="mailto:adam.wujek@cern.ch" title="adam.wujek@cern.ch">adam.wujek@cern.ch</a>></span>https://ohwr.org/project/ppsi/commit/1edcf5c4dd26bb9ab107f2e8386d588f196fda6bstate-master: turn switch() to actions[]2016-09-20T07:36:23ZAlessandro Rubinirubini@gnudd.com
This shrinks p2p builds by 100 bytes, but increases by 100 bytes
the wrpc defconfig (the one withouth P2P code).
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/7a80b4b1ae5bda942c5ad72727858cfc2a269754state-master: unify master and pre-master2016-09-20T07:36:23ZAlessandro Rubinirubini@gnudd.com
This saves 50 bytes in wrpc-sw (and more in x86 builds)
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/8c1dfbcdc6559c50cdbb0b06de6ea96fa80bddb7SQUASH in '14cacab: shorten'2016-09-20T07:36:23ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/3542ae485f04e6677906c7524d2a0ec0df286811Support E2E build without P2P. Saves 5kB in wrpc-sw2016-09-20T07:36:20ZAlessandro Rubinirubini@gnudd.com
Here in ppsi,
./MAKEALL wrpc_defconfig wrpc_pdelay_defconfig
shows a very small difference, but most pdelay code is then
discarded by the wrpc-sw link time, due to --gc-sections.
This is the result:
laptopo% ./MAKEALL spec_defconfig spec_pdelay_defconfig
##### Building with 'spec_defconfig'
/opt/lm32-gcc-4.5.3/bin/lm32-elf-ar: creating libsdbfs.a
text data bss dec hex filename
87688 3492 6352 97532 17cfc wrc.elf
##### Building with 'spec_pdelay_defconfig'
/opt/lm32-gcc-4.5.3/bin/lm32-elf-ar: creating libsdbfs.a
text data bss dec hex filename
93140 3492 6360 102992 19250 wrc.elf
What is missing now is the run-time choice between e2e and p2p. Later....
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/687d84324d26bce446081a4998f091413c23a313config: prepare for an e2e build with no p2p code inside2016-09-20T07:35:53ZAlessandro Rubinirubini@gnudd.com
There is a size problem in wrpc-sw, when built with SNMP inside, so
some users, notably CERN, want to avoid the pdelay code (allegedly 7kB
in the binary).
Users who need pdelay don't actually run SNMP, so they don't have the
size problem. This new setup allows a wrpc-sw without pdelay-related
code. Wrpc with both mechanisms built in will be run-time configurable.
the wrs and unix configurations for peer delay are removed, because
for those architecture the choice is going to be performed at run time,
in the configuration file.
Please note that this commit is config-only, no code yet is there.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/a6114e99eefa6c4a779820dfe99a74986573c8c1state-slave: turn switch() to actions[]2016-09-20T07:35:53ZAlessandro Rubinirubini@gnudd.com
Using a data-driven approach to manage incoming frames is definitely
cleaner and clearer. It even has a (very minor) size reduction for wrpc.
I plan to use this approach overall, as time permits.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/29b77da9c9c1c48c34f4bc0fa5dec48252287085bugfix/workaround: unix-socket: disable settings for UDP/pdelay2016-09-20T07:35:53ZAlessandro Rubinirubini@gnudd.com
This won't work, because packets must be sent to two different
IP multicast addresses. This is not supported. The code being disabled
had the effect of setting the pdelay destination for all frames, even
for E2E runs.
This fixes E2E UDP operation, leaving P2P broken as it was.
Signed-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/ca2443b233de459f589f8e2e188bce9bd66206e7trivial: shorten a long symbolic name2016-09-20T07:35:53ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/ca26578ff8bd1dc6bc69a3ccaf6ea93ca2cfc8dftrivial: fold pre-master.c into master.c2016-09-20T07:35:53ZAlessandro Rubinirubini@gnudd.comSigned-off-by: <span data-trailer="Signed-off-by:" data-user="9028"><a href="https://ohwr.org/rubini" title="rubini@gnudd.com"><img alt="Alessandro Rubini's avatar" src="https://secure.gravatar.com/avatar/18e4fb369cda4873020839db5911d1d1?s=32&d=identicon" class="avatar s16 avatar-inline" title="Alessandro Rubini"></a><a href="https://ohwr.org/rubini" title="rubini@gnudd.com">Alessandro Rubini</a> <<a href="mailto:rubini@gnudd.com" title="rubini@gnudd.com">rubini@gnudd.com</a>></span>https://ohwr.org/project/ppsi/commit/4f221227331f5b3512f9ef80594d29e5593fd231compliance, 11.4.3 b: peer-delay, fix support for 1-step2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.com
If no follow-up is to be received, we trigger pp_servo_got_presp()
on reception of peer delay response.https://ohwr.org/project/ppsi/commit/c7627fa8cdfe0c8de7e0fd7ebb628233a4b6db90compliance, 9.5.2.3: discard announces coming from same clock.2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.com
In this case we also possibly have switch to port state to PASSIVE.https://ohwr.org/project/ppsi/commit/bbd0e2c1c951b4ae542182a404fa3fc1c86459dbfsm: move code for filtering out packets to a dedicated function2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.com
A function should only do what it promises, so msg_unpack_header should
just unpack. This move also gets also us ready for fixing compliance
to 9.5.2.3.https://ohwr.org/project/ppsi/commit/79f423b5eee742a69f98ce9d9c1548276e84a997fsm: introduce leave_current_state()2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.com
This gets us ready for leaving a state as a consequence of filtered out
messages (9.5.2.3: discard announce AND switch state to PASSIVE).https://ohwr.org/project/ppsi/commit/d2b2c6364cc7979b28191bc5b6a492b4ccfce1acfsm: cache pointer to current state table item2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/fa17b6c7f890a751d0cf2a1f44bedce2c71c545cfsm: reduce indentation level2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/07e328e3415eebaba2fb4821c91c5d2a5dfbec91fsm: simplify msg header unpacking code2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/d444b632dda66c9b2bc163abaff3490290f08bc0compliance, 9.5.2.2: ignore messages received from same port that sent them2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/c4868336d964fcbe51b0c53ec2cc01e882b82e60compliance, 9.3.5: properly update timePropertiesDS on M12016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.com
See Table 13.
Note that we keep currentUtcOffset as it is and reset currentUtcOffsetValid,
because we presently don't know about leap seconds.
leap59 and leap61 are forced to zero.https://ohwr.org/project/ppsi/commit/c8ba307fbac6f419d1a75ad4de3f2ed4668ff971compliance, 9.3.5: set parentDS.parentPortIdentity.portNumber=0 on M12016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.com
See Table 13.https://ohwr.org/project/ppsi/commit/22fd4741b7831b21d191a629666caab3e12794bdcompliance, 13.3.2.6: make sure flags are always properly set2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.com
See Table 20.https://ohwr.org/project/ppsi/commit/c6834256204b43d0df817f0adf98fc08a39a463bcompliance, 17.4.2, NOTE: discard messages with alternateMasterFlag set2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.com
We don't support alternate masters at present.https://ohwr.org/project/ppsi/commit/3707e81286ac0fe9c74c68f24302fd75a70c62a5compliance, 13.3.2.5: set domain number in all outgoing frames2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.com
We're not a transparent clock, so this should be ok.https://ohwr.org/project/ppsi/commit/5217805aac672eeab3d67b4741e012f9bc131617compliance, 9.5.1: discard messages not coming from our domain2016-09-20T07:35:53ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/2996dd7b23f1f7882a0f8b7571c61ca81327f387compliance, 9.2.6.10: properly switch to MASTER or PRE_MASTER2016-09-20T07:35:52ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/bd3f1faef2fd2c9b7f5a94a19f3d4e4f2e15110bcompliance, 6,7.2: implement PRE_MASTER2016-09-20T07:35:52ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/a1997d64b620720721513757918a8da32442d963timeout: introduce QUALIFICATION timeout (for pre-master)2016-09-20T07:35:52ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/ca86ffd2b8e543aa19bc846b67988ba80ca983adcompliance, 11.4.3: force responseOriginTimestamp to zero for p2p 1-step2016-09-20T07:35:52ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/6a789557b0dbba9857ec789bdfc7bc01bb7fb156compliance, 11.4.3: take cf of Pdelay_Resp_Followup into account2016-09-20T07:35:52ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/71d64080c4e3de577450feea983f0dc18d32310fcompliance, 11.4.3: fix handling of twoStepFlag in Pdelay_Resp2016-09-20T07:35:52ZDavide Ciminaghiciminaghi@gnudd.com
We also avoid setting the same flag while handling a Pdelay_Resp_Followup.https://ohwr.org/project/ppsi/commit/b64e38cf8ebe78bd6ed9259b4a7112a49c8fcfe2pdelay: factorize code handling pdelay_resp_followup2016-09-20T07:35:52ZDavide Ciminaghiciminaghi@gnudd.com
remove duplication, remove code sizehttps://ohwr.org/project/ppsi/commit/18b2ed685dd41d036b181fb82b7271b7594ccc40compliance, 11.4.3: save cf of Pdelay_Resp for meanPathDelay calculation2016-09-20T07:35:52ZDavide Ciminaghiciminaghi@gnudd.comhttps://ohwr.org/project/ppsi/commit/a44cadcbc202e3f15c6c69d7cd52793fe5b89331compliance, 11.3, d: take delay_resp cf into account2016-09-20T07:35:52ZDavide Ciminaghiciminaghi@gnudd.com
11.3 d says:
Upon receipt of the Delay_Resp message by the slave:
1) If the received Sync message indicated that a Follow_Up message will not
be received, the <meanPathDelay> shall be computed as:
<meanPathDelay> = [(t2 - t3) + (receiveTimestamp of Delay_Resp message -
originTimestamp of Sync message) -
correctionField of Sync message -
correctionField of Delay_Resp message]/2.
2) If the received Sync message indicated that a Follow_Up message will be
received, the <meanPathDelay> shall be computed as:
<meanPathDelay> = [(t2 - t3) + (receiveTimestamp of Delay_Resp message -
preciseOriginTimestamp of Follow_Up message) -
correctionField of Sync message -
correctionField of Follow_Up message -
correctionField of Delay_Resp message]/2.
We assume that:
t1 = originTimestamp of Sync message (one step) or
t1 = preciseOriginTimestamp of Follow_Up message (two steps)
and
t4 = receiveTimestamp of Delay_Resp message
wich is true for masters not supporting sub-nanosecond
timestamps (we don't support sub-ns precision via standard protocol, so the
assumption should be true for us).
As sync (or followup) arrives, we calculate m_to_s_dly, which is:
t2 - t1 - cf_sync - cf_followup
When delay_resp arrives, we calculate s_to_m_dly, which is:
t4 - t3 - cf_delay_resp
So [(m_to_s_dly + s_to_m_dly) / 2] should be equal to:
(t2 - t3 + t4 - t1 - cf_sync - cf_followup - cf_delay_resp) / 2
which looks like the 11.3 d expression for mean path delay
(note that cf_followup is zero for a one-step master).
To get this result, we just save the delay_resp cf to ppi->cField.