netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: "Köry Maincent" <kory.maincent@bootlin.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org, glipus@gmail.com,
	maxime.chevallier@bootlin.com, vadim.fedorenko@linux.dev,
	richardcochran@gmail.com, gerhard@engleder-embedded.com,
	thomas.petazzoni@bootlin.com, krzysztof.kozlowski+dt@linaro.org,
	robh+dt@kernel.org, linux@armlinux.org.uk
Subject: Re: [PATCH net-next RFC v4 4/5] net: Let the active time stamping layer be selectable.
Date: Thu, 11 May 2023 16:48:07 +0300	[thread overview]
Message-ID: <20230511134807.v4u3ofn6jvgphqco@skbuf> (raw)
In-Reply-To: <20230502130525.02ade4a8@kmaincent-XPS-13-7390>

On Tue, May 02, 2023 at 01:05:25PM +0200, Köry Maincent wrote:
> On Sat, 29 Apr 2023 20:58:07 +0300
> Vladimir Oltean <vladimir.oltean@nxp.com> wrote:
> 
> Thanks for the review and sorry for the coding style issues, I forgot to run the
> checkpatch script.
> 
> > >  
> > >  #if IS_ENABLED(CONFIG_MACSEC)
> > > @@ -2879,6 +2885,7 @@ enum netdev_cmd {
> > >  	NETDEV_OFFLOAD_XSTATS_REPORT_DELTA,
> > >  	NETDEV_XDP_FEAT_CHANGE,
> > >  	NETDEV_PRE_CHANGE_HWTSTAMP,
> > > +	NETDEV_CHANGE_HWTSTAMP,  
> > 
> > Don't create new netdev notifiers with no users. Also,
> > NETDEV_PRE_CHANGE_HWTSTAMP has disappered.
> 
> Ok, right you move it on to dsa stub. What do you think of our case, should we
> continue with netdev notifier? 

I don't know.

AFAIU, the plan forward with this patch set is that, if the active
timestamping layer is the PHY, phy_mii_ioctl() gets called and the MAC
driver does not get notified in any way of that. That is an issue
because if it's a switch, it will want to trap PTP even if it doesn't
timestamp it, and with this proposal it doesn't get a chance to do that.

What is your need for this? Do you have this scenario? If not, just drop
this part from the patch.

Jakub, you said "nope" to netdev notifiers, what would you suggest here
instead? ndo_change_ptp_traps()?

> Just some thought:
> Maybe we could create a PHC_ID 0xXY where X is the layer and Y the PHCs number
> in this layer, but what will append if there is two MACs consecutively?
> Also in case of several MACs or PHYs in serial
> netdev->selected_timestamping_layer is inappropriate. 
> 
> Maybe using it like 0xABC where A is the MAC number, B the PHY number and C
> the PHC number in the device.
> For example if we select the second MAC and its third PHC, PHC_ID will be
> 0x203. Or if we select the second PHC of the PHY it will be 0x012.

I think the kernel has (or can have) enough information to deduce the
timestamping layer from just the PHC number, everything else is redundant
information (also, what's "MAC number"? what is "PHY number"? how can
user space correlate them to anything?).

If you want to design an UAPI where individual PHCs present in the
timestamping list of a netdev can individually have timestamping turned
on or off (for a future where a socket can communicate hardware
timestamps from multiple PHCs to user space in an identifiable way),
then that is fine by me and maybe even a good idea. Just be aware that
the current kernel will have to deny more than a single active
timestamping PHC for now, because of the lack of hwtstamp identification
in the SO_TIMESTAMPING API.

  reply	other threads:[~2023-05-11 13:48 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06 17:33 [PATCH net-next RFC v4 0/5] net: Make MAC/PHY time stamping selectable Köry Maincent
2023-04-06 17:33 ` [PATCH net-next RFC v4 1/5] net: ethtool: Refactor identical get_ts_info implementations Köry Maincent
2023-04-12 13:16   ` Vladimir Oltean
2023-04-12 13:49     ` Köry Maincent
2023-04-12 16:56       ` Richard Cochran
2023-04-06 17:33 ` [PATCH net-next RFC v4 2/5] net: Expose available time stamping layers to user space Köry Maincent
2023-04-07  1:46   ` Jakub Kicinski
2023-04-07  8:58     ` Köry Maincent
2023-04-07 14:26       ` Jakub Kicinski
2023-04-07 14:44         ` Jakub Kicinski
2023-05-17 19:58       ` Jacob Keller
2023-04-12 10:50     ` Michael Walle
2023-04-12 11:08       ` Vladimir Oltean
2023-04-12 11:12         ` Michael Walle
2023-04-12 12:19         ` Köry Maincent
2023-05-11 20:36     ` Vladimir Oltean
2023-05-11 20:50       ` Andrew Lunn
2023-05-11 20:55         ` Russell King (Oracle)
2023-05-11 21:02           ` Vladimir Oltean
2023-05-11 22:09             ` Jakub Kicinski
2023-05-11 23:07               ` Vladimir Oltean
2023-05-11 23:16                 ` Jakub Kicinski
2023-05-12 10:29                   ` Vladimir Oltean
2023-05-12 17:38                     ` Jakub Kicinski
2023-05-17 19:19                       ` Jakub Kicinski
2023-05-17 19:46                         ` Andrew Lunn
2023-05-17 20:07                           ` Jakub Kicinski
2023-09-04 15:22                             ` Köry Maincent
2023-09-04 17:47                               ` Richard Cochran
2023-09-05 18:47                                 ` Jakub Kicinski
2023-09-05 20:29                                   ` Andrew Lunn
2023-09-06  9:22                                     ` Köry Maincent
2023-09-07  9:29                                     ` Russell King (Oracle)
2023-05-19 13:28                       ` Vladimir Oltean
2023-05-19 20:22                         ` Jakub Kicinski
2023-05-22  3:56                           ` Zulkifli, Muhammad Husaini
2023-05-22 20:04                             ` Richard Cochran
2023-05-22 20:21                               ` Jakub Kicinski
2023-05-23  3:54                                 ` Richard Cochran
2023-05-17 22:01                   ` Jacob Keller
2023-05-17 22:13     ` Jacob Keller
2023-05-17 22:46       ` Richard Cochran
2023-05-18 23:23         ` Jacob Keller
2023-05-19 12:50           ` Andrew Lunn
2023-05-19 13:50             ` Richard Cochran
2023-05-19 15:18               ` Andrew Lunn
2023-04-08 14:06   ` Richard Cochran
2023-04-06 17:33 ` [PATCH net-next RFC v4 3/5] dt-bindings: net: phy: add timestamp preferred choice property Köry Maincent
2023-04-12 13:14   ` Vladimir Oltean
2023-04-12 13:44     ` Köry Maincent
2023-04-29 17:42       ` Vladimir Oltean
2023-05-02  9:10         ` Köry Maincent
2023-05-11 13:10           ` Vladimir Oltean
2023-05-11 13:25             ` Köry Maincent
2023-05-11 13:56               ` Vladimir Oltean
2023-05-11 14:22                 ` Köry Maincent
2023-04-12 14:14   ` Krzysztof Kozlowski
2023-04-06 17:33 ` [PATCH net-next RFC v4 4/5] net: Let the active time stamping layer be selectable Köry Maincent
2023-04-07  1:47   ` Jakub Kicinski
2023-04-29 17:58   ` Vladimir Oltean
2023-05-02 11:05     ` Köry Maincent
2023-05-11 13:48       ` Vladimir Oltean [this message]
2023-05-11 15:36         ` Jakub Kicinski
2023-05-11 15:56           ` Vladimir Oltean
2023-05-11 16:25             ` Jakub Kicinski
2023-05-11 20:54               ` Vladimir Oltean
2023-05-11 23:08                 ` Jakub Kicinski
2023-05-11 23:18                   ` Vladimir Oltean
2023-05-11 23:35                     ` Jakub Kicinski
2023-05-15  9:04                       ` Köry Maincent
2023-05-16 19:28                         ` Jakub Kicinski
2023-05-11 21:06               ` Russell King (Oracle)
2023-05-11 22:54                 ` Jakub Kicinski
2023-05-17 22:19               ` Jacob Keller
2023-04-06 17:33 ` [PATCH net-next RFC v4 5/5] net: fix up drivers WRT phy time stamping Köry Maincent
2023-04-06 17:59 ` [PATCH net-next RFC v4 0/5] net: Make MAC/PHY time stamping selectable Köry 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=20230511134807.v4u3ofn6jvgphqco@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=gerhard@engleder-embedded.com \
    --cc=glipus@gmail.com \
    --cc=kory.maincent@bootlin.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vadim.fedorenko@linux.dev \
    /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).