1. 02 Dec, 2016 1 commit
  2. 01 Dec, 2016 3 commits
  3. 20 Sep, 2016 7 commits
    • Alessandro Rubini's avatar
      state-master: turn switch() to actions[] · 1edcf5c4
      Alessandro Rubini authored
      This shrinks p2p builds by 100 bytes, but increases by 100 bytes
      the wrpc defconfig (the one withouth P2P code).
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      1edcf5c4
    • Alessandro Rubini's avatar
      Support E2E build without P2P. Saves 5kB in wrpc-sw · 3542ae48
      Alessandro Rubini authored
      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: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      3542ae48
    • Alessandro Rubini's avatar
      state-slave: turn switch() to actions[] · a6114e99
      Alessandro Rubini authored
      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: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      a6114e99
    • Alessandro Rubini's avatar
      ca2443b2
    • Davide Ciminaghi's avatar
      pdelay: factorize code handling pdelay_resp_followup · b64e38cf
      Davide Ciminaghi authored
      remove duplication, remove code size
      b64e38cf
    • Davide Ciminaghi's avatar
      compliance, 11.3, d: take delay_resp cf into account · a44cadcb
      Davide Ciminaghi authored
      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.
      a44cadcb
    • Alessandro Rubini's avatar
      state-slave: avoid some redundant calculation · a16a3460
      Alessandro Rubini authored
      Please note that timeout_init is not resetting timeouts, it's just
      saving the values for later settings.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      a16a3460
  4. 16 Jun, 2016 1 commit
  5. 16 May, 2016 9 commits
  6. 21 Jul, 2015 1 commit
  7. 18 Jun, 2015 1 commit
    • Alessandro Rubini's avatar
      protocols: handle PP_SEND_NO_STAMP specially · 7c62f416
      Alessandro Rubini authored
      This is the result of an audit of all send functions. Most are not
      affected, because they send on the "general" channel. But when event
      messages are sent, an error of SEND_NO_STAMP must not be fatal.
      In WR, for example, after a sync the stamping engine reports invalid
      stamps for a second.
      
      I chose not to change the return type of the sending function and have
      the compiler help me, because my mates are working on peer-delay and I'd
      better not make the merge more difficult for us.
      
      Unfortunately, my wrs is still not syncing with this patch, as it remains
      stuck in SYNC_NSEC (in the state machine within the WR servo). See
      next commit....
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      7c62f416
  8. 07 Nov, 2014 3 commits
  9. 15 Sep, 2013 1 commit
    • Alessandro Rubini's avatar
      servo: rename some functions (no technical effect) · dc5a6c4e
      Alessandro Rubini authored
      The servo implementation we brought forward from ptpd was strange
      and difficult to understand. This commit is the first step in trying
      to make some order, but it doesn't actually change anything but names.
      
      The entry points for the servo are now called pp_servo_init(),
      pp_servo_got_sync() and pp_servo_got_resp().  A two-step protocol
      calls got_sync after getting the follow-up message.
      
      Also, the hook for response messages is called handle_resp with a
      name similar to the hooks for sync and follow-up.
      
      The servo itself is not changed, but I reordered the functions so
      the calculations appear in the real order in which they happen.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      dc5a6c4e
  10. 31 Jul, 2013 1 commit
    • Alessandro Rubini's avatar
      general: rephrase copyright notices (no tech effect) · 23033d8a
      Alessandro Rubini authored
      This changes all "Name Surname for CERN" to "Copyright CERN, author
      Name Surname".  This is trivial and makes no change, with a few
      expections:
      
      - all trivial Makefiles that had "for CERN" lines have now no
      attributions, as they are trivial anyways.
      
      - a few unrepresented files have not the copyright notice (especially
      ptpdump, that I wrote in 2012).
      
      - a few "for CERN" remain in subprojects, where I didn't touch anyrhing
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      23033d8a
  11. 23 Apr, 2013 1 commit
  12. 02 Apr, 2013 1 commit
  13. 18 Mar, 2013 3 commits
    • Alessandro Rubini's avatar
      correctionField: simplify code · 05e8a274
      Alessandro Rubini authored
      This removes some needless local variables related to correction
      field, but relying on a new "cField" entry in pp_instance, near
      the t1,t2,t3,t4 status stamps.
      
      The commit also adds a FIXME note: it is not clear to me how the
      correction field can be managed in the back message (t3, t4).
      Since the correctionField is updated by transparent clocks, I think
      we need the one of the delay request (the one stamped in t3, t3),
      *not* the delay response that I don't care about.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      05e8a274
    • Alessandro Rubini's avatar
      bugfix: correctionField conversion · a1b8d474
      Alessandro Rubini authored
      I initially looked at int64_to_TimeInternal to swap arguments, since
      to_TimeInternal as timeinternal (the output) as first argument, and
      they appeared in pairs.  However, int64_to_TimeInternal is only used
      for correction fields, and they are scaled nanoseconds (page 126), not
      nanoseconds.
      
      Thus, this commit fixes the conversion and renames the function to
      "cField_to_TimeInternal" to better tell the reader what it is.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      a1b8d474
    • Alessandro Rubini's avatar
      general: rename fields within ppsi (no technical change) · a78aefb1
      Alessandro Rubini authored
      This renames sync_receive_time to t2, delay_req_send_time to t3
      and delay_req_receive_time to t4 (there is "t1" field in ppi yet).
      
      Such naming is what the official documents use everywhere, so it's
      better to respect that naming, that everybody in the field is familiar
      with. Besides, they are shorter and they can be used unchanged for
      pdelay operations (the previous pdelay implementation we inherited
      from ptpd, used a separate set of fields that are not really needed).
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      a78aefb1
  14. 08 Mar, 2013 3 commits
    • Alessandro Rubini's avatar
      kill ppi->record_update · fd2b09a0
      Alessandro Rubini authored
      The code, when receiving announce, was setting a flag in order to run
      bmc at the next iteration, when that happened, the frame just received
      was discarded in favour for the programmed state update.
      
      This commits remove some fields and one helper function, so the new
      announce is immediately processed and no frame is lost.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      fd2b09a0
    • Alessandro Rubini's avatar
      kill portState: nobody is using it · 692af7f3
      Alessandro Rubini authored
      the portState field is probably a relic of ptpd, then the state
      machine was a single switch() statement.  Many places were still
      setting it, but nobody was ever reading the field.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      692af7f3
    • Alessandro Rubini's avatar
      kill ppi->msg_tmp · 4a7a4164
      Alessandro Rubini authored
      There is no need for a "msg_tmp" in the pp-instance. All uses are
      really temporary to a function, so we can use local variables instead.
      
      (This is not the same as what was called tmp_header, which was
      referenced all over message processing, so it still exists, though
      renamed).
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      4a7a4164
  15. 07 Mar, 2013 2 commits
    • Alessandro Rubini's avatar
      general (for bmc.c): turn ClockIdentity into a structure · f9f487ff
      Alessandro Rubini authored
      This "type" was the only type represented as an array instead of
      being a structure. This leads to inconsistent use: if you memcpy
      the other ones you need "&", but not here.
      
      So this commit uses an encompassing structure, to have ClockIdentity
      behave like other composite fields.  The commit has no effect at all
      on the generated binary files for wrpc but it unexpectedly reduces the
      size of the output on the PC. Anyways, the commit is trivial, and all
      changes can be easily verified to have no effect.
      
      While this increases entropy, the reasoning is that I want to assign
      structures instead of running zillions of memcpy functions, with the
      hairy PP_CLOCK_IDENTITY_LENGTH.  So later commits, based on this one,
      reduce entropy.
      Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
      f9f487ff
    • Alessandro Rubini's avatar
      5e595126
  16. 05 Mar, 2013 2 commits