[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220321144457.7dc6e8e0@hermes.local>
Date: Mon, 21 Mar 2022 14:44:57 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Richard Cochran <richardcochran@...il.com>
Subject: Re: [RFC PATCH net-next] net: create a NETDEV_ETH_IOCTL notifier
for DSA to reject PTP on DSA master
On Fri, 18 Mar 2022 00:50:35 +0200
Vladimir Oltean <vladimir.oltean@....com> wrote:
> The fact that PTP 2-step TX timestamping is deeply broken on DSA
> switches if the master also timestamps the same packets is well
> 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.
>
> In fact, the underlying reason which is prompting me to make this change
> is that I'd like to hide as many DSA data structures from public API as
> I can. But struct net_device :: dsa_ptr is a struct dsa_port (which is a
> huge structure), and I'd like to create a smaller structure. I'd like
> struct dsa_netdevice_ops to not be a part of this, so this is how the
> need to delete it arose.
>
> The established way for unrelated modules to react on a net device event
> is via netdevice notifiers. These have the advantage of loose coupling,
> i.e. they work even when DSA is built as module, without resorting to
> static inline functions (which cannot offer the desired data structure
> encapsulation).
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Why is this not using netlink?
Powered by blists - more mailing lists