linux/drivers/net/ethernet/intel
Jacob Keller 1d1a79b5b9 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>
2012-06-14 03:13:48 -07:00
..
e1000 e1000: look into the page instead of skb->data for e1000_tbi_adjust_stats() 2012-06-02 00:04:19 -07:00
e1000e e1000e: use more informative logging macros when netdev not yet registered 2012-06-14 03:03:14 -07:00
igb igb: Disable the BMC-to-OS Watchdog Enable bit for DMAC. 2012-05-17 05:04:21 -07:00
igbvf igbvf: fix the bug when initializing the igbvf 2012-04-30 18:54:31 -07:00
ixgb intel: make wired ethernet driver message level consistent (rev2) 2012-03-27 23:29:22 -07:00
ixgbe ixgbe: Check PTP Rx timestamps via BPF filter 2012-06-14 03:13:48 -07:00
ixgbevf ixgbevf: Update version string 2012-05-03 02:38:38 -07:00
e100.c e100: enable transmit time stamping. 2012-04-14 02:02:41 -07:00
Kconfig ixgbe: Hardware Timestamping + PTP Hardware Clock (PHC) 2012-05-09 22:48:51 -07:00
Makefile