[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190131075013.GA27839@splinter>
Date: Thu, 31 Jan 2019 07:50:16 +0000
From: Ido Schimmel <idosch@...lanox.com>
To: Florian Fainelli <f.fainelli@...il.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"andrew@...n.ch" <andrew@...n.ch>,
"vivien.didelot@...il.com" <vivien.didelot@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
Jiri Pirko <jiri@...lanox.com>,
"ilias.apalodimas@...aro.org" <ilias.apalodimas@...aro.org>,
"ivan.khoronzhuk@...aro.org" <ivan.khoronzhuk@...aro.org>,
"roopa@...ulusnetworks.com" <roopa@...ulusnetworks.com>,
"nikolay@...ulusnetworks.com" <nikolay@...ulusnetworks.com>,
Petr Machata <petrm@...lanox.com>
Subject: Re: [PATCH net-next v2 01/12] net: bridge: multicast: Propagate
br_mc_disabled_update() return
On Wed, Jan 30, 2019 at 05:00:57PM -0800, Florian Fainelli wrote:
> On 1/29/19 11:36 PM, Ido Schimmel wrote:
> > On Tue, Jan 29, 2019 at 04:55:37PM -0800, Florian Fainelli wrote:
> >> -static void br_mc_disabled_update(struct net_device *dev, bool value)
> >> +static int br_mc_disabled_update(struct net_device *dev, bool value)
> >> {
> >> struct switchdev_attr attr = {
> >> .orig_dev = dev,
> >> .id = SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED,
> >> - .flags = SWITCHDEV_F_DEFER,
> >> + .flags = SWITCHDEV_F_DEFER | SWITCHDEV_F_SKIP_EOPNOTSUPP,
> >
> > Actually, since the operation is deferred I don't think the return value
> > from the driver is ever checked. Can you test it?
>
> You are right, you get a WARN() from switchdev_attr_port_set_now(), but
> this does not propagate back to the caller, so you can still create a
> bridge device and enslave a device successfully despite getting warnings
> on the console.
>
> >
> > I think it would be good to convert the attributes to use the switchdev
> > notifier like commit d17d9f5e5143 ("switchdev: Replace port obj add/del
> > SDO with a notification") did for objects. Then you can have your
> > listener veto the operation in the same context it is happening.
>
> Alright, working on it. Would you do that just for the attr_set, or for
> attr_get as well (to be symmetrical)?
Yes, then we can get rid of switchdev_ops completely.
Powered by blists - more mailing lists