[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8ddd1fbf-69eb-3df3-0dd1-f39207c0369a@nvidia.com>
Date: Mon, 22 Mar 2021 19:00:03 +0200
From: Nikolay Aleksandrov <nikolay@...dia.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Tobias Waldekranz <tobias@...dekranz.com>,
Claudiu Manoil <claudiu.manoil@....com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Roopa Prabhu <roopa@...dia.com>, Jiri Pirko <jiri@...nulli.us>,
Ido Schimmel <idosch@...sch.org>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
UNGLinuxDriver@...rochip.com, Ivan Vecera <ivecera@...hat.com>,
linux-omap@...r.kernel.org,
Vladimir Oltean <vladimir.oltean@....com>
Subject: Re: [PATCH v3 net-next 08/12] net: dsa: replay port and host-joined
mdb entries when joining the bridge
On 22/03/2021 18:56, Vladimir Oltean wrote:
> On Mon, Mar 22, 2021 at 06:35:10PM +0200, Nikolay Aleksandrov wrote:
>>> + hlist_for_each_entry(mp, &br->mdb_list, mdb_node) {
>>
>> You cannot walk over these lists without the multicast lock or RCU. RTNL is not
>> enough because of various timers and leave messages that can alter both the mdb_list
>> and the port group lists. I'd prefer RCU to avoid blocking the bridge mcast.
>
> The trouble is that I need to emulate the calling context that is
> provided to SWITCHDEV_OBJ_ID_HOST_MDB and SWITCHDEV_OBJ_ID_PORT_MDB, and
> that means blocking context.
>
> So if I hold rcu_read_lock(), I need to queue up the mdb entries, and
> notify the driver only after I leave the RCU critical section. The
> memory footprint may temporarily blow up.
>
> In fact this is what I did in v1:
> https://patchwork.kernel.org/project/netdevbpf/patch/20210224114350.2791260-15-olteanv@gmail.com/
>
> I just figured I could get away with rtnl_mutex protection, but it looks
> like I can't. So I guess you prefer my v1?
>
Indeed, if you need a blocking context then you'd have to go with v1.
Powered by blists - more mailing lists