netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier
@ 2023-04-02 12:37 Vladimir Oltean
  2023-04-02 12:37 ` [PATCH net-next 1/7] net: don't abuse "default" case for unknown ioctl in dev_ifsioc() Vladimir Oltean
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 12:37 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

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

-- 
2.34.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH net-next 1/7] net: don't abuse "default" case for unknown ioctl in dev_ifsioc()
  2023-04-02 12:37 [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier Vladimir Oltean
@ 2023-04-02 12:37 ` Vladimir Oltean
  2023-04-02 12:46   ` Florian Fainelli
  2023-04-02 12:37 ` [PATCH net-next 2/7] net: simplify handling of dsa_ndo_eth_ioctl() return code Vladimir Oltean
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 12:37 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

The "switch (cmd)" block from dev_ifsioc() gained a bit too much
unnecessary manual handling of "cmd" in the "default" case, starting
with the private ioctls.

Clean that up by using the "ellipsis" gcc extension, adding separate
cases for the rest of the ioctls, and letting the default case only
return -EINVAL.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/core/dev_ioctl.c | 42 +++++++++++++++++++-----------------------
 1 file changed, 19 insertions(+), 23 deletions(-)

diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 846669426236..1c0256ea522f 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -391,36 +391,32 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, void __user *data,
 		rtnl_lock();
 		return err;
 
+	case SIOCDEVPRIVATE ... SIOCDEVPRIVATE + 15:
+		return dev_siocdevprivate(dev, ifr, data, cmd);
+
 	case SIOCSHWTSTAMP:
 		err = net_hwtstamp_validate(ifr);
 		if (err)
 			return err;
 		fallthrough;
 
-	/*
-	 *	Unknown or private ioctl
-	 */
-	default:
-		if (cmd >= SIOCDEVPRIVATE &&
-		    cmd <= SIOCDEVPRIVATE + 15)
-			return dev_siocdevprivate(dev, ifr, data, cmd);
-
-		if (cmd == SIOCGMIIPHY ||
-		    cmd == SIOCGMIIREG ||
-		    cmd == SIOCSMIIREG ||
-		    cmd == SIOCSHWTSTAMP ||
-		    cmd == SIOCGHWTSTAMP) {
-			err = dev_eth_ioctl(dev, ifr, cmd);
-		} else if (cmd == SIOCBONDENSLAVE ||
-		    cmd == SIOCBONDRELEASE ||
-		    cmd == SIOCBONDSETHWADDR ||
-		    cmd == SIOCBONDSLAVEINFOQUERY ||
-		    cmd == SIOCBONDINFOQUERY ||
-		    cmd == SIOCBONDCHANGEACTIVE) {
-			err = dev_siocbond(dev, ifr, cmd);
-		} else
-			err = -EINVAL;
+	case SIOCGHWTSTAMP:
+	case SIOCGMIIPHY:
+	case SIOCGMIIREG:
+	case SIOCSMIIREG:
+		return dev_eth_ioctl(dev, ifr, cmd);
+
+	case SIOCBONDENSLAVE:
+	case SIOCBONDRELEASE:
+	case SIOCBONDSETHWADDR:
+	case SIOCBONDSLAVEINFOQUERY:
+	case SIOCBONDINFOQUERY:
+	case SIOCBONDCHANGEACTIVE:
+		return dev_siocbond(dev, ifr, cmd);
 
+	/* Unknown ioctl */
+	default:
+		err = -EINVAL;
 	}
 	return err;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 2/7] net: simplify handling of dsa_ndo_eth_ioctl() return code
  2023-04-02 12:37 [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier Vladimir Oltean
  2023-04-02 12:37 ` [PATCH net-next 1/7] net: don't abuse "default" case for unknown ioctl in dev_ifsioc() Vladimir Oltean
@ 2023-04-02 12:37 ` Vladimir Oltean
  2023-04-02 12:47   ` Florian Fainelli
  2023-04-02 12:37 ` [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers Vladimir Oltean
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 12:37 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

In the expression "x == 0 || x != -95", the term "x == 0" does not
change the expression's logical value, because 0 != -95, and so,
if x is 0, the expression would still be true by virtue of the second
term. If x is non-zero, the expression depends on the truth value of
the second term anyway. As such, the first term is redundant and can
be deleted.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/core/dev_ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 1c0256ea522f..b299fb23fcfa 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -249,7 +249,7 @@ static int dev_eth_ioctl(struct net_device *dev,
 	int err;
 
 	err = dsa_ndo_eth_ioctl(dev, ifr, cmd);
-	if (err == 0 || err != -EOPNOTSUPP)
+	if (err != -EOPNOTSUPP)
 		return err;
 
 	if (ops->ndo_eth_ioctl) {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers
  2023-04-02 12:37 [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier Vladimir Oltean
  2023-04-02 12:37 ` [PATCH net-next 1/7] net: don't abuse "default" case for unknown ioctl in dev_ifsioc() Vladimir Oltean
  2023-04-02 12:37 ` [PATCH net-next 2/7] net: simplify handling of dsa_ndo_eth_ioctl() return code Vladimir Oltean
@ 2023-04-02 12:37 ` Vladimir Oltean
  2023-04-02 12:52   ` Florian Fainelli
  2023-04-02 12:37 ` [PATCH net-next 4/7] net: move copy_from_user() out of net_hwtstamp_validate() Vladimir Oltean
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 12:37 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

DSA does not want to intercept all ioctls handled by dev_eth_ioctl(),
only SIOCSHWTSTAMP. This can be seen from commit f685e609a301 ("net:
dsa: Deny PTP on master if switch supports it"). However, the way in
which the dsa_ndo_eth_ioctl() is called would suggest otherwise.

Split the handling of SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls into
separate case statements of dev_ifsioc(), and make each one call its own
sub-function. This also removes the dsa_ndo_eth_ioctl() call from
dev_eth_ioctl(), which from now on exclusively handles PHY ioctls.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/core/dev_ioctl.c | 39 ++++++++++++++++++++++++++-------------
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index b299fb23fcfa..3b1402f6897c 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -246,20 +246,34 @@ static int dev_eth_ioctl(struct net_device *dev,
 			 struct ifreq *ifr, unsigned int cmd)
 {
 	const struct net_device_ops *ops = dev->netdev_ops;
+
+	if (!ops->ndo_eth_ioctl)
+		return -EOPNOTSUPP;
+
+	if (!netif_device_present(dev))
+		return -ENODEV;
+
+	return ops->ndo_eth_ioctl(dev, ifr, cmd);
+}
+
+static int dev_get_hwtstamp(struct net_device *dev, struct ifreq *ifr)
+{
+	return dev_eth_ioctl(dev, ifr, SIOCGHWTSTAMP);
+}
+
+static int dev_set_hwtstamp(struct net_device *dev, struct ifreq *ifr)
+{
 	int err;
 
-	err = dsa_ndo_eth_ioctl(dev, ifr, cmd);
-	if (err != -EOPNOTSUPP)
+	err = net_hwtstamp_validate(ifr);
+	if (err)
 		return err;
 
-	if (ops->ndo_eth_ioctl) {
-		if (netif_device_present(dev))
-			err = ops->ndo_eth_ioctl(dev, ifr, cmd);
-		else
-			err = -ENODEV;
-	}
+	err = dsa_ndo_eth_ioctl(dev, ifr, SIOCSHWTSTAMP);
+	if (err != -EOPNOTSUPP)
+		return err;
 
-	return err;
+	return dev_eth_ioctl(dev, ifr, SIOCSHWTSTAMP);
 }
 
 static int dev_siocbond(struct net_device *dev,
@@ -395,12 +409,11 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, void __user *data,
 		return dev_siocdevprivate(dev, ifr, data, cmd);
 
 	case SIOCSHWTSTAMP:
-		err = net_hwtstamp_validate(ifr);
-		if (err)
-			return err;
-		fallthrough;
+		return dev_set_hwtstamp(dev, ifr);
 
 	case SIOCGHWTSTAMP:
+		return dev_get_hwtstamp(dev, ifr);
+
 	case SIOCGMIIPHY:
 	case SIOCGMIIREG:
 	case SIOCSMIIREG:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 4/7] net: move copy_from_user() out of net_hwtstamp_validate()
  2023-04-02 12:37 [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier Vladimir Oltean
                   ` (2 preceding siblings ...)
  2023-04-02 12:37 ` [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers Vladimir Oltean
@ 2023-04-02 12:37 ` Vladimir Oltean
  2023-04-02 12:52   ` Florian Fainelli
  2023-04-02 12:37 ` [PATCH net-next 5/7] net: add struct kernel_hwtstamp_config and make net_hwtstamp_validate() use it Vladimir Oltean
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 12:37 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

The kernel will want to start using the more meaningful struct
hwtstamp_config pointer in more places, so move the copy_from_user() at
the beginning of dev_set_hwtstamp() in order to get to that, and pass
this argument to net_hwtstamp_validate().

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/core/dev_ioctl.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 3b1402f6897c..34a0da5fbcfc 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -183,22 +183,18 @@ static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cm
 	return err;
 }
 
-static int net_hwtstamp_validate(struct ifreq *ifr)
+static int net_hwtstamp_validate(const struct hwtstamp_config *cfg)
 {
-	struct hwtstamp_config cfg;
 	enum hwtstamp_tx_types tx_type;
 	enum hwtstamp_rx_filters rx_filter;
 	int tx_type_valid = 0;
 	int rx_filter_valid = 0;
 
-	if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
-		return -EFAULT;
-
-	if (cfg.flags & ~HWTSTAMP_FLAG_MASK)
+	if (cfg->flags & ~HWTSTAMP_FLAG_MASK)
 		return -EINVAL;
 
-	tx_type = cfg.tx_type;
-	rx_filter = cfg.rx_filter;
+	tx_type = cfg->tx_type;
+	rx_filter = cfg->rx_filter;
 
 	switch (tx_type) {
 	case HWTSTAMP_TX_OFF:
@@ -263,9 +259,13 @@ static int dev_get_hwtstamp(struct net_device *dev, struct ifreq *ifr)
 
 static int dev_set_hwtstamp(struct net_device *dev, struct ifreq *ifr)
 {
+	struct hwtstamp_config cfg;
 	int err;
 
-	err = net_hwtstamp_validate(ifr);
+	if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
+		return -EFAULT;
+
+	err = net_hwtstamp_validate(&cfg);
 	if (err)
 		return err;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 5/7] net: add struct kernel_hwtstamp_config and make net_hwtstamp_validate() use it
  2023-04-02 12:37 [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier Vladimir Oltean
                   ` (3 preceding siblings ...)
  2023-04-02 12:37 ` [PATCH net-next 4/7] net: move copy_from_user() out of net_hwtstamp_validate() Vladimir Oltean
@ 2023-04-02 12:37 ` Vladimir Oltean
  2023-04-02 12:57   ` Florian Fainelli
  2023-04-02 12:37 ` [PATCH net-next 6/7] net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq Vladimir Oltean
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 12:37 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

Jakub Kicinski suggested that we may want to add new UAPI for
controlling hardware timestamping through netlink in the future, and in
that case, we will be limited to the struct hwtstamp_config that is
currently passed in fixed binary format through the SIOCGHWTSTAMP and
SIOCSHWTSTAMP ioctls. It would be good if new kernel code already
started operating on an extensible kernel variant of that structure,
similar in concept to struct kernel_ethtool_coalesce vs struct
ethtool_coalesce.

Since struct hwtstamp_config is in include/uapi/linux/net_tstamp.h, here
we introduce include/linux/net_tstamp.h which shadows that other header,
but also includes it, so that existing includers of this header work as
before. In addition to that, we add the definition for the kernel-only
structure, and a helper which translates all fields by manual copying.
I am doing a manual copy in order to not force the alignment (or type)
of the fields of struct kernel_hwtstamp_config to be the same as of
struct hwtstamp_config, even though now, they are the same.

Link: https://lore.kernel.org/netdev/20230330223519.36ce7d23@kernel.org/
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 include/linux/net_tstamp.h | 33 +++++++++++++++++++++++++++++++++
 net/core/dev_ioctl.c       |  7 +++++--
 2 files changed, 38 insertions(+), 2 deletions(-)
 create mode 100644 include/linux/net_tstamp.h

diff --git a/include/linux/net_tstamp.h b/include/linux/net_tstamp.h
new file mode 100644
index 000000000000..fd67f3cc0c4b
--- /dev/null
+++ b/include/linux/net_tstamp.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _LINUX_NET_TIMESTAMPING_H_
+#define _LINUX_NET_TIMESTAMPING_H_
+
+#include <uapi/linux/net_tstamp.h>
+
+/**
+ * struct kernel_hwtstamp_config - Kernel copy of struct hwtstamp_config
+ *
+ * @flags: see struct hwtstamp_config
+ * @tx_type: see struct hwtstamp_config
+ * @rx_filter: see struct hwtstamp_config
+ *
+ * Prefer using this structure for in-kernel processing of hardware
+ * timestamping configuration, over the inextensible struct hwtstamp_config
+ * exposed to the %SIOCGHWTSTAMP and %SIOCSHWTSTAMP ioctl UAPI.
+ */
+struct kernel_hwtstamp_config {
+	int flags;
+	int tx_type;
+	int rx_filter;
+};
+
+static inline void hwtstamp_config_to_kernel(struct kernel_hwtstamp_config *kernel_cfg,
+					     const struct hwtstamp_config *cfg)
+{
+	kernel_cfg->flags = cfg->flags;
+	kernel_cfg->tx_type = cfg->tx_type;
+	kernel_cfg->rx_filter = cfg->rx_filter;
+}
+
+#endif /* _LINUX_NET_TIMESTAMPING_H_ */
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 34a0da5fbcfc..c532ef4d5dff 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -183,7 +183,7 @@ static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cm
 	return err;
 }
 
-static int net_hwtstamp_validate(const struct hwtstamp_config *cfg)
+static int net_hwtstamp_validate(const struct kernel_hwtstamp_config *cfg)
 {
 	enum hwtstamp_tx_types tx_type;
 	enum hwtstamp_rx_filters rx_filter;
@@ -259,13 +259,16 @@ static int dev_get_hwtstamp(struct net_device *dev, struct ifreq *ifr)
 
 static int dev_set_hwtstamp(struct net_device *dev, struct ifreq *ifr)
 {
+	struct kernel_hwtstamp_config kernel_cfg;
 	struct hwtstamp_config cfg;
 	int err;
 
 	if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
 		return -EFAULT;
 
-	err = net_hwtstamp_validate(&cfg);
+	hwtstamp_config_to_kernel(&kernel_cfg, &cfg);
+
+	err = net_hwtstamp_validate(&kernel_cfg);
 	if (err)
 		return err;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 6/7] net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq
  2023-04-02 12:37 [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier Vladimir Oltean
                   ` (4 preceding siblings ...)
  2023-04-02 12:37 ` [PATCH net-next 5/7] net: add struct kernel_hwtstamp_config and make net_hwtstamp_validate() use it Vladimir Oltean
@ 2023-04-02 12:37 ` Vladimir Oltean
  2023-04-02 12:57   ` Florian Fainelli
  2023-04-02 12:37 ` [PATCH net-next 7/7] net: create a netdev notifier for DSA to reject PTP on DSA master Vladimir Oltean
  2023-04-03  9:20 ` [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier patchwork-bot+netdevbpf
  7 siblings, 1 reply; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 12:37 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

dsa_master_ioctl() is in the process of getting converted to a different
API, where we won't have access to a struct ifreq * anymore, but rather,
to a struct kernel_hwtstamp_config.

Since ds->ops->port_hwtstamp_get() still uses struct ifreq *, this
creates a difficult situation where we have to make up such a dummy
pointer.

The conversion is a bit messy, because it forces a "good" implementation
of ds->ops->port_hwtstamp_get() to return -EFAULT in copy_to_user()
because of the NULL ifr->ifr_data pointer. However, it works, and it is
only a transient step until ds->ops->port_hwtstamp_get() gets converted
to the new API which passes struct kernel_hwtstamp_config and does not
call copy_to_user().

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/dsa/master.c |  2 +-
 net/dsa/port.c   | 10 ++++++----
 net/dsa/port.h   |  2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/dsa/master.c b/net/dsa/master.c
index 22d3f16b0e6d..e397641382ca 100644
--- a/net/dsa/master.c
+++ b/net/dsa/master.c
@@ -212,7 +212,7 @@ static int dsa_master_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 		 * switch in the tree that is PTP capable.
 		 */
 		list_for_each_entry(dp, &dst->ports, list)
-			if (dsa_port_supports_hwtstamp(dp, ifr))
+			if (dsa_port_supports_hwtstamp(dp))
 				return -EBUSY;
 		break;
 	}
diff --git a/net/dsa/port.c b/net/dsa/port.c
index 15cee17769e9..71ba30538411 100644
--- a/net/dsa/port.c
+++ b/net/dsa/port.c
@@ -114,19 +114,21 @@ static bool dsa_port_can_configure_learning(struct dsa_port *dp)
 	return !err;
 }
 
-bool dsa_port_supports_hwtstamp(struct dsa_port *dp, struct ifreq *ifr)
+bool dsa_port_supports_hwtstamp(struct dsa_port *dp)
 {
 	struct dsa_switch *ds = dp->ds;
+	struct ifreq ifr = {};
 	int err;
 
 	if (!ds->ops->port_hwtstamp_get || !ds->ops->port_hwtstamp_set)
 		return false;
 
 	/* "See through" shim implementations of the "get" method.
-	 * This will clobber the ifreq structure, but we will either return an
-	 * error, or the master will overwrite it with proper values.
+	 * Since we can't cook up a complete ioctl request structure, this will
+	 * fail in copy_to_user() with -EFAULT, which hopefully is enough to
+	 * detect a valid implementation.
 	 */
-	err = ds->ops->port_hwtstamp_get(ds, dp->index, ifr);
+	err = ds->ops->port_hwtstamp_get(ds, dp->index, &ifr);
 	return err != -EOPNOTSUPP;
 }
 
diff --git a/net/dsa/port.h b/net/dsa/port.h
index 9c218660d223..dc812512fd0e 100644
--- a/net/dsa/port.h
+++ b/net/dsa/port.h
@@ -15,7 +15,7 @@ struct switchdev_obj_port_mdb;
 struct switchdev_vlan_msti;
 struct phy_device;
 
-bool dsa_port_supports_hwtstamp(struct dsa_port *dp, struct ifreq *ifr);
+bool dsa_port_supports_hwtstamp(struct dsa_port *dp);
 void dsa_port_set_tag_protocol(struct dsa_port *cpu_dp,
 			       const struct dsa_device_ops *tag_ops);
 int dsa_port_set_state(struct dsa_port *dp, u8 state, bool do_fast_age);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH net-next 7/7] net: create a netdev notifier for DSA to reject PTP on DSA master
  2023-04-02 12:37 [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier Vladimir Oltean
                   ` (5 preceding siblings ...)
  2023-04-02 12:37 ` [PATCH net-next 6/7] net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq Vladimir Oltean
@ 2023-04-02 12:37 ` Vladimir Oltean
  2023-04-02 13:01   ` Florian Fainelli
  2023-04-03 15:30   ` Jakub Kicinski
  2023-04-03  9:20 ` [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier patchwork-bot+netdevbpf
  7 siblings, 2 replies; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 12:37 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

The fact that PTP 2-step TX timestamping is broken on DSA switches if
the master also timestamps the same packets is documented by commit
f685e609a301 ("net: dsa: Deny PTP on master if switch supports it").
We attempt to help the users avoid shooting themselves in the foot by
making DSA reject the timestamping ioctls on an interface that is a DSA
master, and the switch tree beneath it contains switches which are aware
of PTP.

The only problem is that there isn't an established way of intercepting
ndo_eth_ioctl calls, so DSA creates avoidable burden upon the network
stack by creating a struct dsa_netdevice_ops with overlaid function
pointers that are manually checked from the relevant call sites. There
used to be 2 such dsa_netdevice_ops, but now, ndo_eth_ioctl is the only
one left.

There is an ongoing effort to migrate driver-visible hardware timestamping
control from the ndo_eth_ioctl() based API to a new ndo_hwtstamp_set()
model, but DSA actively prevents that migration, since dsa_master_ioctl()
is currently coded to manually call the master's legacy ndo_eth_ioctl(),
and so, whenever a network device driver would be converted to the new
API, DSA's restrictions would be circumvented, because any device could
be used as a DSA master.

The established way for unrelated modules to react on a net device event
is via netdevice notifiers. So we create a new notifier which gets
called whenever there is an attempt to change hardware timestamping
settings on a device.

Finally, there is another reason why a netdev notifier will be a good
idea, besides strictly DSA, and this has to do with PHY timestamping.

With ndo_eth_ioctl(), all MAC drivers must manually call
phy_has_hwtstamp() before deciding whether to act upon SIOCSHWTSTAMP,
otherwise they must pass this ioctl to the PHY driver via
phy_mii_ioctl().

With the new ndo_hwtstamp_set() API, it will be desirable to simply not
make any calls into the MAC device driver when timestamping should be
performed at the PHY level.

But there exist drivers, such as the lan966x switch, which need to
install packet traps for PTP regardless of whether they are the layer
that provides the hardware timestamps, or the PHY is. That would be
impossible to support with the new API.

The proposal there, too, is to introduce a netdev notifier which acts as
a better cue for switching drivers to add or remove PTP packet traps,
than ndo_hwtstamp_set(). The one introduced here "almost" works there as
well, except for the fact that packet traps should only be installed if
the PHY driver succeeded to enable hardware timestamping, whereas here,
we need to deny hardware timestamping on the DSA master before it
actually gets enabled. This is why this notifier is called "PRE_", and
the notifier that would get used for PHY timestamping and packet traps
would be called NETDEV_CHANGE_HWTSTAMP. This isn't a new concept, for
example NETDEV_CHANGEUPPER and NETDEV_PRECHANGEUPPER do the same thing.

In expectation of future netlink UAPI, we also pass a non-NULL extack
pointer to the netdev notifier, and we make DSA populate it with an
informative reason for the rejection. To avoid making it go to waste, we
make the ioctl-based dev_set_hwtstamp() create a fake extack and print
the message to the kernel log.

Link: https://lore.kernel.org/netdev/20230401191215.tvveoi3lkawgg6g4@skbuf/
Link: https://lore.kernel.org/netdev/20230310164451.ls7bbs6pdzs4m6pw@skbuf/
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 include/linux/netdevice.h |  9 ++++++-
 include/net/dsa.h         | 51 ---------------------------------------
 net/core/dev.c            |  8 +++---
 net/core/dev_ioctl.c      | 16 ++++++++++--
 net/dsa/master.c          | 50 ++++++++++++--------------------------
 net/dsa/master.h          |  3 +++
 net/dsa/slave.c           | 11 +++++++++
 7 files changed, 54 insertions(+), 94 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c8c634091a65..336c62e5df3b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2877,6 +2877,7 @@ enum netdev_cmd {
 	NETDEV_OFFLOAD_XSTATS_REPORT_USED,
 	NETDEV_OFFLOAD_XSTATS_REPORT_DELTA,
 	NETDEV_XDP_FEAT_CHANGE,
+	NETDEV_PRE_CHANGE_HWTSTAMP,
 };
 const char *netdev_cmd_to_name(enum netdev_cmd cmd);
 
@@ -2927,6 +2928,11 @@ struct netdev_notifier_pre_changeaddr_info {
 	const unsigned char *dev_addr;
 };
 
+struct netdev_notifier_hwtstamp_info {
+	struct netdev_notifier_info info; /* must be first */
+	struct kernel_hwtstamp_config *config;
+};
+
 enum netdev_offload_xstats_type {
 	NETDEV_OFFLOAD_XSTATS_TYPE_L3 = 1,
 };
@@ -2983,7 +2989,8 @@ netdev_notifier_info_to_extack(const struct netdev_notifier_info *info)
 }
 
 int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
-
+int call_netdevice_notifiers_info(unsigned long val,
+				  struct netdev_notifier_info *info);
 
 extern rwlock_t				dev_base_lock;		/* Device list lock */
 
diff --git a/include/net/dsa.h b/include/net/dsa.h
index a15f17a38eca..8903053fa5aa 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -109,16 +109,6 @@ struct dsa_device_ops {
 	bool promisc_on_master;
 };
 
-/* This structure defines the control interfaces that are overlayed by the
- * DSA layer on top of the DSA CPU/management net_device instance. This is
- * used by the core net_device layer while calling various net_device_ops
- * function pointers.
- */
-struct dsa_netdevice_ops {
-	int (*ndo_eth_ioctl)(struct net_device *dev, struct ifreq *ifr,
-			     int cmd);
-};
-
 struct dsa_lag {
 	struct net_device *dev;
 	unsigned int id;
@@ -317,11 +307,6 @@ struct dsa_port {
 	 */
 	const struct ethtool_ops *orig_ethtool_ops;
 
-	/*
-	 * Original copy of the master netdev net_device_ops
-	 */
-	const struct dsa_netdevice_ops *netdev_ops;
-
 	/* List of MAC addresses that must be forwarded on this port.
 	 * These are only valid on CPU ports and DSA links.
 	 */
@@ -1339,42 +1324,6 @@ static inline void dsa_tag_generic_flow_dissect(const struct sk_buff *skb,
 #endif
 }
 
-#if IS_ENABLED(CONFIG_NET_DSA)
-static inline int __dsa_netdevice_ops_check(struct net_device *dev)
-{
-	int err = -EOPNOTSUPP;
-
-	if (!dev->dsa_ptr)
-		return err;
-
-	if (!dev->dsa_ptr->netdev_ops)
-		return err;
-
-	return 0;
-}
-
-static inline int dsa_ndo_eth_ioctl(struct net_device *dev, struct ifreq *ifr,
-				    int cmd)
-{
-	const struct dsa_netdevice_ops *ops;
-	int err;
-
-	err = __dsa_netdevice_ops_check(dev);
-	if (err)
-		return err;
-
-	ops = dev->dsa_ptr->netdev_ops;
-
-	return ops->ndo_eth_ioctl(dev, ifr, cmd);
-}
-#else
-static inline int dsa_ndo_eth_ioctl(struct net_device *dev, struct ifreq *ifr,
-				    int cmd)
-{
-	return -EOPNOTSUPP;
-}
-#endif
-
 void dsa_unregister_switch(struct dsa_switch *ds);
 int dsa_register_switch(struct dsa_switch *ds);
 void dsa_switch_shutdown(struct dsa_switch *ds);
diff --git a/net/core/dev.c b/net/core/dev.c
index 0c4b21291348..7ce5985be84b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -160,8 +160,6 @@ struct list_head ptype_base[PTYPE_HASH_SIZE] __read_mostly;
 struct list_head ptype_all __read_mostly;	/* Taps */
 
 static int netif_rx_internal(struct sk_buff *skb);
-static int call_netdevice_notifiers_info(unsigned long val,
-					 struct netdev_notifier_info *info);
 static int call_netdevice_notifiers_extack(unsigned long val,
 					   struct net_device *dev,
 					   struct netlink_ext_ack *extack);
@@ -1614,7 +1612,7 @@ const char *netdev_cmd_to_name(enum netdev_cmd cmd)
 	N(SVLAN_FILTER_PUSH_INFO) N(SVLAN_FILTER_DROP_INFO)
 	N(PRE_CHANGEADDR) N(OFFLOAD_XSTATS_ENABLE) N(OFFLOAD_XSTATS_DISABLE)
 	N(OFFLOAD_XSTATS_REPORT_USED) N(OFFLOAD_XSTATS_REPORT_DELTA)
-	N(XDP_FEAT_CHANGE)
+	N(XDP_FEAT_CHANGE) N(PRE_CHANGE_HWTSTAMP)
 	}
 #undef N
 	return "UNKNOWN_NETDEV_EVENT";
@@ -1919,8 +1917,8 @@ static void move_netdevice_notifiers_dev_net(struct net_device *dev,
  *	are as for raw_notifier_call_chain().
  */
 
-static int call_netdevice_notifiers_info(unsigned long val,
-					 struct netdev_notifier_info *info)
+int call_netdevice_notifiers_info(unsigned long val,
+				  struct netdev_notifier_info *info)
 {
 	struct net *net = dev_net(info->dev);
 	int ret;
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index c532ef4d5dff..6d772837eb3f 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -259,7 +259,11 @@ static int dev_get_hwtstamp(struct net_device *dev, struct ifreq *ifr)
 
 static int dev_set_hwtstamp(struct net_device *dev, struct ifreq *ifr)
 {
+	struct netdev_notifier_hwtstamp_info info = {
+		.info.dev = dev,
+	};
 	struct kernel_hwtstamp_config kernel_cfg;
+	struct netlink_ext_ack extack = {};
 	struct hwtstamp_config cfg;
 	int err;
 
@@ -272,9 +276,17 @@ static int dev_set_hwtstamp(struct net_device *dev, struct ifreq *ifr)
 	if (err)
 		return err;
 
-	err = dsa_ndo_eth_ioctl(dev, ifr, SIOCSHWTSTAMP);
-	if (err != -EOPNOTSUPP)
+	info.info.extack = &extack;
+	info.config = &kernel_cfg;
+
+	err = call_netdevice_notifiers_info(NETDEV_PRE_CHANGE_HWTSTAMP,
+					    &info.info);
+	err = notifier_to_errno(err);
+	if (err) {
+		if (extack._msg)
+			netdev_err(dev, "%s\n", extack._msg);
 		return err;
+	}
 
 	return dev_eth_ioctl(dev, ifr, SIOCSHWTSTAMP);
 }
diff --git a/net/dsa/master.c b/net/dsa/master.c
index e397641382ca..c2cabe6248b1 100644
--- a/net/dsa/master.c
+++ b/net/dsa/master.c
@@ -195,38 +195,31 @@ static void dsa_master_get_strings(struct net_device *dev, uint32_t stringset,
 	}
 }
 
-static int dsa_master_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+/* Deny PTP operations on master if there is at least one switch in the tree
+ * that is PTP capable.
+ */
+int dsa_master_pre_change_hwtstamp(struct net_device *dev,
+				   const struct kernel_hwtstamp_config *config,
+				   struct netlink_ext_ack *extack)
 {
 	struct dsa_port *cpu_dp = dev->dsa_ptr;
 	struct dsa_switch *ds = cpu_dp->ds;
 	struct dsa_switch_tree *dst;
-	int err = -EOPNOTSUPP;
 	struct dsa_port *dp;
 
 	dst = ds->dst;
 
-	switch (cmd) {
-	case SIOCGHWTSTAMP:
-	case SIOCSHWTSTAMP:
-		/* Deny PTP operations on master if there is at least one
-		 * switch in the tree that is PTP capable.
-		 */
-		list_for_each_entry(dp, &dst->ports, list)
-			if (dsa_port_supports_hwtstamp(dp))
-				return -EBUSY;
-		break;
+	list_for_each_entry(dp, &dst->ports, list) {
+		if (dsa_port_supports_hwtstamp(dp)) {
+			NL_SET_ERR_MSG(extack,
+				       "HW timestamping not allowed on DSA master when switch supports the operation");
+			return -EBUSY;
+		}
 	}
 
-	if (dev->netdev_ops->ndo_eth_ioctl)
-		err = dev->netdev_ops->ndo_eth_ioctl(dev, ifr, cmd);
-
-	return err;
+	return 0;
 }
 
-static const struct dsa_netdevice_ops dsa_netdev_ops = {
-	.ndo_eth_ioctl = dsa_master_ioctl,
-};
-
 static int dsa_master_ethtool_setup(struct net_device *dev)
 {
 	struct dsa_port *cpu_dp = dev->dsa_ptr;
@@ -267,15 +260,6 @@ static void dsa_master_ethtool_teardown(struct net_device *dev)
 	cpu_dp->orig_ethtool_ops = NULL;
 }
 
-static void dsa_netdev_ops_set(struct net_device *dev,
-			       const struct dsa_netdevice_ops *ops)
-{
-	if (netif_is_lag_master(dev))
-		return;
-
-	dev->dsa_ptr->netdev_ops = ops;
-}
-
 /* Keep the master always promiscuous if the tagging protocol requires that
  * (garbles MAC DA) or if it doesn't support unicast filtering, case in which
  * it would revert to promiscuous mode as soon as we call dev_uc_add() on it
@@ -414,16 +398,13 @@ int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp)
 	if (ret)
 		goto out_err_reset_promisc;
 
-	dsa_netdev_ops_set(dev, &dsa_netdev_ops);
-
 	ret = sysfs_create_group(&dev->dev.kobj, &dsa_group);
 	if (ret)
-		goto out_err_ndo_teardown;
+		goto out_err_ethtool_teardown;
 
 	return ret;
 
-out_err_ndo_teardown:
-	dsa_netdev_ops_set(dev, NULL);
+out_err_ethtool_teardown:
 	dsa_master_ethtool_teardown(dev);
 out_err_reset_promisc:
 	dsa_master_set_promiscuity(dev, -1);
@@ -433,7 +414,6 @@ int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp)
 void dsa_master_teardown(struct net_device *dev)
 {
 	sysfs_remove_group(&dev->dev.kobj, &dsa_group);
-	dsa_netdev_ops_set(dev, NULL);
 	dsa_master_ethtool_teardown(dev);
 	dsa_master_reset_mtu(dev);
 	dsa_master_set_promiscuity(dev, -1);
diff --git a/net/dsa/master.h b/net/dsa/master.h
index 3fc0e610b5b5..80842f4e27f7 100644
--- a/net/dsa/master.h
+++ b/net/dsa/master.h
@@ -15,5 +15,8 @@ int dsa_master_lag_setup(struct net_device *lag_dev, struct dsa_port *cpu_dp,
 			 struct netlink_ext_ack *extack);
 void dsa_master_lag_teardown(struct net_device *lag_dev,
 			     struct dsa_port *cpu_dp);
+int dsa_master_pre_change_hwtstamp(struct net_device *dev,
+				   const struct kernel_hwtstamp_config *config,
+				   struct netlink_ext_ack *extack);
 
 #endif
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 165bb2cb8431..8abc1658ac47 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -3289,6 +3289,7 @@ static int dsa_master_changeupper(struct net_device *dev,
 static int dsa_slave_netdevice_event(struct notifier_block *nb,
 				     unsigned long event, void *ptr)
 {
+	struct netlink_ext_ack *extack = netdev_notifier_info_to_extack(ptr);
 	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
 
 	switch (event) {
@@ -3418,6 +3419,16 @@ static int dsa_slave_netdevice_event(struct notifier_block *nb,
 
 		return NOTIFY_OK;
 	}
+	case NETDEV_PRE_CHANGE_HWTSTAMP: {
+		struct netdev_notifier_hwtstamp_info *info = ptr;
+		int err;
+
+		if (!netdev_uses_dsa(dev))
+			return NOTIFY_DONE;
+
+		err = dsa_master_pre_change_hwtstamp(dev, info->config, extack);
+		return notifier_from_errno(err);
+	}
 	default:
 		break;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 1/7] net: don't abuse "default" case for unknown ioctl in dev_ifsioc()
  2023-04-02 12:37 ` [PATCH net-next 1/7] net: don't abuse "default" case for unknown ioctl in dev_ifsioc() Vladimir Oltean
@ 2023-04-02 12:46   ` Florian Fainelli
  0 siblings, 0 replies; 22+ messages in thread
From: Florian Fainelli @ 2023-04-02 12:46 UTC (permalink / raw)
  To: Vladimir Oltean, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Maxim Georgiev, Horatiu Vultur, Köry Maincent,
	Maxime Chevallier



On 4/2/2023 5:37 AM, Vladimir Oltean wrote:
> The "switch (cmd)" block from dev_ifsioc() gained a bit too much
> unnecessary manual handling of "cmd" in the "default" case, starting
> with the private ioctls.
> 
> Clean that up by using the "ellipsis" gcc extension, adding separate
> cases for the rest of the ioctls, and letting the default case only
> return -EINVAL.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 2/7] net: simplify handling of dsa_ndo_eth_ioctl() return code
  2023-04-02 12:37 ` [PATCH net-next 2/7] net: simplify handling of dsa_ndo_eth_ioctl() return code Vladimir Oltean
@ 2023-04-02 12:47   ` Florian Fainelli
  0 siblings, 0 replies; 22+ messages in thread
From: Florian Fainelli @ 2023-04-02 12:47 UTC (permalink / raw)
  To: Vladimir Oltean, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Maxim Georgiev, Horatiu Vultur, Köry Maincent,
	Maxime Chevallier



On 4/2/2023 5:37 AM, Vladimir Oltean wrote:
> In the expression "x == 0 || x != -95", the term "x == 0" does not
> change the expression's logical value, because 0 != -95, and so,
> if x is 0, the expression would still be true by virtue of the second
> term. If x is non-zero, the expression depends on the truth value of
> the second term anyway. As such, the first term is redundant and can
> be deleted.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers
  2023-04-02 12:37 ` [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers Vladimir Oltean
@ 2023-04-02 12:52   ` Florian Fainelli
  2023-04-02 12:53     ` Vladimir Oltean
  0 siblings, 1 reply; 22+ messages in thread
From: Florian Fainelli @ 2023-04-02 12:52 UTC (permalink / raw)
  To: Vladimir Oltean, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Maxim Georgiev, Horatiu Vultur, Köry Maincent,
	Maxime Chevallier



On 4/2/2023 5:37 AM, Vladimir Oltean wrote:
> DSA does not want to intercept all ioctls handled by dev_eth_ioctl(),
> only SIOCSHWTSTAMP. This can be seen from commit f685e609a301 ("net:
> dsa: Deny PTP on master if switch supports it"). However, the way in
> which the dsa_ndo_eth_ioctl() is called would suggest otherwise.
> 
> Split the handling of SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls into
> separate case statements of dev_ifsioc(), and make each one call its own
> sub-function. This also removes the dsa_ndo_eth_ioctl() call from
> dev_eth_ioctl(), which from now on exclusively handles PHY ioctls.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

PS: there could be some interesting use cases with SIO(S|G)MII(REG|PHY) 
to be explored, but not for now.
-- 
Florian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 4/7] net: move copy_from_user() out of net_hwtstamp_validate()
  2023-04-02 12:37 ` [PATCH net-next 4/7] net: move copy_from_user() out of net_hwtstamp_validate() Vladimir Oltean
@ 2023-04-02 12:52   ` Florian Fainelli
  0 siblings, 0 replies; 22+ messages in thread
From: Florian Fainelli @ 2023-04-02 12:52 UTC (permalink / raw)
  To: Vladimir Oltean, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Maxim Georgiev, Horatiu Vultur, Köry Maincent,
	Maxime Chevallier



On 4/2/2023 5:37 AM, Vladimir Oltean wrote:
> The kernel will want to start using the more meaningful struct
> hwtstamp_config pointer in more places, so move the copy_from_user() at
> the beginning of dev_set_hwtstamp() in order to get to that, and pass
> this argument to net_hwtstamp_validate().
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers
  2023-04-02 12:52   ` Florian Fainelli
@ 2023-04-02 12:53     ` Vladimir Oltean
  2023-04-02 12:56       ` Florian Fainelli
  0 siblings, 1 reply; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 12:53 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

On Sun, Apr 02, 2023 at 05:52:29AM -0700, Florian Fainelli wrote:
> PS: there could be some interesting use cases with SIO(S|G)MII(REG|PHY) to
> be explored, but not for now.

You mean with DSA intercepting them on the master? Details?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers
  2023-04-02 12:53     ` Vladimir Oltean
@ 2023-04-02 12:56       ` Florian Fainelli
  2023-04-02 13:01         ` Vladimir Oltean
  0 siblings, 1 reply; 22+ messages in thread
From: Florian Fainelli @ 2023-04-02 12:56 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier



On 4/2/2023 5:53 AM, Vladimir Oltean wrote:
> On Sun, Apr 02, 2023 at 05:52:29AM -0700, Florian Fainelli wrote:
>> PS: there could be some interesting use cases with SIO(S|G)MII(REG|PHY) to
>> be explored, but not for now.
> 
> You mean with DSA intercepting them on the master? Details?

Humm, maybe this is an -ENOTENOUGHCOFFEE situation, if we have a 
fixed-link, we would not do anything of value. If we have a PHY-less 
configuration same thing. So it would only be a sort of configuration 
where the switch side has a PHY and the MAC connects to it that would be 
of any value.
-- 
Florian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 5/7] net: add struct kernel_hwtstamp_config and make net_hwtstamp_validate() use it
  2023-04-02 12:37 ` [PATCH net-next 5/7] net: add struct kernel_hwtstamp_config and make net_hwtstamp_validate() use it Vladimir Oltean
@ 2023-04-02 12:57   ` Florian Fainelli
  0 siblings, 0 replies; 22+ messages in thread
From: Florian Fainelli @ 2023-04-02 12:57 UTC (permalink / raw)
  To: Vladimir Oltean, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Maxim Georgiev, Horatiu Vultur, Köry Maincent,
	Maxime Chevallier



On 4/2/2023 5:37 AM, Vladimir Oltean wrote:
> Jakub Kicinski suggested that we may want to add new UAPI for
> controlling hardware timestamping through netlink in the future, and in
> that case, we will be limited to the struct hwtstamp_config that is
> currently passed in fixed binary format through the SIOCGHWTSTAMP and
> SIOCSHWTSTAMP ioctls. It would be good if new kernel code already
> started operating on an extensible kernel variant of that structure,
> similar in concept to struct kernel_ethtool_coalesce vs struct
> ethtool_coalesce.
> 
> Since struct hwtstamp_config is in include/uapi/linux/net_tstamp.h, here
> we introduce include/linux/net_tstamp.h which shadows that other header,
> but also includes it, so that existing includers of this header work as
> before. In addition to that, we add the definition for the kernel-only
> structure, and a helper which translates all fields by manual copying.
> I am doing a manual copy in order to not force the alignment (or type)
> of the fields of struct kernel_hwtstamp_config to be the same as of
> struct hwtstamp_config, even though now, they are the same.
> 
> Link: https://lore.kernel.org/netdev/20230330223519.36ce7d23@kernel.org/
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 6/7] net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq
  2023-04-02 12:37 ` [PATCH net-next 6/7] net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq Vladimir Oltean
@ 2023-04-02 12:57   ` Florian Fainelli
  0 siblings, 0 replies; 22+ messages in thread
From: Florian Fainelli @ 2023-04-02 12:57 UTC (permalink / raw)
  To: Vladimir Oltean, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Maxim Georgiev, Horatiu Vultur, Köry Maincent,
	Maxime Chevallier



On 4/2/2023 5:37 AM, Vladimir Oltean wrote:
> dsa_master_ioctl() is in the process of getting converted to a different
> API, where we won't have access to a struct ifreq * anymore, but rather,
> to a struct kernel_hwtstamp_config.
> 
> Since ds->ops->port_hwtstamp_get() still uses struct ifreq *, this
> creates a difficult situation where we have to make up such a dummy
> pointer.
> 
> The conversion is a bit messy, because it forces a "good" implementation
> of ds->ops->port_hwtstamp_get() to return -EFAULT in copy_to_user()
> because of the NULL ifr->ifr_data pointer. However, it works, and it is
> only a transient step until ds->ops->port_hwtstamp_get() gets converted
> to the new API which passes struct kernel_hwtstamp_config and does not
> call copy_to_user().
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 7/7] net: create a netdev notifier for DSA to reject PTP on DSA master
  2023-04-02 12:37 ` [PATCH net-next 7/7] net: create a netdev notifier for DSA to reject PTP on DSA master Vladimir Oltean
@ 2023-04-02 13:01   ` Florian Fainelli
  2023-04-03 15:30   ` Jakub Kicinski
  1 sibling, 0 replies; 22+ messages in thread
From: Florian Fainelli @ 2023-04-02 13:01 UTC (permalink / raw)
  To: Vladimir Oltean, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Andrew Lunn, Maxim Georgiev, Horatiu Vultur, Köry Maincent,
	Maxime Chevallier



On 4/2/2023 5:37 AM, Vladimir Oltean wrote:
> The fact that PTP 2-step TX timestamping is broken on DSA switches if
> the master also timestamps the same packets is documented by commit
> f685e609a301 ("net: dsa: Deny PTP on master if switch supports it").
> We attempt to help the users avoid shooting themselves in the foot by
> making DSA reject the timestamping ioctls on an interface that is a DSA
> master, and the switch tree beneath it contains switches which are aware
> of PTP.
> 
> The only problem is that there isn't an established way of intercepting
> ndo_eth_ioctl calls, so DSA creates avoidable burden upon the network
> stack by creating a struct dsa_netdevice_ops with overlaid function
> pointers that are manually checked from the relevant call sites. There
> used to be 2 such dsa_netdevice_ops, but now, ndo_eth_ioctl is the only
> one left.
> 
> There is an ongoing effort to migrate driver-visible hardware timestamping
> control from the ndo_eth_ioctl() based API to a new ndo_hwtstamp_set()
> model, but DSA actively prevents that migration, since dsa_master_ioctl()
> is currently coded to manually call the master's legacy ndo_eth_ioctl(),
> and so, whenever a network device driver would be converted to the new
> API, DSA's restrictions would be circumvented, because any device could
> be used as a DSA master.
> 
> The established way for unrelated modules to react on a net device event
> is via netdevice notifiers. So we create a new notifier which gets
> called whenever there is an attempt to change hardware timestamping
> settings on a device.
> 
> Finally, there is another reason why a netdev notifier will be a good
> idea, besides strictly DSA, and this has to do with PHY timestamping.
> 
> With ndo_eth_ioctl(), all MAC drivers must manually call
> phy_has_hwtstamp() before deciding whether to act upon SIOCSHWTSTAMP,
> otherwise they must pass this ioctl to the PHY driver via
> phy_mii_ioctl().
> 
> With the new ndo_hwtstamp_set() API, it will be desirable to simply not
> make any calls into the MAC device driver when timestamping should be
> performed at the PHY level.
> 
> But there exist drivers, such as the lan966x switch, which need to
> install packet traps for PTP regardless of whether they are the layer
> that provides the hardware timestamps, or the PHY is. That would be
> impossible to support with the new API.
> 
> The proposal there, too, is to introduce a netdev notifier which acts as
> a better cue for switching drivers to add or remove PTP packet traps,
> than ndo_hwtstamp_set(). The one introduced here "almost" works there as
> well, except for the fact that packet traps should only be installed if
> the PHY driver succeeded to enable hardware timestamping, whereas here,
> we need to deny hardware timestamping on the DSA master before it
> actually gets enabled. This is why this notifier is called "PRE_", and
> the notifier that would get used for PHY timestamping and packet traps
> would be called NETDEV_CHANGE_HWTSTAMP. This isn't a new concept, for
> example NETDEV_CHANGEUPPER and NETDEV_PRECHANGEUPPER do the same thing.
> 
> In expectation of future netlink UAPI, we also pass a non-NULL extack
> pointer to the netdev notifier, and we make DSA populate it with an
> informative reason for the rejection. To avoid making it go to waste, we
> make the ioctl-based dev_set_hwtstamp() create a fake extack and print
> the message to the kernel log.
> 
> Link: https://lore.kernel.org/netdev/20230401191215.tvveoi3lkawgg6g4@skbuf/
> Link: https://lore.kernel.org/netdev/20230310164451.ls7bbs6pdzs4m6pw@skbuf/
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers
  2023-04-02 12:56       ` Florian Fainelli
@ 2023-04-02 13:01         ` Vladimir Oltean
  2023-04-02 13:03           ` Florian Fainelli
  0 siblings, 1 reply; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-02 13:01 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

On Sun, Apr 02, 2023 at 05:56:33AM -0700, Florian Fainelli wrote:
> 
> 
> On 4/2/2023 5:53 AM, Vladimir Oltean wrote:
> > On Sun, Apr 02, 2023 at 05:52:29AM -0700, Florian Fainelli wrote:
> > > PS: there could be some interesting use cases with SIO(S|G)MII(REG|PHY) to
> > > be explored, but not for now.
> > 
> > You mean with DSA intercepting them on the master? Details?
> 
> Humm, maybe this is an -ENOTENOUGHCOFFEE situation, if we have a fixed-link,
> we would not do anything of value. If we have a PHY-less configuration same
> thing. So it would only be a sort of configuration where the switch side has
> a PHY and the MAC connects to it that would be of any value.

But the last case could be handled directly through a phy_mii_ioctl()
issued by the DSA master's own ndo_eth_ioctl() handler, no need for DSA
to intervene, right?

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers
  2023-04-02 13:01         ` Vladimir Oltean
@ 2023-04-02 13:03           ` Florian Fainelli
  0 siblings, 0 replies; 22+ messages in thread
From: Florian Fainelli @ 2023-04-02 13:03 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Andrew Lunn, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier



On 4/2/2023 6:01 AM, Vladimir Oltean wrote:
> On Sun, Apr 02, 2023 at 05:56:33AM -0700, Florian Fainelli wrote:
>>
>>
>> On 4/2/2023 5:53 AM, Vladimir Oltean wrote:
>>> On Sun, Apr 02, 2023 at 05:52:29AM -0700, Florian Fainelli wrote:
>>>> PS: there could be some interesting use cases with SIO(S|G)MII(REG|PHY) to
>>>> be explored, but not for now.
>>>
>>> You mean with DSA intercepting them on the master? Details?
>>
>> Humm, maybe this is an -ENOTENOUGHCOFFEE situation, if we have a fixed-link,
>> we would not do anything of value. If we have a PHY-less configuration same
>> thing. So it would only be a sort of configuration where the switch side has
>> a PHY and the MAC connects to it that would be of any value.
> 
> But the last case could be handled directly through a phy_mii_ioctl()
> issued by the DSA master's own ndo_eth_ioctl() handler, no need for DSA
> to intervene, right?

Yes of course, no need for the indirection dance, thanks!
-- 
Florian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier
  2023-04-02 12:37 [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier Vladimir Oltean
                   ` (6 preceding siblings ...)
  2023-04-02 12:37 ` [PATCH net-next 7/7] net: create a netdev notifier for DSA to reject PTP on DSA master Vladimir Oltean
@ 2023-04-03  9:20 ` patchwork-bot+netdevbpf
  7 siblings, 0 replies; 22+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-03  9:20 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, davem, edumazet, kuba, pabeni, andrew, f.fainelli,
	glipus, horatiu.vultur, kory.maincent, maxime.chevallier

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 7/7] net: create a netdev notifier for DSA to reject PTP on DSA master
  2023-04-02 12:37 ` [PATCH net-next 7/7] net: create a netdev notifier for DSA to reject PTP on DSA master Vladimir Oltean
  2023-04-02 13:01   ` Florian Fainelli
@ 2023-04-03 15:30   ` Jakub Kicinski
  2023-04-03 16:48     ` Vladimir Oltean
  1 sibling, 1 reply; 22+ messages in thread
From: Jakub Kicinski @ 2023-04-03 15:30 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: netdev, David S. Miller, Eric Dumazet, Paolo Abeni, Andrew Lunn,
	Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

On Sun,  2 Apr 2023 15:37:55 +0300 Vladimir Oltean wrote:
> The established way for unrelated modules to react on a net device event
> is via netdevice notifiers. So we create a new notifier which gets
> called whenever there is an attempt to change hardware timestamping
> settings on a device.

Two core parts of the kernel are not "unrelated modules".
Notifiers make the code harder to maintain and reason about.

But what do I know, clearly the code is amazing since it 
has been applied in <22h on a weekend :|

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH net-next 7/7] net: create a netdev notifier for DSA to reject PTP on DSA master
  2023-04-03 15:30   ` Jakub Kicinski
@ 2023-04-03 16:48     ` Vladimir Oltean
  0 siblings, 0 replies; 22+ messages in thread
From: Vladimir Oltean @ 2023-04-03 16:48 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, David S. Miller, Eric Dumazet, Paolo Abeni, Andrew Lunn,
	Florian Fainelli, Maxim Georgiev, Horatiu Vultur,
	Köry Maincent, Maxime Chevallier

On Mon, Apr 03, 2023 at 08:30:19AM -0700, Jakub Kicinski wrote:
> On Sun,  2 Apr 2023 15:37:55 +0300 Vladimir Oltean wrote:
> > The established way for unrelated modules to react on a net device event
> > is via netdevice notifiers. So we create a new notifier which gets
> > called whenever there is an attempt to change hardware timestamping
> > settings on a device.
> 
> Two core parts of the kernel are not "unrelated modules".
> Notifiers make the code harder to maintain and reason about.
> 
> But what do I know, clearly the code is amazing since it 
> has been applied in <22h on a weekend :|

Responded privately.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-04-03 16:48 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-02 12:37 [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier Vladimir Oltean
2023-04-02 12:37 ` [PATCH net-next 1/7] net: don't abuse "default" case for unknown ioctl in dev_ifsioc() Vladimir Oltean
2023-04-02 12:46   ` Florian Fainelli
2023-04-02 12:37 ` [PATCH net-next 2/7] net: simplify handling of dsa_ndo_eth_ioctl() return code Vladimir Oltean
2023-04-02 12:47   ` Florian Fainelli
2023-04-02 12:37 ` [PATCH net-next 3/7] net: promote SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctls to dedicated handlers Vladimir Oltean
2023-04-02 12:52   ` Florian Fainelli
2023-04-02 12:53     ` Vladimir Oltean
2023-04-02 12:56       ` Florian Fainelli
2023-04-02 13:01         ` Vladimir Oltean
2023-04-02 13:03           ` Florian Fainelli
2023-04-02 12:37 ` [PATCH net-next 4/7] net: move copy_from_user() out of net_hwtstamp_validate() Vladimir Oltean
2023-04-02 12:52   ` Florian Fainelli
2023-04-02 12:37 ` [PATCH net-next 5/7] net: add struct kernel_hwtstamp_config and make net_hwtstamp_validate() use it Vladimir Oltean
2023-04-02 12:57   ` Florian Fainelli
2023-04-02 12:37 ` [PATCH net-next 6/7] net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq Vladimir Oltean
2023-04-02 12:57   ` Florian Fainelli
2023-04-02 12:37 ` [PATCH net-next 7/7] net: create a netdev notifier for DSA to reject PTP on DSA master Vladimir Oltean
2023-04-02 13:01   ` Florian Fainelli
2023-04-03 15:30   ` Jakub Kicinski
2023-04-03 16:48     ` Vladimir Oltean
2023-04-03  9:20 ` [PATCH net-next 0/7] Convert dsa_master_ioctl() to netdev notifier patchwork-bot+netdevbpf

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).