Linux-Doc Archive on lore.kernel.org
 help / color / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
	richardcochran@gmail.com, sorganov@gmail.com,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] docs: networking: timestamping: add one more known issue
Date: Sat, 18 Jul 2020 14:36:37 +0300
Message-ID: <20200718113637.iszcawncnm4ujksc@skbuf> (raw)
In-Reply-To: <5af0fd85-9e09-e5a2-fc99-d72b8a31cc0d@intel.com>

On Fri, Jul 17, 2020 at 04:08:03PM -0700, Jacob Keller wrote:
> 
> 
> On 7/17/2020 9:10 AM, Vladimir Oltean wrote:
> > Document the fact that Ethernet PHY timestamping has a fundamentally
> > flawed corner case (which in fact hits the majority of networking
> > drivers): a PHY for which its host MAC driver doesn't forward the
> > phy_mii_ioctl for timestamping is still going to be presented to user
> > space as functional.
> > 
> > Fixing this inconsistency would require moving the phy_has_tsinfo()
> > check inside all MAC drivers which are capable of PHY timestamping, to
> > be in harmony with the existing design for phy_has_hwtstamp() checks.
> > Instead of doing that, document the preferable solution which is that
> > offending MAC drivers be fixed instead.
> 
> This statement feels weird. Aren't you documenting that the preferable
> solution is? I.e. "Document this preferable solution: Fix the offending
> MAC driver"
> 
> Or am I misunderstanding what the issue is here?
> 

You're right, it looks like I wasn't thinking in full sentences at that
particular time of day.

> > 
> > Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
> > ---
> >  Documentation/networking/timestamping.rst | 37 +++++++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> > 
> > diff --git a/Documentation/networking/timestamping.rst b/Documentation/networking/timestamping.rst
> > index 9a1f4cb4ce9e..4004c5d2771d 100644
> > --- a/Documentation/networking/timestamping.rst
> > +++ b/Documentation/networking/timestamping.rst
> > @@ -754,3 +754,40 @@ check in their "TX confirmation" portion, not only for
> >  that PTP timestamping is not enabled for anything other than the outermost PHC,
> >  this enhanced check will avoid delivering a duplicated TX timestamp to user
> >  space.
> > +
> > +Another known limitation is the design of the ``__ethtool_get_ts_info``
> > +function::
> > +
> > +  int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
> > +  {
> > +          const struct ethtool_ops *ops = dev->ethtool_ops;
> > +          struct phy_device *phydev = dev->phydev;
> > +
> > +          memset(info, 0, sizeof(*info));
> > +          info->cmd = ETHTOOL_GET_TS_INFO;
> > +
> > +          if (phy_has_tsinfo(phydev))
> > +                  return phy_ts_info(phydev, info);
> > +          if (ops->get_ts_info)
> > +                  return ops->get_ts_info(dev, info);
> > +
> > +          info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
> > +                                  SOF_TIMESTAMPING_SOFTWARE;
> > +          info->phc_index = -1;
> > +
> > +          return 0;
> > +  }
> > +
> > +Because the generic function searches first for the timestamping capabilities
> > +of the attached PHY, and returns them directly without consulting the MAC
> > +driver, no checking is being done whether the requirements described in `3.2.2
> > +Ethernet PHYs`_ are implemented or not. Therefore, if the MAC driver does not
> > +satisfy the requirements for PHY timestamping, and
> > +``CONFIG_NETWORK_PHY_TIMESTAMPING`` is enabled, then a non-functional PHC index
> > +(the one corresponding to the PHY) will be reported to user space, via
> > +``ethtool -T``.
> > +
> > +The correct solution to this problem is to implement the PHY timestamping
> > +requirements in the MAC driver found broken, and submit as a bug fix patch to
> > +netdev@vger.kernel.org. See :ref:`Documentation/process/stable-kernel-rules.rst
> > +<stable_kernel_rules>` for more details.
> > 

Thanks,
-Vladimir

  reply index

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 16:10 [PATCH net-next 0/3] Document more PTP timestamping known quirks Vladimir Oltean
2020-07-17 16:10 ` [PATCH net-next 1/3] docs: networking: timestamping: rename last section to "Known bugs" Vladimir Oltean
2020-07-17 22:05   ` Jacob Keller
2020-07-17 16:10 ` [PATCH net-next 2/3] docs: networking: timestamping: add one more known issue Vladimir Oltean
2020-07-17 23:08   ` Jacob Keller
2020-07-18 11:36     ` Vladimir Oltean [this message]
2020-07-17 16:10 ` [PATCH net-next 3/3] docs: networking: timestamping: add a set of frequently asked questions Vladimir Oltean
2020-07-17 23:12   ` Jacob Keller
2020-07-18 11:35     ` Vladimir Oltean
2020-07-20 18:54       ` Jacob Keller
2020-07-20 21:05         ` Vladimir Oltean
2020-07-20 21:45           ` Jacob Keller
2020-07-20 22:13             ` Vladimir Oltean
2020-07-21  0:21               ` Richard Cochran
2020-07-21 19:51                 ` Vladimir Oltean
2020-07-22  3:25                   ` Richard Cochran
2020-07-25 21:32                     ` Vladimir Oltean
2020-07-21 17:16               ` Jacob Keller
2020-07-21  0:15           ` Richard Cochran
2020-07-17 21:13 ` [PATCH net-next 0/3] Document more PTP timestamping known quirks Sergey Organov
2020-07-17 21:57   ` Vladimir Oltean
2020-07-17 23:13     ` Jacob Keller
2020-07-18 10:54     ` Sergey Organov
2020-07-18 11:30       ` Vladimir Oltean
2020-07-18 13:35         ` Sergey Organov
2020-07-18 11:21 ` Sergey Organov

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=20200718113637.iszcawncnm4ujksc@skbuf \
    --to=olteanv@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=sorganov@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

Linux-Doc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-doc/0 linux-doc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-doc linux-doc/ https://lore.kernel.org/linux-doc \
		linux-doc@vger.kernel.org
	public-inbox-index linux-doc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-doc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git