summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2012-05-22 10:18:08 +0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-06-14 14:13:48 +0400
commit1d1a79b5b94b0aa84e1e78dd9acdcffb12274848 (patch)
tree9c6833a1486d5695269b35c56c1abbcbd3c618ae /include
parentc19197a7866fee6ff9985d9dc9962bc2ccbd3d7b (diff)
downloadlinux-1d1a79b5b94b0aa84e1e78dd9acdcffb12274848.tar.xz
ixgbe: Check PTP Rx timestamps via BPF filter
This patch fixes a potential Rx timestamp deadlock that causes the Rx timestamping to stall indefinitely. The issue could occur when a PTP packet is timestamped by hardware but never reaches the Rx queue. In order to prevent a permanent loss of timestamping, the RXSTMP(L/H) registers have to be read to unlock them. (This used to only occur when a packet that was timestamped reached the software.) However the registers can't be read early otherwise there is no way to correlate them to the packet. This patch introduces a filter function which can be used to determine if a packet should have been timestamped. Supplied with the filter setup by the hwtstamp ioctl, check to make sure the PTP protocol and message type match the expected values. If so, then read the timestamp registers (to free them.) At this point check the descriptor bit, if the bit is set then we know this packet correlates to the timestamp stored in the RXTSTAMP registers. Otherwise, assume that packet was dropped by the hardware, and ignore this timestamp value. However, we have at least unlocked the rxtstamp registers for future timestamping. Due to the way the driver handles skb data, it cannot be directly accessed. In order to work around this, a copy of the skb data into a linear buffer is made. From this buffer it becomes possible to read the data correctly Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Richard Cochran <richardcochran@gmail.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions