In order to preserve comparisons of the DSA network device bound to the switch's CPU port, implement net_device::ndo_equal which will return true while doing net_device_ops pointer comparisons.
Network device drivers might do these checks to reject notifications targeting a different net_device instance and those could be non-functional because of the DSA overloading of net_device_ops. No such cases are known to exist in tree today. Signed-off-by: Florian Fainelli <f.faine...@gmail.com> --- net/dsa/master.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/dsa/master.c b/net/dsa/master.c index 480a61460c23..1c4f0736426e 100644 --- a/net/dsa/master.c +++ b/net/dsa/master.c @@ -226,6 +226,14 @@ static int dsa_master_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return err; } +static bool dsa_master_equal(struct net_device *dev, + const struct net_device_ops *ops) +{ + struct dsa_port *cpu_dp = dev->dsa_ptr; + + return cpu_dp->orig_ndo_ops == ops; +} + static int dsa_master_ethtool_setup(struct net_device *dev) { struct dsa_port *cpu_dp = dev->dsa_ptr; @@ -279,6 +287,7 @@ static int dsa_master_ndo_setup(struct net_device *dev) ops->ndo_get_phys_port_name = dsa_master_get_phys_port_name; ops->ndo_do_ioctl = dsa_master_ioctl; + ops->ndo_equal = dsa_master_equal; dev->netdev_ops = ops; -- 2.25.1