• Alessandro Rubini's avatar
    pdelay: rework and extend prev commit · 31f08f19
    Alessandro Rubini authored
    The previous commit is not enough as a fix.  This may happen:
    
        - we invalidate stamps after processing them
        - we send request
        - get reply, loose reply-fup
        - send request
        - loose reply, get f-up
    
    So we now invalidate when sending the request. And invalidate t4 alone
    as the beautifulness and symmetry of the previous commit is lost
    anyways.
    
    Note: there no need to invalidate stamps in e2e mode, because checking
    the sequence number to validate RX frames is enough.  But here all
    replies match the sequence number, so the problem is not caught and
    stamps from different tuples are mixed.
    
    Example beofre this commit, with trimmed stamps (was 1497283863):
    
       diag-frames-1-wr1: SENT 54 bytes at 863.333173928 (pdelay_req)
       diag-frames-1-wr1: RECV 54 bytes at 863.334158796 (type 3, pdelay_resp)
       diag-frames-1-wr1: Drop received frame
       diag-frames-1-wr1: SENT 54 bytes at 864.479336104 (pdelay_req)
       diag-frames-1-wr1: Drop received frame
       diag-frames-1-wr1: RECV 54 bytes at 864.481095164 (type a, presp_follow_up)
    
       diag-servo-2-wr1: servo:t3 = 864:479336104:0
       diag-servo-2-wr1: servo:t4 = 863:333174267:586
       diag-servo-2-wr1: servo:t5 = 864:480295312:0
       diag-servo-2-wr1: servo:t6 = 863:334158796:773
       diag-servo-2-wr1: ->mdelay = -2:-292298352:359
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    31f08f19
common-fun.c 8.52 KB