aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2012-05-22 02:08:37 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-06-14 06:13:22 -0400
commitc19197a7866fee6ff9985d9dc9962bc2ccbd3d7b (patch)
tree3e03a105f9134db1cb2151f4ba6c704b1bf5bd5c /drivers
parent0ede4a606af1778b24b84b7feed3c0bed2751a34 (diff)
ixgbe: PTP Fix hwtstamp mode settings
When enabling the hwtstamp mode for Rx timestamping the V2 ptp event type specific modes (Delay Request and Sync) have been rolled into the V2 all event packet modes, in order to more accurately represent what hardware is doing. Hardware always timestamps the Path delay packets when a V2 mode is selected, regardless of what type was selected (in order to always support Path delay mode). However this means the user selected modes of timestamping only Sync or Delay Request is not truly supported. This patch correctly sets the mode for the hwtstamp config and returns to the user that all V2 event packets will be timestamped. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index 174f41fd1d2f..5ed8cffee178 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -540,6 +540,11 @@ void ixgbe_ptp_rx_hwtstamp(struct ixgbe_q_vector *q_vector,
540 * type has to be specified. Matching the kind of event packet is 540 * type has to be specified. Matching the kind of event packet is
541 * not supported, with the exception of "all V2 events regardless of 541 * not supported, with the exception of "all V2 events regardless of
542 * level 2 or 4". 542 * level 2 or 4".
543 *
544 * Since hardware always timestamps Path delay packets when timestamping V2
545 * packets, regardless of the type specified in the register, only use V2
546 * Event mode. This more accurately tells the user what the hardware is going
547 * to do anyways.
543 */ 548 */
544int ixgbe_ptp_hwtstamp_ioctl(struct ixgbe_adapter *adapter, 549int ixgbe_ptp_hwtstamp_ioctl(struct ixgbe_adapter *adapter,
545 struct ifreq *ifr, int cmd) 550 struct ifreq *ifr, int cmd)
@@ -583,27 +588,15 @@ int ixgbe_ptp_hwtstamp_ioctl(struct ixgbe_adapter *adapter,
583 tsync_rx_mtrl = IXGBE_RXMTRL_V1_DELAY_REQ_MSG; 588 tsync_rx_mtrl = IXGBE_RXMTRL_V1_DELAY_REQ_MSG;
584 is_l4 = true; 589 is_l4 = true;
585 break; 590 break;
591 case HWTSTAMP_FILTER_PTP_V2_EVENT:
592 case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
593 case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
586 case HWTSTAMP_FILTER_PTP_V2_SYNC: 594 case HWTSTAMP_FILTER_PTP_V2_SYNC:
587 case HWTSTAMP_FILTER_PTP_V2_L2_SYNC: 595 case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
588 case HWTSTAMP_FILTER_PTP_V2_L4_SYNC: 596 case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
589 tsync_rx_ctl |= IXGBE_TSYNCRXCTL_TYPE_L2_L4_V2;
590 tsync_rx_mtrl = IXGBE_RXMTRL_V2_SYNC_MSG;
591 is_l2 = true;
592 is_l4 = true;
593 config.rx_filter = HWTSTAMP_FILTER_SOME;
594 break;
595 case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: 597 case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
596 case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: 598 case HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ:
597 case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: 599 case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
598 tsync_rx_ctl |= IXGBE_TSYNCRXCTL_TYPE_L2_L4_V2;
599 tsync_rx_mtrl = IXGBE_RXMTRL_V2_DELAY_REQ_MSG;
600 is_l2 = true;
601 is_l4 = true;
602 config.rx_filter = HWTSTAMP_FILTER_SOME;
603 break;
604 case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
605 case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
606 case HWTSTAMP_FILTER_PTP_V2_EVENT:
607 tsync_rx_ctl |= IXGBE_TSYNCRXCTL_TYPE_EVENT_V2; 600 tsync_rx_ctl |= IXGBE_TSYNCRXCTL_TYPE_EVENT_V2;
608 config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT; 601 config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
609 is_l2 = true; 602 is_l2 = true;