[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210210.153406.1774734837784815987.davem@davemloft.net>
Date: Wed, 10 Feb 2021 15:34:06 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: olteanv@...il.com
Cc: kuba@...nel.org, andrew@...n.ch, vivien.didelot@...il.com,
f.fainelli@...il.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, bridge@...ts.linux-foundation.org,
roopa@...dia.com, nikolay@...dia.com, jiri@...nulli.us,
idosch@...sch.org, claudiu.manoil@....com,
alexandre.belloni@...tlin.com, UNGLinuxDriver@...rochip.com,
vkochan@...vell.com, tchornyi@...vell.com,
grygorii.strashko@...com, ioana.ciornei@....com,
ivecera@...hat.com, linux-omap@...r.kernel.org
Subject: Re: [PATCH v3 net-next 07/11] net: prep switchdev drivers for
concurrent SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS
From: Vladimir Oltean <olteanv@...il.com>
Date: Wed, 10 Feb 2021 11:14:41 +0200
> From: Vladimir Oltean <vladimir.oltean@....com>
>
> Because the bridge will start offloading SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS
> while not serialized by any lock such as the br->lock spinlock, existing
> drivers that treat that attribute and cache the brport flags might no
> longer work correctly.
>
> The issue is that the brport flags are a single unsigned long bitmask,
> and the bridge only guarantees the validity of the changed bits, not the
> full state. So when offloading two concurrent switchdev attributes, such
> as one for BR_LEARNING and another for BR_FLOOD, it might happen that
> the flags having BR_FLOOD are written into the cached value, and this in
> turn disables the BR_LEARNING bit which was set previously.
>
> We can fix this across the board by keeping individual boolean variables
> for each brport flag. Note that mlxsw and prestera were setting the
> BR_LEARNING_SYNC flag too, but that appears to be just dead code, so I
> removed it.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
This needs updating because, as discussed, there is no race.
Powered by blists - more mailing lists