On 10/22/21 7:16 AM, Vladimir Oltean wrote:
The b53 driver performs non-atomic transactions to the ARL table when
adding, deleting and reading FDB and MDB entries.
Traditionally these were all serialized by the rtnl_lock(), but now it
is possible that DSA calls ->port_fdb_add and ->port_fdb_del without
holding that lock.
So the driver must have its own serialization logic. Add a mutex and
hold it from all entry points (->port_fdb_{add,del,dump},
->port_mdb_{add,del}).
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Only if you need to spin a v2, small nit below:
[snip]
+ if (ret) {
+ mutex_unlock(&priv->arl_mutex);
return ret;
I would be tempted to create an out label and have all of those tests
goto that label in case of error, just so there is a single place where
we unlock the arl_mutex.
Thanks!
--
Florian