From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Cc: <anthony.l.nguyen@intel.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<richardcochran@gmail.com>,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<intel-wired-lan@lists.osuosl.org>
Subject: Re: [Intel-wired-lan] [PATCH net-next v2 1/2] ptp: add control over HW timestamp latch point
Date: Tue, 29 Oct 2024 09:24:39 +0100 [thread overview]
Message-ID: <9b7ccd9e-fca3-4a72-806f-3e99ab5ae4bd@intel.com> (raw)
In-Reply-To: <20241028204755.1514189-2-arkadiusz.kubalewski@intel.com>
On 10/28/24 21:47, Arkadiusz Kubalewski wrote:
> Currently HW support of PTP/timesync solutions in network PHY chips can be
> implemented with two different approaches, the timestamp maybe latched
> either at the beginning or after the Start of Frame Delimiter (SFD) [1].
>
> Allow ptp device drivers to provide user with control over the HW
> timestamp latch point with ptp sysfs ABI. Provide a new file under sysfs
> ptp device (/sys/class/ptp/ptp<N>/ts_point). The file is available for the
> user, if the device driver implements at least one of newly provided
> callbacks. If the file is not provided the user shall find a PHY timestamp
> latch point within the HW vendor specification.
>
> The file is designed for root user/group access only, as the read for
> regular user could impact performance of the ptp device.
>
> Usage, examples:
>
> ** Obtain current state:
> $ cat /sys/class/ptp/ptp<N>/ts_point
> Command returns enum/integer:
> * 0 - timestamp latched by PHY at the beginning of SFD,
> * 1 - timestamp latched by PHY after the SFD,
> * None - callback returns error to the user.
>
> ** Configure timestamp latch point at the beginning of SFD:
> $ echo 0 > /sys/class/ptp/ptp<N>/ts_point
>
> ** Configure timestamp latch point after the SFD:
> $ echo 1 > /sys/class/ptp/ptp<N>/ts_point
>
> [1] https://www.ieee802.org/3/cx/public/april20/tse_3cx_01_0420.pdf
>
> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
[...]
> diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h
> index c892d22ce0a7..ea1bcca7f7f6 100644
> --- a/include/linux/ptp_clock_kernel.h
> +++ b/include/linux/ptp_clock_kernel.h
> @@ -55,6 +55,24 @@ struct ptp_system_timestamp {
> clockid_t clockid;
> };
>
> +/**
> + * enum ptp_ts_point - possible timestamp latch points (IEEE 802.3cx)
> + *
> + * @PTP_TS_POINT_SFD: timestamp latched at the beginning of sending Start
> + * of Frame Delimiter (SFD)
> + * @PTP_TS_POINT_POST_SFD: timestamp latched after the end of sending Start
> + * of Frame Delimiter (SFD)
> + */
> +enum ptp_ts_point {
> + PTP_TS_POINT_SFD,
> + PTP_TS_POINT_POST_SFD,
> +
> + /* private: */
> + __PTP_TS_POINT_MAX
> +};
> +
> +#define PTP_TS_POINT_MAX (__PTP_TS_POINT_MAX - 1)
I would move PTP_TS_POINT_MAX into the enum
next prev parent reply other threads:[~2024-10-29 8:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 20:47 [Intel-wired-lan] [PATCH net-next v2 0/2] ptp: add control over HW timestamp latch point Arkadiusz Kubalewski
2024-10-28 20:47 ` [Intel-wired-lan] [PATCH net-next v2 1/2] " Arkadiusz Kubalewski
2024-10-29 8:24 ` Przemek Kitszel [this message]
2024-11-06 1:15 ` Kubalewski, Arkadiusz
2024-10-28 20:47 ` [Intel-wired-lan] [PATCH net-next v2 2/2] ice: " Arkadiusz Kubalewski
2024-10-29 8:21 ` Przemek Kitszel
2024-11-06 1:17 ` Kubalewski, Arkadiusz
2024-10-29 11:30 ` [Intel-wired-lan] [PATCH net-next v2 0/2] " Vadim Fedorenko
2024-10-29 15:56 ` Kubalewski, Arkadiusz
2024-10-29 16:17 ` Vadim Fedorenko
2024-11-06 1:15 ` Kubalewski, Arkadiusz
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=9b7ccd9e-fca3-4a72-806f-3e99ab5ae4bd@intel.com \
--to=przemyslaw.kitszel@intel.com \
--cc=aleksandr.loktionov@intel.com \
--cc=anthony.l.nguyen@intel.com \
--cc=arkadiusz.kubalewski@intel.com \
--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=netdev@vger.kernel.org \
--cc=pabeni@redhat.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