mbox series

[net-next,0/7] Convert dsa_master_ioctl() to netdev notifier

Message ID 20230402123755.2592507-1-vladimir.oltean@nxp.com (mailing list archive)
Headers show
Series Convert dsa_master_ioctl() to netdev notifier | expand

Message

Vladimir Oltean April 2, 2023, 12:37 p.m. UTC
This is preparatory work in order for Maxim Georgiev to be able to start
the API conversion process of hardware timestamping from ndo_eth_ioctl()
to ndo_hwtstamp_set():
https://lore.kernel.org/netdev/20230331045619.40256-1-glipus@gmail.com/

In turn, Maxim Georgiev's work is a preparation so that Köry Maincent is
able to make the active hardware timestamping layer selectable by user
space.
https://lore.kernel.org/netdev/20230308135936.761794-1-kory.maincent@bootlin.com/

So, quite some dependency chain.

Before this patch set, DSA prevented the conversion of any networking
driver from the ndo_eth_ioctl() API to the ndo_hwtstamp_set() API,
because it wanted to validate the hwtstamping settings on the DSA
master, and it was only coded up to do this using the old API.

After this patch set, a new netdev notifier exists, which does not
depend on anything that would constitute the "soon-to-be-legacy" API,
but rather, it uses a newly introduced struct kernel_hwtstamp_config,
and it doesn't issue any ioctl at all, being thus compatible both with
ndo_eth_ioctl(), and with the not-yet-introduced, but now possible,
ndo_hwtstamp_set().

Vladimir Oltean (7):
  net: don't abuse "default" case for unknown ioctl in dev_ifsioc()
  net: simplify handling of dsa_ndo_eth_ioctl() return code
  net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated
    handlers
  net: move copy_from_user() out of net_hwtstamp_validate()
  net: add struct kernel_hwtstamp_config and make
    net_hwtstamp_validate() use it
  net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq
  net: create a netdev notifier for DSA to reject PTP on DSA master

 include/linux/net_tstamp.h |  33 +++++++++++
 include/linux/netdevice.h  |   9 ++-
 include/net/dsa.h          |  51 -----------------
 net/core/dev.c             |   8 +--
 net/core/dev_ioctl.c       | 110 ++++++++++++++++++++++---------------
 net/dsa/master.c           |  50 +++++------------
 net/dsa/master.h           |   3 +
 net/dsa/port.c             |  10 ++--
 net/dsa/port.h             |   2 +-
 net/dsa/slave.c            |  11 ++++
 10 files changed, 147 insertions(+), 140 deletions(-)
 create mode 100644 include/linux/net_tstamp.h

Comments

patchwork-bot+netdevbpf@kernel.org April 3, 2023, 9:20 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Sun,  2 Apr 2023 15:37:48 +0300 you wrote:
> This is preparatory work in order for Maxim Georgiev to be able to start
> the API conversion process of hardware timestamping from ndo_eth_ioctl()
> to ndo_hwtstamp_set():
> https://lore.kernel.org/netdev/20230331045619.40256-1-glipus@gmail.com/
> 
> In turn, Maxim Georgiev's work is a preparation so that Köry Maincent is
> able to make the active hardware timestamping layer selectable by user
> space.
> https://lore.kernel.org/netdev/20230308135936.761794-1-kory.maincent@bootlin.com/
> 
> [...]

Here is the summary with links:
  - [net-next,1/7] net: don't abuse "default" case for unknown ioctl in dev_ifsioc()
    https://git.kernel.org/netdev/net-next/c/00d521b39307
  - [net-next,2/7] net: simplify handling of dsa_ndo_eth_ioctl() return code
    https://git.kernel.org/netdev/net-next/c/1193db2a55b6
  - [net-next,3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers
    https://git.kernel.org/netdev/net-next/c/4ee58e1e5680
  - [net-next,4/7] net: move copy_from_user() out of net_hwtstamp_validate()
    https://git.kernel.org/netdev/net-next/c/d5d5fd8f2552
  - [net-next,5/7] net: add struct kernel_hwtstamp_config and make net_hwtstamp_validate() use it
    https://git.kernel.org/netdev/net-next/c/c4bffeaa8d50
  - [net-next,6/7] net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq
    https://git.kernel.org/netdev/net-next/c/ff6ac4d013e6
  - [net-next,7/7] net: create a netdev notifier for DSA to reject PTP on DSA master
    https://git.kernel.org/netdev/net-next/c/88c0a6b503b7

You are awesome, thank you!