netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: linuxptp-devel@lists.sourceforge.net, netdev@vger.kernel.org
Cc: Ben Hutchings <bhutchings@solarflare.com>
Subject: Re: [Linuxptp-devel] RFC [PATCH 2/3] PTP: use flags to request HW features
Date: Thu, 31 Oct 2013 08:12:58 +0100	[thread overview]
Message-ID: <20131031071256.GB5226@netboy> (raw)
In-Reply-To: <20131030214841.GZ13373@plex.lan>

On Wed, Oct 30, 2013 at 07:48:41PM -0200, Flavio Leitner wrote:
> On Wed, Oct 30, 2013 at 05:00:36PM -0200, Flavio Leitner wrote:
> > Currently the user space can't tell which delay mechanism
> > (E2E/P2P) or transport is needed in the ioctl(). Therefore,
> > PTP silently fails when the hardware doesn't support a
> > certain delay mechanism or transport.

[ For netdev readers, the text below repeats what I posted to the
  linuxptp-devel list. ]

SIOCSHWTSTAMP is bad enough already. Let's not make it even
uglier. ETHTOOL is a better place for this kind of thing. The
ethtool_ts_info has plenty of reserved fields, and drivers could
use them to advertise these capabilities without the risk of
breaking user space.

We already check each port's capabilities using the ethtool ioctl.
It makes perfect sense to have two calls. First, tell me what is
available, then, I'll tell you what I want. That is easy.

In contrast, the closed loop feedback of SIOCSHWTSTAMP is really
awful. The whole rx_filter field is designed around the inadequacies
of an early intel card, and the choices are obsolete and mostly
useless. There isn't even any mention of pdelay. Ptp4l is already
bad enough with the filter1, filter2 probing. Let's just leave that
ioctl alone.

On Wed, Oct 30, 2013 at 07:46:58PM -0200, Flavio Leitner wrote:
> What about the transport?

I suggest offering the following bits in the ethtool rx|tx_reserved
fields:

TS_SYNC        (1<<0) /* silly, PTP is not possible without this */
TS_DELAY_REQ   (1<<1)
TS_PDELAY_REQ  (1<<2)
TS_PDELAY_RESP (1<<3)

TS_ON_LAYER2   (1<<4)
TS_ON_IPV4     (1<<5)
TS_ON_IPV6     (1<<6)

> And feature combination?

My goal for linuxptp (and for the PHC subsystem) is to offer a kind of
reference implementation. I have no inclination to support every last
broken hardware out there. However, I agree that we should try to
support poorly designed cards if we can, but not at the price of
making ugly interfaces for the everyone.

Drivers with weird restrictions (for example, supports PDelay_Req but
only on IPv6) will have to just advertise one working combination.

The intel ixp465 is an example of design that we cannot ever support
in linuxptp. It can time stamp *either* the master role's events or
the slave role's events, but not both. Brilliant.

[ This chip is thankfully now obsolete, but the time stamping IP core
  found its way into the phc_gbe, but with the worst mistakes
  corrected. ]

Thanks,
Richard

  reply	other threads:[~2013-10-31  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1383159637-8165-1-git-send-email-fbl@redhat.com>
     [not found] ` <1383159637-8165-3-git-send-email-fbl@redhat.com>
2013-10-30 21:48   ` RFC [PATCH 2/3] PTP: use flags to request HW features Flavio Leitner
2013-10-31  7:12     ` Richard Cochran [this message]
2013-11-01  1:34       ` [Linuxptp-devel] " Flavio Leitner
     [not found] ` <1383159637-8165-4-git-send-email-fbl@redhat.com>
2013-10-30 21:50   ` [PATCH 3/3] e1000e: PTP: provide hardware features Flavio Leitner

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=20131031071256.GB5226@netboy \
    --to=richardcochran@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=linuxptp-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    /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).