[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJmffrr=J_s9cFw5Q58rvZRWLpsrDnx3RkRXS3oLZDYY3BrNcw@mail.gmail.com>
Date: Mon, 1 Aug 2022 16:00:03 -0700
From: Ilya Evenbach <ievenbach@...ora.tech>
To: Alison Chaiken <achaiken@...ora.tech>, jacob.e.keller@...el.com,
Steve Payne <spayne@...ora.tech>, jesse.brandeburg@...el.com,
richardcochran@...il.com, netdev@...r.kernel.org,
intel-wired-lan@...ts.osuosl.org
Subject: Fwd: [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
> > -----Original Message-----
> > From: achaiken@...ora.tech <achaiken@...ora.tech>
> > Sent: Monday, August 01, 2022 6:38 AM
> > To: Brandeburg, Jesse <jesse.brandeburg@...el.com>;
> > richardcochran@...il.com
> > Cc: spayne@...ora.tech; achaiken@...ora.tech; alison@...-devel.com;
> > netdev@...r.kernel.org; intel-wired-lan@...ts.osuosl.org
> > Subject: [PATCH] Use ixgbe_ptp_reset on linkup/linkdown for X550
> >
> > From: Steve Payne <spayne@...ora.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@...ora.tech>
> > Signed-off-by: Alison Chaiken <achaiken@...ora.tech>
> >
>
> Resetting PTP could be a problem if the clock was not being synchronized with the kernel CLOCK_REALTIME,
That is true, but most likely not really important, as the unmitigated
problem also introduces significant discontinuities in time.
Basically, this patch does not make things worse.
>
> and does result in some loss of timer precision either way due to the delays involved with setting the time.
That precision loss is negligible compared to jumps resulting from
link down/up, and should be corrected by normal PTP operation very
quickly.
>
> Do you have an example of the clock jump? How much is it?
2021-02-12T09:24:37.741191+00:00 bench-12 phc2sys: [195230.451]
CLOCK_REALTIME phc offset 61 s2 freq -36503 delay 2298
2021-02-12T09:24:38.741315+00:00 bench-12 phc2sys: [195231.451]
CLOCK_REALTIME phc offset 169 s2 freq -36377 delay 2294
2021-02-12T09:24:39.741407+00:00 bench-12 phc2sys: [195232.451]
CLOCK_REALTIME phc offset 195213702387037 s2 freq +100000000 delay
2301
2021-02-12T09:24:40.741489+00:00 bench-12 phc2sys: [195233.452]
CLOCK_REALTIME phc offset 195213591220495 s2 freq +100000000 delay
2081
>
> How often is it? Every time?
Every time (though the specific amount differs, it is usually at
similar magnitude)
> More information would help in order to debug what is going wrong here.
>
> Thanks,
> Jake
>
> > ---
> > 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
>
Powered by blists - more mailing lists