netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Kory Maincent <kory.maincent@bootlin.com>
Cc: "Russell King (Oracle)" <linux@armlinux.org.uk>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Marek Behún" <kabel@kernel.org>,
	"Richard Cochran" <richardcochran@gmail.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net-next v2 0/2] Add Marvell PHY PTP support
Date: Wed, 9 Apr 2025 17:10:55 +0200	[thread overview]
Message-ID: <20250409171055.43e51012@fedora.home> (raw)
In-Reply-To: <20250409164920.5fbc3fd1@kmaincent-XPS-13-7390>

On Wed, 9 Apr 2025 16:49:20 +0200
Kory Maincent <kory.maincent@bootlin.com> wrote:

> On Wed, 9 Apr 2025 14:46:54 +0200
> Maxime Chevallier <maxime.chevallier@bootlin.com> wrote:
> 
> > On Wed, 9 Apr 2025 14:23:09 +0200
> > Kory Maincent <kory.maincent@bootlin.com> wrote:
> >   
> > > On Wed, 9 Apr 2025 10:29:52 +0100
> > > "Russell King (Oracle)" <linux@armlinux.org.uk> wrote:
> > >     
> > > > On Wed, Apr 09, 2025 at 10:46:37AM +0200, Kory Maincent wrote:      
> >  [...]    
> > >     
> >  [...]  
> >  [...]    
> > > > 
> > > > How do I know that from the output? Nothing in the output appears to
> > > > tells me which PTP implementation will be used.
> > > > 
> > > > Maybe you have some understanding that makes this obvious that I don't
> > > > have.      
> > > 
> > > You are right there is no report of the PTP source device info in ethtool.
> > > With all the design change of the PTP series this has not made through my
> > > brain that we lost this information along the way.
> > > 
> > > You can still know the source like that but that's not the best.
> > > # ls -l /sys/class/ptp
> > > 
> > > It will be easy to add the source name support in netlink but which names
> > > are better report to the user?
> > > - dev_name of the netdev->dev and phydev->mdio.dev?
> > >   Maybe not the best naming for the phy PTP source
> > >   (ff0d0000.ethernet-ffffffff:01)
> > > - "PHY" + the PHY ID and "MAC" string?    
> > 
> > How about an enum instead of a string indicating the device type, and if
> > PHY, the phy_index ? (phy ID has another meaning :) )  
> 
> This will raise the same question I faced during the ptp series mainline
> process. In Linux, the PTP is managed through netdev or phylib API.
> In case of a NIC all is managed through netdev. So if a NIC has a PTP at the PHY
> layer how should we report that? As MAC PTP because it goes thought netdev, as
> PHY PTP but without phyindex?

Are you referring to the case where the PHY is transparently handled by
the MAC driver (i.e. controlled through a firmware of some sort) ?

In such case, how do you even know that timestamping is done in a PHY,
as the kernel doesn't know the PHY even exists ? The
HWTSTAMP_SOURCE_XXX enum either says it's from PHYLIB or NETDEV. As
PHYs handled by firmwares don't go through phylib, I'd say reporting
"PHY with no index" won't be accurate.

In such case I'd probably expect the NIC driver to register several
hwtstamp_provider with different qualifiers

> That's why maybe using netlink string could assure we won't have UAPI breakage
> in the future due to weird cases.
> What do you think?

Well I'd say this is the same for enums, nothing prevents you from
adding more values to your enum ?

Maxime

  reply	other threads:[~2025-04-09 15:11 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 14:02 [PATCH net-next v2 0/2] Add Marvell PHY PTP support Kory Maincent
2025-04-07 14:03 ` [PATCH net-next v2 1/2] net: phy: Move Marvell PHY drivers to its own subdirectory Kory Maincent
2025-04-07 14:03 ` [PATCH net-next v2 2/2] net: phy: Add Marvell PHY PTP support Kory Maincent
2025-04-07 14:15   ` Kory Maincent
2025-04-08 15:49   ` Simon Horman
2025-04-08 17:32     ` Russell King (Oracle)
2025-04-09  8:18       ` Kory Maincent
2025-04-09  8:33         ` Russell King (Oracle)
2025-04-09  8:48           ` Kory Maincent
2025-04-09 12:16             ` Russell King (Oracle)
2025-04-09 12:38               ` Kory Maincent
2025-04-09 13:35                 ` Russell King (Oracle)
2025-04-09 16:04                   ` Kory Maincent
2025-04-09 17:34                     ` Russell King (Oracle)
2025-04-09 22:38                       ` Russell King (Oracle)
2025-04-10  4:16                         ` Richard Cochran
2025-04-10  7:44                           ` Russell King (Oracle)
2025-04-21 11:20                             ` Richard Cochran
2025-04-10  9:17                         ` Kory Maincent
2025-04-10 15:41                           ` Russell King (Oracle)
2025-04-10 16:02                             ` Kory Maincent
2025-04-10 18:16                               ` Russell King (Oracle)
2025-04-10 19:40                                 ` Russell King (Oracle)
2025-04-11  8:01                                   ` Kory Maincent
2025-04-11  8:25                                     ` Russell King (Oracle)
2025-04-09  8:07     ` Kory Maincent
2025-04-11 15:53       ` Simon Horman
2025-04-09 15:34   ` Russell King (Oracle)
2025-04-09 16:01     ` Kory Maincent
2025-04-07 14:08 ` [PATCH net-next v2 0/2] " Andrew Lunn
2025-04-07 14:31   ` Kory Maincent
2025-04-07 16:02 ` Russell King (Oracle)
2025-04-07 16:20   ` Kory Maincent
2025-04-07 16:32     ` Russell King (Oracle)
2025-04-07 16:39       ` Kory Maincent
2025-04-08 20:38         ` Russell King (Oracle)
2025-04-09  8:31           ` Kory Maincent
2025-04-09  8:35             ` Russell King (Oracle)
2025-04-09  8:38               ` Vladimir Oltean
2025-04-09  8:48                 ` Kory Maincent
2025-04-09  9:28                 ` Russell King (Oracle)
2025-04-09  8:46               ` Kory Maincent
2025-04-09  9:29                 ` Russell King (Oracle)
2025-04-09 12:23                   ` Kory Maincent
2025-04-09 12:46                     ` Maxime Chevallier
2025-04-09 14:49                       ` Kory Maincent
2025-04-09 15:10                         ` Maxime Chevallier [this message]
2025-04-09 15:14                           ` Kory Maincent

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=20250409171055.43e51012@fedora.home \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vladimir.oltean@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).