From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: "Markus Blöchl" <markus@blochl.de>,
"Przemek Kitszel" <przemyslaw.kitszel@intel.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>
Cc: "Richard Cochran" <richardcochran@gmail.com>,
"Markus Blöchl" <markus.bloechl@ipetronik.com>,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i40e: fix ptp time increment while link is down
Date: Tue, 25 Nov 2025 14:48:20 -0800 [thread overview]
Message-ID: <5b824df7-205e-4356-a33b-9937a1367517@intel.com> (raw)
In-Reply-To: <20251119-i40e_ptp_link_down-v1-1-b351fed254b3@blochl.de>
On 11/19/2025 8:09 AM, Markus Blöchl wrote:
> When an X710 ethernet port with an active ptp daemon (like the ptp4l and phc2sys combo)
> suddenly loses its link and regains it after a while, the ptp daemon has a hard time
> to recover synchronization and sometimes entirely fails to do so.
>
> The issue seems to be related to a wrongly configured increment while the link is down.
> This could not be observed with the Intel reference driver. We identified the fix to appear in
> Intels official ethernet-linux-i40e release version 2.17.4.
>
> Include the relevant changes in the kernel version of this driver.
>
> Fixes: beb0dff1251d ("i40e: enable PTP")
> Cc: stable@vger.kernel.org
> Signed-off-by: Markus Blöchl <markus@blochl.de>
> ---
...
> --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> @@ -847,6 +847,65 @@ void i40e_ptp_rx_hwtstamp(struct i40e_pf *pf, struct sk_buff *skb, u8 index)
> i40e_ptp_convert_to_hwtstamp(skb_hwtstamps(skb), ns);
> }
>
> +/**
> + * i40e_ptp_get_link_speed_hw - get the link speed
> + * @pf: Board private structure
> + *
> + * Calculate link speed depending on the link status.
> + * Return the link speed.
Can you make this 'Return:' to conform with kdoc expectations?
> + **/
> +static enum i40e_aq_link_speed i40e_ptp_get_link_speed_hw(struct i40e_pf *pf)
> +{
> + bool link_up = pf->hw.phy.link_info.link_info & I40E_AQ_LINK_UP;
> + enum i40e_aq_link_speed link_speed = I40E_LINK_SPEED_UNKNOWN;
> + struct i40e_hw *hw = &pf->hw;
> +
> + if (link_up) {
> + struct i40e_link_status *hw_link_info = &hw->phy.link_info;
> +
> + i40e_aq_get_link_info(hw, true, NULL, NULL);
> + link_speed = hw_link_info->link_speed;
> + } else {
> + enum i40e_prt_mac_link_speed prtmac_linksta;
> + u64 prtmac_pcs_linksta;
> +
> + prtmac_linksta = (rd32(hw, I40E_PRTMAC_LINKSTA(0))
> + & I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_MASK)
> + >> I40E_PRTMAC_LINKSTA_MAC_LINK_SPEED_SHIFT;
I believe operators are supposed to end the line rather than start a new
one.
> + if (prtmac_linksta == I40E_PRT_MAC_LINK_SPEED_40GB) {
> + link_speed = I40E_LINK_SPEED_40GB;
> + } else {
> + i40e_aq_debug_read_register(hw,
> + I40E_PRTMAC_PCS_LINK_STATUS1(0),
> + &prtmac_pcs_linksta,
> + NULL);
> +
> + prtmac_pcs_linksta = (prtmac_pcs_linksta
> + & I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_MASK)
> + >> I40E_PRTMAC_PCS_LINK_STATUS1_LINK_SPEED_SHIFT;
Same operator comment. Also, indentation looks off here.
Thanks,
Tony
next prev parent reply other threads:[~2025-11-25 22:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-19 16:09 Markus Blöchl
2025-11-24 21:57 ` [Intel-wired-lan] " Jacob Keller
2025-11-25 22:48 ` Tony Nguyen [this message]
2025-11-30 14:28 ` Markus Blöchl
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=5b824df7-205e-4356-a33b-9937a1367517@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.bloechl@ipetronik.com \
--cc=markus@blochl.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=richardcochran@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®