From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Vladimir Oltean <vladimir.oltean@nxp.com>, netdev@vger.kernel.org
Cc: "Köry Maincent" <kory.maincent@bootlin.com>,
"Kurt Kanzenbach" <kurt@linutronix.de>,
"Andrew Lunn" <andrew@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Woojung Huh" <woojung.huh@microchip.com>,
UNGLinuxDriver@microchip.com,
"Claudiu Manoil" <claudiu.manoil@nxp.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Simon Horman" <horms@kernel.org>,
"Richard Cochran" <richardcochran@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: dsa: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
Date: Thu, 8 May 2025 21:25:14 +0100 [thread overview]
Message-ID: <21e9e805-1582-4960-8250-61fe47b2d0aa@linux.dev> (raw)
In-Reply-To: <20250508095236.887789-1-vladimir.oltean@nxp.com>
On 08/05/2025 10:52, Vladimir Oltean wrote:
> New timestamping API was introduced in commit 66f7223039c0 ("net: add
> NDOs for configuring hardware timestamping") from kernel v6.6. It is
> time to convert DSA to the new API, so that the ndo_eth_ioctl() path can
> be removed completely.
>
> Move the ds->ops->port_hwtstamp_get() and ds->ops->port_hwtstamp_set()
> calls from dsa_user_ioctl() to dsa_user_hwtstamp_get() and
> dsa_user_hwtstamp_set().
>
> Due to the fact that the underlying ifreq type changes to
> kernel_hwtstamp_config, the drivers and the Ocelot switchdev front-end,
> all hooked up directly or indirectly, must also be converted all at once.
>
> The conversion also updates the comment from dsa_port_supports_hwtstamp(),
> which is no longer true because kernel_hwtstamp_config is kernel memory
> and does not need copy_to_user(). I've deliberated whether it is
> necessary to also update "err != -EOPNOTSUPP" to a more general "!err",
> but all drivers now either return 0 or -EOPNOTSUPP.
>
> The existing logic from the ocelot_ioctl() function, to avoid
> configuring timestamping if the PHY supports the operation, is obsoleted
> by more advanced core logic in dev_set_hwtstamp_phylib().
>
> This is only a partial preparation for proper PHY timestamping support.
> None of these switch driver currently sets up PTP traps for PHY
> timestamping, so setting dev->see_all_hwtstamp_requests is not yet
> necessary and the conversion is relatively trivial.
The new interface also supports providing error explanation via extack,
it would be great to add some error messages in case when setter fails.
For example, HIRSCHMANN HellCreek switch doesn't support disabling
of timestamps, it's not obvious from general -ERANGE error code, but can
be explained by the text in extack message.
next prev parent reply other threads:[~2025-05-08 20:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-08 9:52 [PATCH net-next] net: dsa: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() Vladimir Oltean
2025-05-08 20:25 ` Vadim Fedorenko [this message]
2025-05-08 20:40 ` Vladimir Oltean
2025-05-08 20:48 ` Vadim Fedorenko
2025-05-08 20:56 ` Vladimir Oltean
2025-05-08 22:15 ` Vadim Fedorenko
2025-05-09 23:50 ` patchwork-bot+netdevbpf
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=21e9e805-1582-4960-8250-61fe47b2d0aa@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--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=vladimir.oltean@nxp.com \
--cc=woojung.huh@microchip.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.