]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e: correct check for reading TSYNINDX from the receive descriptor
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 5 Oct 2016 16:30:42 +0000 (09:30 -0700)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:40:50 +0000 (19:40 -0500)
commit877bde5c946b6c7abc226d48b82b05a9fbb65913
treebe30fba12a9756c05e5e4dc4ed6f0146fbab31db
parente08ffd89565ed4cb83bfa01cd78abbdfffe6e3ba
i40e: correct check for reading TSYNINDX from the receive descriptor

Orabug: 24568124

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: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 144ed1763003c6a88a4b788cc5da1d8a1ddf061f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c