From: Claudiu Manoil <claudiu.manoil@gmail.com>
To: Yangbo Lu <yangbo.lu@nxp.com>, netdev@vger.kernel.org
Cc: "David S . Miller" <davem@davemloft.net>,
Richard Cochran <richardcochran@gmail.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [net-next, v2, 7/7] enetc: support PTP domain timestamp conversion
Date: Sat, 22 May 2021 23:46:15 +0300 [thread overview]
Message-ID: <206a857a-625c-e604-9916-7f73f79d191c@gmail.com> (raw)
In-Reply-To: <20210521043619.44694-8-yangbo.lu@nxp.com>
hi Yangbo,
On 21.05.2021 07:36, Yangbo Lu wrote:
> Support timestamp conversion to specified PTP domain in PTP packet.
>
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
> Changes for v2:
> - Fixed build waring.
> - Updated copyright.
> ---
> drivers/net/ethernet/freescale/enetc/enetc.c | 39 ++++++++++++++++++--
> 1 file changed, 35 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index 3ca93adb9662..cd0429c73999 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
> @@ -1,5 +1,5 @@
> // SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
> -/* Copyright 2017-2019 NXP */
> +/* Copyright 2017-2021 NXP */
>
> #include "enetc.h"
> #include <linux/bpf_trace.h>
> @@ -7,6 +7,7 @@
> #include <linux/udp.h>
> #include <linux/vmalloc.h>
> #include <linux/ptp_classify.h>
> +#include <linux/ptp_clock_kernel.h>
> #include <net/pkt_sched.h>
>
> static int enetc_num_stack_tx_queues(struct enetc_ndev_priv *priv)
> @@ -472,13 +473,36 @@ static void enetc_get_tx_tstamp(struct enetc_hw *hw, union enetc_tx_bd *txbd,
> *tstamp = (u64)hi << 32 | tstamp_lo;
> }
>
> -static void enetc_tstamp_tx(struct sk_buff *skb, u64 tstamp)
> +static int enetc_ptp_parse_domain(struct sk_buff *skb, u8 *domain)
> +{
> + unsigned int ptp_class;
> + struct ptp_header *hdr;
> +
> + ptp_class = ptp_classify_raw(skb);
> + if (ptp_class == PTP_CLASS_NONE)
> + return -EINVAL;
> +
> + hdr = ptp_parse_header(skb, ptp_class);
> + if (!hdr)
> + return -EINVAL;
> +
> + *domain = hdr->domain_number;
> + return 0;
> +}
> +
Why is this function defined inside the enetc driver? I don't see
anything enetc specific to it, but it looks like another generic ptp
procedure, similar to ptp_parse_header() or ptp_clock_domain_tstamp().
next prev parent reply other threads:[~2021-05-22 20:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 4:36 [net-next, v2, 0/7] ptp: support virtual clocks for multiple Yangbo Lu
2021-05-21 4:36 ` [net-next, v2, 1/7] ptp: add ptp virtual clock driver framework Yangbo Lu
2021-05-23 21:24 ` Richard Cochran
2021-05-31 10:38 ` Y.b. Lu
2021-05-21 4:36 ` [net-next, v2, 2/7] ptp: support ptp physical/virtual clocks conversion Yangbo Lu
2021-05-25 11:33 ` Richard Cochran
2021-05-31 10:39 ` Y.b. Lu
2021-05-25 12:28 ` Richard Cochran
2021-05-31 10:40 ` Y.b. Lu
2021-05-21 4:36 ` [net-next, v2, 3/7] ptp: support domains and timestamp conversion Yangbo Lu
2021-05-21 4:36 ` [net-next, v2, 4/7] ptp_qoriq: export ptp clock reading function for cyclecounter Yangbo Lu
2021-05-21 4:36 ` [net-next, v2, 5/7] enetc_ptp: support ptp virtual clock Yangbo Lu
2021-05-21 4:36 ` [net-next, v2, 6/7] enetc: store ptp device pointer Yangbo Lu
2021-05-21 4:36 ` [net-next, v2, 7/7] enetc: support PTP domain timestamp conversion Yangbo Lu
2021-05-22 20:46 ` Claudiu Manoil [this message]
2021-05-25 12:37 ` Richard Cochran
2021-05-25 12:48 ` Richard Cochran
2021-05-31 11:26 ` Y.b. Lu
2021-05-31 13:49 ` Richard Cochran
2021-06-15 9:44 ` Y.b. Lu
2021-05-31 10:51 ` Y.b. Lu
2021-05-31 11:31 ` Y.b. Lu
2021-05-31 13:54 ` Richard Cochran
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=206a857a-625c-e604-9916-7f73f79d191c@gmail.com \
--to=claudiu.manoil@gmail.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=yangbo.lu@nxp.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).