[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d0489a7b-9af9-4c6e-9397-c3a8062f2bfc@amd.com>
Date: Sat, 12 Jul 2025 15:52:08 +0530
From: "Rangoju, Raju" <raju.rangoju@....com>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>, netdev@...r.kernel.org
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, Shyam-sundar.S-k@....com
Subject: Re: [net-next] amd-xgbe: add hardware PTP timestamping support
On 7/8/2025 4:24 PM, Vadim Fedorenko wrote:
> On 07/07/2025 18:53, Raju Rangoju wrote:
>> @@ -1636,8 +1659,8 @@ static void xgbe_get_rx_tstamp(struct
>> xgbe_packet_data *packet,
>> if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_CONTEXT_DESC3, TSA) &&
>> !XGMAC_GET_BITS_LE(rdesc->desc3, RX_CONTEXT_DESC3, TSD)) {
>> nsec = le32_to_cpu(rdesc->desc1);
>> - nsec <<= 32;
>> - nsec |= le32_to_cpu(rdesc->desc0);
>> + nsec *= NSEC_PER_SEC;
>> + nsec += le32_to_cpu(rdesc->desc0);
>
> This change is not explained in the commit message. Looks like the
> HW timestamping has already been implemented, but in a wrong way?
Yes, the previous implementation was partial and not functional. This
patch adds support for full implementation.
>> + /* Calculate the addend:
>> + * addend = 2^32 / (PTP ref clock / (PTP clock based on SSINC))
>> + * = (2^32 * (PTP clock based on SSINC)) / PTP ref clock
>> + */
>> + if (pdata->vdata->tstamp_ptp_clock_freq)
>> + dividend = 100000000; // PTP clock frequency is 125MHz
>> + else
>> + dividend = 50000000; // PTP clock frequency is 50MHz
> why do you use 100_000_000 value for 125MHz while 50_000_000 for 50MHz?
> it doesn't look intuitive
>
That is due to the difference in the ideal clock frequency vs
actual clock freq running on the board. I'll address the comments in v2.
Powered by blists - more mailing lists