aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2014-07-09 03:46:11 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-07-16 17:06:44 -0400
commit302b46449e2918a30b3f98a54653972d2ad0f072 (patch)
tree3a3c8e6538e90a380871ad00ab2b249488c0f0a3
parentec9a7db7f0438bc8ad69bc436cb3b3ed16642af9 (diff)
i40e: (ptp) warn when PF_ID does not match in PRTTSYN_CTL0
Display a verbose warning message when the incorrect PF attempts to control timestamping for a port to which it was not assigned. This shouldn't display except in the case of multiple PFs per port. The primary intent of this message is to help debugging the reason why the SIOCSHWTSTAMP ioctl has failed, and to help narrow the cause of the issue. Change-ID: Ic98798e0c844d98389d4c20e7160ba256f2bc7e8 Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ptp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index 582704a642ae..bb7fe98b3a6c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -447,8 +447,12 @@ static int i40e_ptp_set_timestamp_mode(struct i40e_pf *pf,
447 /* Confirm that 1588 is supported on this PF. */ 447 /* Confirm that 1588 is supported on this PF. */
448 pf_id = (rd32(hw, I40E_PRTTSYN_CTL0) & I40E_PRTTSYN_CTL0_PF_ID_MASK) >> 448 pf_id = (rd32(hw, I40E_PRTTSYN_CTL0) & I40E_PRTTSYN_CTL0_PF_ID_MASK) >>
449 I40E_PRTTSYN_CTL0_PF_ID_SHIFT; 449 I40E_PRTTSYN_CTL0_PF_ID_SHIFT;
450 if (hw->pf_id != pf_id) 450 if (hw->pf_id != pf_id) {
451 return -EINVAL; 451 dev_err(&pf->pdev->dev,
452 "PF %d attempted to control timestamp mode on port %d, which is owned by PF %d\n",
453 hw->pf_id, hw->port, pf_id);
454 return -EPERM;
455 }
452 456
453 switch (config->tx_type) { 457 switch (config->tx_type) {
454 case HWTSTAMP_TX_OFF: 458 case HWTSTAMP_TX_OFF: