All of lore.kernel.org
 help / color / mirror / Atom feed
From: achaiken@aurora.tech
To: jesse.brandeburg@intel.com, richardcochran@gmail.com
Cc: spayne@aurora.tech, netdev@vger.kernel.org, achaiken@aurora.tech,
	intel-wired-lan@lists.osuosl.org, alison@she-devel.com
Subject: [Intel-wired-lan] [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
Date: Mon,  1 Aug 2022 06:37:50 -0700	[thread overview]
Message-ID: <20220801133750.7312-1-achaiken@aurora.tech> (raw)

From: Steve Payne <spayne@aurora.tech>

For an unknown reason, when `ixgbe_ptp_start_cyclecounter` is called
from `ixgbe_watchdog_link_is_down` the PHC on the NIC jumps backward
by a seemingly inconsistent amount, which causes discontinuities in
time synchronization. Explicitly reset the NIC's PHC to
`CLOCK_REALTIME` whenever the NIC goes up or down by calling
`ixgbe_ptp_reset` instead of the bare `ixgbe_ptp_start_cyclecounter`.

Signed-off-by: Steve Payne <spayne@aurora.tech>
Signed-off-by: Alison Chaiken <achaiken@aurora.tech>

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 750b02bb2fdc2..ab1ec076fa75f 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7462,7 +7462,7 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
 	adapter->last_rx_ptp_check = jiffies;
 
 	if (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))
-		ixgbe_ptp_start_cyclecounter(adapter);
+		ixgbe_ptp_reset(adapter);
 
 	switch (link_speed) {
 	case IXGBE_LINK_SPEED_10GB_FULL:
@@ -7527,7 +7527,7 @@ static void ixgbe_watchdog_link_is_down(struct ixgbe_adapter *adapter)
 		adapter->flags2 |= IXGBE_FLAG2_SEARCH_FOR_SFP;
 
 	if (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))
-		ixgbe_ptp_start_cyclecounter(adapter);
+		ixgbe_ptp_reset(adapter);
 
 	e_info(drv, "NIC Link is Down\n");
 	netif_carrier_off(netdev);
-- 
2.32.0

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

WARNING: multiple messages have this Message-ID (diff)
From: achaiken@aurora.tech
To: jesse.brandeburg@intel.com, richardcochran@gmail.com
Cc: spayne@aurora.tech, achaiken@aurora.tech, alison@she-devel.com,
	netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org
Subject: [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
Date: Mon,  1 Aug 2022 06:37:50 -0700	[thread overview]
Message-ID: <20220801133750.7312-1-achaiken@aurora.tech> (raw)

From: Steve Payne <spayne@aurora.tech>

For an unknown reason, when `ixgbe_ptp_start_cyclecounter` is called
from `ixgbe_watchdog_link_is_down` the PHC on the NIC jumps backward
by a seemingly inconsistent amount, which causes discontinuities in
time synchronization. Explicitly reset the NIC's PHC to
`CLOCK_REALTIME` whenever the NIC goes up or down by calling
`ixgbe_ptp_reset` instead of the bare `ixgbe_ptp_start_cyclecounter`.

Signed-off-by: Steve Payne <spayne@aurora.tech>
Signed-off-by: Alison Chaiken <achaiken@aurora.tech>

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 750b02bb2fdc2..ab1ec076fa75f 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -7462,7 +7462,7 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
 	adapter->last_rx_ptp_check = jiffies;
 
 	if (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))
-		ixgbe_ptp_start_cyclecounter(adapter);
+		ixgbe_ptp_reset(adapter);
 
 	switch (link_speed) {
 	case IXGBE_LINK_SPEED_10GB_FULL:
@@ -7527,7 +7527,7 @@ static void ixgbe_watchdog_link_is_down(struct ixgbe_adapter *adapter)
 		adapter->flags2 |= IXGBE_FLAG2_SEARCH_FOR_SFP;
 
 	if (test_bit(__IXGBE_PTP_RUNNING, &adapter->state))
-		ixgbe_ptp_start_cyclecounter(adapter);
+		ixgbe_ptp_reset(adapter);
 
 	e_info(drv, "NIC Link is Down\n");
 	netif_carrier_off(netdev);
-- 
2.32.0


             reply	other threads:[~2022-08-01 20:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 13:37 achaiken [this message]
2022-08-01 13:37 ` [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550 achaiken
2022-08-01 21:34 ` [Intel-wired-lan] " Keller, Jacob E
2022-08-01 21:34   ` Keller, Jacob E
     [not found]   ` <CAFzL-7tX845o2kJmE4o8EhbeD-=vkR6rmaiz_ZEWfSD4W+iWEA@mail.gmail.com>
2022-08-01 22:53     ` [Intel-wired-lan] " Ilya Evenbach
2022-08-01 23:00       ` [Intel-wired-lan] Fwd: " Ilya Evenbach
2022-08-01 23:00         ` Ilya Evenbach
2022-08-01 23:29         ` [Intel-wired-lan] " Jacob Keller
2022-08-01 23:29           ` Jacob Keller
2022-08-02  0:24           ` [Intel-wired-lan] " Alison Chaiken
2022-08-02  0:24             ` Alison Chaiken
2022-08-02  0:38             ` [Intel-wired-lan] " Jacob Keller
2022-08-02  0:38               ` Jacob Keller
2022-08-02  0:26           ` [Intel-wired-lan] " Jacob Keller
2022-08-02  0:26             ` Jacob Keller
2022-10-04 18:14             ` [Intel-wired-lan] " Alison Chaiken
2022-10-04 18:14               ` Alison Chaiken
2022-10-04 21:08               ` [Intel-wired-lan] " Jacob Keller
2022-10-04 21:08                 ` Jacob Keller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220801133750.7312-1-achaiken@aurora.tech \
    --to=achaiken@aurora.tech \
    --cc=alison@she-devel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=spayne@aurora.tech \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.