From: Stephen Hemminger <stephen@networkplumber.org>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Richard Cochran <richardcochran@gmail.com>
Subject: Re: [RFC PATCH net-next] net: create a NETDEV_ETH_IOCTL notifier for DSA to reject PTP on DSA master
Date: Mon, 21 Mar 2022 14:44:57 -0700 [thread overview]
Message-ID: <20220321144457.7dc6e8e0@hermes.local> (raw)
In-Reply-To: <20220317225035.3475538-1-vladimir.oltean@nxp.com>
On Fri, 18 Mar 2022 00:50:35 +0200
Vladimir Oltean <vladimir.oltean@nxp.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@nxp.com>
Why is this not using netlink?
prev parent reply other threads:[~2022-03-21 23:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 22:50 [RFC PATCH net-next] net: create a NETDEV_ETH_IOCTL notifier for DSA to reject PTP on DSA master Vladimir Oltean
2022-03-21 20:28 ` Jakub Kicinski
2022-03-21 20:48 ` Vladimir Oltean
2022-03-21 21:22 ` Jakub Kicinski
2022-03-21 21:44 ` Stephen Hemminger [this message]
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=20220321144457.7dc6e8e0@hermes.local \
--to=stephen@networkplumber.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=vivien.didelot@gmail.com \
--cc=vladimir.oltean@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox