From: Kamil Alkhouri <kamil.alkhouri@hs-offenburg.de>
To: Kurt Kanzenbach <kurt@linutronix.de>,
Vladimir Oltean <olteanv@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
devicetree@vger.kernel.org,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Richard Cochran <richardcochran@gmail.com>,
ilias.apalodimas@linaro.org
Subject: Re: [PATCH net-next v6 4/7] net: dsa: hellcreek: Add support for hardware timestamping
Date: Thu, 08 Oct 2020 14:55:57 +0200 [thread overview]
Message-ID: <f040ba36070dd1e07b05cc63a392d8267ce4efe2.camel@hs-offenburg.de> (raw)
In-Reply-To: <87lfghhw9u.fsf@kurt>
Hello dears,
On Thu, 2020-10-08 at 12:01 +0200, Kurt Kanzenbach wrote:
> On Thu Oct 08 2020, Vladimir Oltean wrote:
> > On Thu, Oct 08, 2020 at 10:34:11AM +0200, Kurt Kanzenbach wrote:
> > > On Wed Oct 07 2020, Vladimir Oltean wrote:
> > > > On Wed, Oct 07, 2020 at 12:39:49PM +0200, Kurt Kanzenbach
> > > > wrote:
> > > > > For instance the hellcreek switch has actually three ptp
> > > > > hardware
> > > > > clocks and the time stamping can be configured to use either
> > > > > one of
> > > > > them.
> > > >
> > > > The sja1105 also has a corrected and an uncorrected PTP clock
> > > > that can
> > > > take timestamps. Initially I had thought I'd be going to spend
> > > > some time
> > > > figuring out multi-PHC support, but now I don't see any
> > > > practical reason
> > > > to use the uncorrected PHC for anything.
> > >
> > > Just out of curiosity: How do you implement 802.1AS then? My
> > > understanding is that the free-running clock has to be used for
> > > the
> >
> > Has to be? I couldn't find that wording in IEEE 802.1AS-2011.
>
> It doesn't has to be, it *should* be. That's at least the outcome we
> had
> after lots of discussions. Actually Kamil (on Cc) is the expert on
> this
> topic.
According to 802.1AS-2011 (10.1.1): "The LocalClock entity is a free-
running clock (see 3.3) that provides a common time to the time-aware
system, relative to an arbitrary epoch.", "... All timestamps are taken
relative to the LocalClock entity". The same statement holds true for
802.1AS-2020 (10.1.2.1).
> > > calculation of the peer delays and such meaning there should be a
> > > way to
> > > get access to both PHCs or having some form of cross timestamping
> > > available.
> > >
> > > The hellcreek switch can take cross snapshots of all three ptp
> > > clocks in
> > > hardware for that purpose.
> >
> > Well, at the end of the day, all the other TSN offloads (tc-taprio,
> > tc-gate) will still have to use the synchronized PTP clock, so what
> > we're doing is we're simply letting that clock be synchronized by
> > ptp4l.
>
> Yes, the synchronized clock is of course needed for the traffic
> scheduling and so on. This is what we do here in this code as well.
> Only
> the synchronized one is exported to user space and used. However, the
> multi PHCs issue should be addressed as well at some point.
>
> > > > > > So when you'll poll for TX timestamps, you'll receive a TX
> > > > > > timestamp from the PHY and another one from the switch, and
> > > > > > those will
> > > > > > be in a race with one another, so you won't know which one
> > > > > > is which.
> > > > >
> > > > > OK. So what happens if the driver will accept to disable
> > > > > hardware
> > > > > timestamping? Is there anything else that needs to be
> > > > > implemented? Are
> > > > > there (good) examples?
> > > >
> > > > It needs to not call skb_complete_tx_timestamp() and friends.
> > > >
> > > > For PHY timestamping, it also needs to invoke the correct
> > > > methods for RX
> > > > and for TX, where the PHY timestamping hooks will get called. I
> > > > don't
> > > > think that DSA is compatible yet with PHY timestamping, but it
> > > > is
> > > > probably a trivial modification.
> > >
> > > Hmm? If DSA doesn't support PHY timestamping how are other DSA
> > > drivers
> > > dealing with it then? I'm getting really confused.
> >
> > They aren't dealing with it, of course.
> >
> > > Furthermore, there is no hellcreek hardware available with
> > > timestamping
> > > capable PHYs. How am I supposed to even test this?
> > >
> > > For now, until there is hardware available, PHY timestamping is
> > > not
> > > supported with the hellcreek switch.
> >
> > I was just pointing out that this is something you'll certainly
> > have to
> > change if somebody will want PHY timestamping.
>
> Understood.
>
> > Even without hardware, you _could_ probably test that DSA is doing
> > the
> > right thing by simply adding the PTP timestamping ops to a PHY
> > driver
> > that you own, and inject dummy timestamps. The expectation becomes
> > that
> > user space gets those dummy timestamps, and not the ones emitted by
> > your
> > switch.
>
> Of course it can be mocked. Whenever somebody wants to do PHY
> timestamping with a hellcreek switch this issue can be re-visited.
>
> Thanks,
> Kurt
next prev parent reply other threads:[~2020-10-08 13:02 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-04 11:29 [PATCH net-next v6 0/7] Hirschmann Hellcreek DSA driver Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 1/7] net: dsa: Add tag handling for Hirschmann Hellcreek switches Kurt Kanzenbach
2020-10-04 11:56 ` Vladimir Oltean
2020-10-05 6:14 ` Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 2/7] net: dsa: Add DSA driver " Kurt Kanzenbach
2020-10-04 12:56 ` Vladimir Oltean
2020-10-06 6:09 ` Kurt Kanzenbach
2020-10-06 9:20 ` Vladimir Oltean
2020-10-06 10:13 ` Kurt Kanzenbach
2020-10-06 11:32 ` Vladimir Oltean
2020-10-06 12:37 ` Vladimir Oltean
2020-10-06 13:23 ` Kurt Kanzenbach
2020-10-06 13:42 ` Vladimir Oltean
2020-10-06 14:05 ` Kurt Kanzenbach
2020-10-06 14:10 ` Vladimir Oltean
2020-10-06 13:56 ` Vladimir Oltean
2020-10-06 14:13 ` Kurt Kanzenbach
2020-10-11 12:29 ` Kurt Kanzenbach
2020-10-11 15:30 ` Vladimir Oltean
2020-10-12 5:37 ` Kurt Kanzenbach
2020-10-16 12:11 ` Kurt Kanzenbach
2020-10-16 15:43 ` Vladimir Oltean
2020-10-16 16:56 ` Florian Fainelli
2020-10-17 10:06 ` Kurt Kanzenbach
2020-10-17 15:57 ` Vladimir Oltean
2020-10-08 11:49 ` Vladimir Oltean
2020-10-09 5:58 ` Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 3/7] net: dsa: hellcreek: Add PTP clock support Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 4/7] net: dsa: hellcreek: Add support for hardware timestamping Kurt Kanzenbach
2020-10-04 14:30 ` Vladimir Oltean
2020-10-06 6:27 ` Kurt Kanzenbach
2020-10-06 7:28 ` Vladimir Oltean
2020-10-06 13:30 ` Kurt Kanzenbach
2020-10-06 13:32 ` Vladimir Oltean
2020-10-06 13:56 ` Kurt Kanzenbach
2020-10-06 14:01 ` Vladimir Oltean
2020-10-07 10:39 ` Kurt Kanzenbach
2020-10-07 10:54 ` Vladimir Oltean
2020-10-08 8:34 ` Kurt Kanzenbach
2020-10-08 9:44 ` Vladimir Oltean
2020-10-08 10:01 ` Kurt Kanzenbach
2020-10-08 12:55 ` Kamil Alkhouri [this message]
2020-10-08 15:09 ` Vladimir Oltean
2020-10-12 12:53 ` Kamil Alkhouri
2020-10-12 21:42 ` Richard Cochran
2020-10-14 9:57 ` Vladimir Oltean
2020-10-14 11:01 ` Richard Cochran
2020-10-14 11:37 ` Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 5/7] net: dsa: hellcreek: Add PTP status LEDs Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 6/7] dt-bindings: Add vendor prefix for Hirschmann Kurt Kanzenbach
2020-10-04 11:29 ` [PATCH net-next v6 7/7] dt-bindings: net: dsa: Add documentation for Hellcreek switches Kurt Kanzenbach
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=f040ba36070dd1e07b05cc63a392d8267ce4efe2.camel@hs-offenburg.de \
--to=kamil.alkhouri@hs-offenburg.de \
--cc=andrew@lunn.ch \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=richardcochran@gmail.com \
--cc=robh+dt@kernel.org \
--cc=vivien.didelot@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;
as well as URLs for NNTP newsgroup(s).