netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	lkml <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: Design issue in DSA RX timestamping (Was "Re: [PATCH net-next 3/5] net: dsa: mv88e6xxx: Let taggers specify a can_timestamp function")
Date: Tue, 19 Nov 2019 06:03:22 -0800	[thread overview]
Message-ID: <20191119140322.GA7556@localhost> (raw)
In-Reply-To: <CA+h21hpvn-9MNUze3dc2UmVTpRHrv_Xrc_LdAzpzctCqzkE8OA@mail.gmail.com>

On Tue, Nov 19, 2019 at 01:35:14PM +0200, Vladimir Oltean wrote:
> - DSA doesn't let drivers to select which frames should be
> timestamped. It knows better.

It time stamps the event frames.
 
> - To be precise, it runs the PTP BPF classifier and filters only the
> SYNC (but not FOLLOW-UP) messages. In principle I agree, the FOLLOW-UP
> frames are general messages and don't need to be timestamped for the
> PTP protocol to work. But by that logic, the HWTSTAMP_FILTER_ALL
> rx_filter shouldn't exist?

FILTER_ALL means all event frames on all transports.  It has nothing
to do with event messages.

> - Because it treats SYNC and FOLLOW-UP frames differently on the RX
> path, it gives them a chance to get reordered. It doesn't give the
> driver a chance to avoid the reordering.

The re-ordering will occur no matter what.  Think about the UDP/IPv4
transport.  The event and general messages are on different ports!
The user space PTP must deal with message re-ordering.


> - Without fully understanding what happens, I tried to propose better
> logic for recovering reordered SYNC/FOLLOW-UP pairs at the application
> level in linuxptp [1]. Needless to say, the consensus was to fix the
> kernel. So here we are.
> 
> [1] https://sourceforge.net/p/linuxptp/mailman/linuxptp-devel/thread/20190928123414.9422-1-olteanv%40gmail.com/#msg36773629

There was no consensus to fix the kernel.  The kernel is fine.  Your
hardware is too slow to keep up with the very high message rate of the
telecom profiles.  Here are a few quotes from that discussion:

   ---
   Are you saying in a local network it's expected that a PTP slave
   receives the follow-up message one or more sync intervals after the
   corresponding sync message, e.g. a delay of 1 second with the default
   sync interval?
   
   I'd not consider such network to be suitable for PTP.
   ---
   I think it's expected that two messages sent within few microseconds or
   milliseconds can be received in a wrong order and PTP slaves need to
   handle that. But it's not expected that a message will be delayed so
   much that it will be received after a message that was sent one or
   more sync intervals later.
   ---
   I'd not expect to receive a follow-up message 30 milliseconds
   after the corresponding sync message. If the difference was getting to
   the millisecond range, I'd be worried that the network is so
   overloaded or misconfigured that it might drop some PTP messages.
   ---

Thanks,
Richard

  reply	other threads:[~2019-11-19 14:03 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-28 23:56 [PATCH net-next 0/5] PTP support for the SJA1105 DSA driver Vladimir Oltean
2019-05-28 23:56 ` [PATCH net-next 1/5] timecounter: Add helper for reconstructing partial timestamps Vladimir Oltean
2019-05-29  2:14   ` John Stultz
2019-05-29  4:40     ` Richard Cochran
2019-05-29 20:23     ` Vladimir Oltean
2019-05-28 23:56 ` [PATCH net-next 2/5] net: dsa: sja1105: Add support for the PTP clock Vladimir Oltean
2019-05-28 23:56 ` [PATCH net-next 3/5] net: dsa: mv88e6xxx: Let taggers specify a can_timestamp function Vladimir Oltean
2019-05-29  4:49   ` Richard Cochran
2019-05-29 20:33     ` Vladimir Oltean
2019-05-30  3:51       ` Richard Cochran
2019-05-30  7:42         ` Vladimir Oltean
2019-05-30 14:23           ` Richard Cochran
2019-05-30 14:40             ` Richard Cochran
2019-05-30 14:47             ` Vladimir Oltean
2019-05-30 15:01               ` Richard Cochran
2019-11-19 11:35   ` Design issue in DSA RX timestamping (Was "Re: [PATCH net-next 3/5] net: dsa: mv88e6xxx: Let taggers specify a can_timestamp function") Vladimir Oltean
2019-11-19 14:03     ` Richard Cochran [this message]
2019-05-28 23:56 ` [PATCH net-next 4/5] net: dsa: sja1105: Add support for PTP timestamping Vladimir Oltean
2019-05-28 23:56 ` [PATCH net-next 5/5] net: dsa: sja1105: Increase priority of CPU-trapped frames Vladimir Oltean
2019-05-29  4:52 ` [PATCH net-next 0/5] PTP support for the SJA1105 DSA driver Richard Cochran
2019-05-29 20:41   ` Vladimir Oltean
2019-05-30  3:45     ` Richard Cochran
2019-05-30  9:01       ` Vladimir Oltean
2019-05-30 14:30         ` Richard Cochran
2019-05-30 14:57           ` Vladimir Oltean
2019-05-30 15:05             ` Richard Cochran
2019-05-30 15:23               ` Vladimir Oltean
2019-05-31  4:34                 ` Richard Cochran
2019-05-31 13:23                   ` Vladimir Oltean
2019-05-31 14:08                     ` Richard Cochran
2019-05-31 14:27                       ` Vladimir Oltean
2019-05-31 15:11                         ` Richard Cochran
2019-05-31 15:21                           ` Richard Cochran
2019-05-31 15:23                           ` Vladimir Oltean
2019-05-31 16:09                             ` Richard Cochran
2019-05-31 16:16                               ` Vladimir Oltean
2019-05-31 18:12                                 ` Vladimir Oltean
2019-06-01  5:07                                   ` Richard Cochran
2019-06-01 10:31                                     ` Vladimir Oltean
2019-06-01 12:06                                       ` Vladimir Oltean
2019-06-02  2:18                                         ` Richard Cochran
2019-06-02  2:17                                       ` Richard Cochran
2019-06-01  5:03                                 ` 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=20191119140322.GA7556@localhost \
    --to=richardcochran@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --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).