]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: b53: serialize access to the ARL table
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 22 Oct 2021 18:43:07 +0000 (21:43 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Oct 2021 12:47:44 +0000 (13:47 +0100)
commit276ee1da840e2f0da8cb4aa6d64883628450259b
tree5585a8aec124503de2f7b23a092fbdfacf36c4b2
parent20ee21b38d5e7d501bfeb34cb100e0ed1e042fac
net: dsa: b53: serialize access to the ARL table

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/b53/b53_priv.h