From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: "Olech, Milena" <milena.olech@intel.com>,
"intel-wired-lan@lists.osuosl.org"
<intel-wired-lan@lists.osuosl.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
"Kitszel, Przemyslaw" <przemyslaw.kitszel@intel.com>,
"Hay, Joshua A" <joshua.a.hay@intel.com>,
"Lobakin, Aleksander" <aleksander.lobakin@intel.com>
Subject: Re: [PATCH iwl-net 08/10] idpf: add Tx timestamp flows
Date: Mon, 18 Nov 2024 09:24:18 -0800 [thread overview]
Message-ID: <82643a3a-e71d-4fb9-a65f-43e6af195112@linux.dev> (raw)
In-Reply-To: <PH7PR11MB5885BBAC43E3D85550852C278E272@PH7PR11MB5885.namprd11.prod.outlook.com>
On 18/11/2024 07:07, Olech, Milena wrote:
> On 11/14/2024 1:52 PM, Vadim Fedorenko wrote:
>
>> On 13/11/2024 15:46, Milena Olech wrote:
>>> Add functions to request Tx timestamp for the PTP packets, read the Tx
>>> timestamp when the completion tag for that packet is being received,
>>> extend the Tx timestamp value and set the supported timestamping modes.
>>>
>>> Tx timestamp is requested for the PTP packets by setting a TSYN bit and
>>> index value in the Tx context descriptor. The driver assumption is that
>>> the Tx timestamp value is ready to be read when the completion tag is
>>> received. Then the driver schedules delayed work and the Tx timestamp
>>> value read is requested through virtchnl message. At the end, the Tx
>>> timestamp value is extended to 64-bit and provided back to the skb.
>>>
>>> Co-developed-by: Josh Hay <joshua.a.hay@intel.com>
>>> Signed-off-by: Josh Hay <joshua.a.hay@intel.com>
>>> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
>>> Signed-off-by: Milena Olech <milena.olech@intel.com>
[skipped]
>>> +/**
>>> + * idpf_ptp_extend_ts - Convert a 40b timestamp to 64b nanoseconds
>>> + * @adapter: Driver specific private structure
>>> + * @in_tstamp: Ingress/egress timestamp value
>>> + *
>>> + * It is assumed that the caller verifies the timestamp is valid prior to
>>> + * calling this function.
>>> + *
>>> + * Extract the 32bit nominal nanoseconds and extend them. Use the cached PHC
>>> + * time stored in the device private PTP structure as the basis for timestamp
>>> + * extension.
>>> + *
>>> + * Return: Tx timestamp value extended to 64 bits.
>>> + */
>>> +u64 idpf_ptp_extend_ts(const struct idpf_adapter *adapter, u64 in_tstamp)
>>> +{
>>> + unsigned long discard_time;
>>> +
>>> + discard_time = adapter->ptp->cached_phc_jiffies + 2 * HZ;
>>> +
>>> + if (time_is_before_jiffies(discard_time))
>>> + return 0;
>>
>> It might be a good idea to count such events, just to provide at least
>> some information to the client regarding zero timestamp?
>
> You mean to calculate skipped Tx timestamps?
Yes, we have special metric in ethtool to provide info about issues with
TX timestamp, it would be great to have idpf implemented this interface.
>
>>
>>> +
>>> + return idpf_ptp_tstamp_extend_32b_to_64b(adapter->ptp->cached_phc_time,
>>> + lower_32_bits(in_tstamp));
>>> +}
>>
>>
>> [... skip ...]
>
> Thanks,
> Milena
next prev parent reply other threads:[~2024-11-18 17:24 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 15:46 [PATCH iwl-net 00/10] initial PTP support Milena Olech
2024-11-13 15:46 ` [PATCH iwl-net 01/10] idpf: " Milena Olech
2024-11-14 11:01 ` Vadim Fedorenko
2024-11-14 17:27 ` Willem de Bruijn
2024-11-15 12:38 ` Simon Horman
2024-11-15 13:43 ` [Intel-wired-lan] " Paul Menzel
2024-11-15 16:07 ` Olech, Milena
2024-11-13 15:46 ` [PATCH iwl-net 02/10] virtchnl: add PTP virtchnl definitions Milena Olech
2024-11-14 17:28 ` Willem de Bruijn
2024-11-18 12:57 ` [Intel-wired-lan] " Olech, Milena
2024-11-15 12:42 ` Simon Horman
2024-11-13 15:46 ` [PATCH iwl-net 03/10] idpf: move virtchnl structures to the header file Milena Olech
2024-11-14 20:02 ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 04/10] idpf: negotiate PTP capabilies and get PTP clock Milena Olech
2024-11-14 12:17 ` Vadim Fedorenko
2024-11-14 20:57 ` Willem de Bruijn
2024-11-15 16:34 ` [Intel-wired-lan] " Olech, Milena
2024-11-14 20:20 ` Willem de Bruijn
2024-11-18 14:36 ` [Intel-wired-lan] " Olech, Milena
2024-11-18 15:21 ` Willem de Bruijn
2024-11-14 23:26 ` Willem de Bruijn
2024-11-15 12:51 ` Simon Horman
2024-11-13 15:46 ` [PATCH iwl-net 05/10] idpf: add mailbox access to read PTP clock time Milena Olech
2024-11-14 20:22 ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 06/10] idpf: add PTP clock configuration Milena Olech
2024-11-14 20:27 ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 07/10] idpf: add Tx timestamp capabilities negotiation Milena Olech
2024-11-14 20:49 ` Willem de Bruijn
2024-11-15 12:45 ` Simon Horman
2024-11-15 13:45 ` Simon Horman
2024-11-13 15:46 ` [PATCH iwl-net 08/10] idpf: add Tx timestamp flows Milena Olech
2024-11-14 12:52 ` Vadim Fedorenko
2024-11-18 15:07 ` Olech, Milena
2024-11-18 17:24 ` Vadim Fedorenko [this message]
2024-11-14 23:20 ` Willem de Bruijn
2024-11-18 15:18 ` [Intel-wired-lan] " Olech, Milena
2024-11-18 15:52 ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 09/10] idpf: add support for Rx timestamping Milena Olech
2024-11-14 20:53 ` Willem de Bruijn
2024-11-18 15:31 ` Olech, Milena
2024-11-18 15:53 ` Willem de Bruijn
2024-11-13 15:46 ` [PATCH iwl-net 10/10] idpf: change the method for mailbox workqueue allocation Milena Olech
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=82643a3a-e71d-4fb9-a65f-43e6af195112@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=aleksander.lobakin@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=joshua.a.hay@intel.com \
--cc=milena.olech@intel.com \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.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;
as well as URLs for NNTP newsgroup(s).