diff options
author | Edward Cree <ecree@solarflare.com> | 2017-12-18 11:56:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-18 13:07:49 -0500 |
commit | acaef3c15612d7b0f5a4835f57e87a290e054839 (patch) | |
tree | 8e77c76345d2078676adae185f6c99fa9e0f0686 | |
parent | aae5a31663fe2683a6ec1bce00b1f8ac9c7fb249 (diff) |
sfc: improve PTP error reporting
Log a message if PTP probing fails; if we then, unexpectedly, get PTP
events, only log a message for the first one on each device.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/sfc/ef10.c | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/net_driver.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/ptp.c | 4 |
3 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index dcd6be14a430..009bf28bdba5 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -747,7 +747,14 @@ static int efx_ef10_probe(struct efx_nic *efx) | |||
747 | if (rc && rc != -EPERM) | 747 | if (rc && rc != -EPERM) |
748 | goto fail5; | 748 | goto fail5; |
749 | 749 | ||
750 | efx_ptp_probe(efx, NULL); | 750 | rc = efx_ptp_probe(efx, NULL); |
751 | /* Failure to probe PTP is not fatal. | ||
752 | * In the case of EPERM, efx_ptp_probe will print its own message (in | ||
753 | * efx_ptp_get_attributes()), so we don't need to. | ||
754 | */ | ||
755 | if (rc && rc != -EPERM) | ||
756 | netif_warn(efx, drv, efx->net_dev, | ||
757 | "Failed to probe PTP, rc=%d\n", rc); | ||
751 | 758 | ||
752 | #ifdef CONFIG_SFC_SRIOV | 759 | #ifdef CONFIG_SFC_SRIOV |
753 | if ((efx->pci_dev->physfn) && (!efx->pci_dev->is_physfn)) { | 760 | if ((efx->pci_dev->physfn) && (!efx->pci_dev->is_physfn)) { |
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 2e41f2c39c4a..6b8730a24513 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h | |||
@@ -813,6 +813,7 @@ struct vfdi_status; | |||
813 | * @vf_init_count: Number of VFs that have been fully initialised. | 813 | * @vf_init_count: Number of VFs that have been fully initialised. |
814 | * @vi_scale: log2 number of vnics per VF. | 814 | * @vi_scale: log2 number of vnics per VF. |
815 | * @ptp_data: PTP state data | 815 | * @ptp_data: PTP state data |
816 | * @ptp_warned: has this NIC seen and warned about unexpected PTP events? | ||
816 | * @vpd_sn: Serial number read from VPD | 817 | * @vpd_sn: Serial number read from VPD |
817 | * @monitor_work: Hardware monitor workitem | 818 | * @monitor_work: Hardware monitor workitem |
818 | * @biu_lock: BIU (bus interface unit) lock | 819 | * @biu_lock: BIU (bus interface unit) lock |
@@ -968,6 +969,7 @@ struct efx_nic { | |||
968 | #endif | 969 | #endif |
969 | 970 | ||
970 | struct efx_ptp_data *ptp_data; | 971 | struct efx_ptp_data *ptp_data; |
972 | bool ptp_warned; | ||
971 | 973 | ||
972 | char *vpd_sn; | 974 | char *vpd_sn; |
973 | 975 | ||
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c index caa89bf7603e..3b37d7ded3c4 100644 --- a/drivers/net/ethernet/sfc/ptp.c +++ b/drivers/net/ethernet/sfc/ptp.c | |||
@@ -1662,9 +1662,11 @@ void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev) | |||
1662 | int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE); | 1662 | int code = EFX_QWORD_FIELD(*ev, MCDI_EVENT_CODE); |
1663 | 1663 | ||
1664 | if (!ptp) { | 1664 | if (!ptp) { |
1665 | if (net_ratelimit()) | 1665 | if (!efx->ptp_warned) { |
1666 | netif_warn(efx, drv, efx->net_dev, | 1666 | netif_warn(efx, drv, efx->net_dev, |
1667 | "Received PTP event but PTP not set up\n"); | 1667 | "Received PTP event but PTP not set up\n"); |
1668 | efx->ptp_warned = true; | ||
1669 | } | ||
1668 | return; | 1670 | return; |
1669 | } | 1671 | } |
1670 | 1672 | ||