• Jacob Keller's avatar
    i40e: correct check for reading TSYNINDX from the receive descriptor · 144ed176
    Jacob Keller authored
    When hardware has taken a timestamp for a received packet, it indicates
    which RXTIME register the timestamp was placed in by some bits in the
    receive descriptor. It uses 3 bits, one to indicate if the descriptor
    index is valid (ie: there was a timestamp) and 2 bits to indicate which
    of the 4 registers to read. However, the driver currently does not check
    the TSYNVALID bit and only checks the index. It assumes a zero index
    means no timestamp, and a non zero index means a timestamp occurred.
    While this appears to be true, it prevents ever reading a timestamp in
    RXTIME[0], and causes the first timestamp the device captures to be
    ignored.
    
    Fix this by using the TSYNVALID bit correctly as the true indicator of
    whether the packet has an associated timestamp.
    
    Also rename the variable rsyn to tsyn as this is more descriptive and
    matches the register names.
    
    Change-ID: I4437e8f3a3df2c2ddb458b0fb61420f3dafc4c12
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    144ed176
i40e_txrx.c 83.7 KB