]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
net: mscc: ocelot: serialize access to the MAC table
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 22 Oct 2021 18:43:06 +0000 (21:43 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Oct 2021 12:47:44 +0000 (13:47 +0100)
commitf2c4bdf62d765152c19d6f5e8f9b201535ffec87
tree729767e87446d15426e7adc50ae20d0f7e4d780c
parent1681ae1691ef418c3fd5d3bef48c4e2f3f98791f
net: mscc: ocelot: serialize access to the MAC table

DSA would like to remove the rtnl_lock from its
SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE handlers, and the felix driver uses
the same MAC table functions as ocelot.

This means that the MAC table functions will no longer be implicitly
serialized with respect to each other by the rtnl_mutex, we need to add
a dedicated lock in ocelot for the non-atomic operations of selecting a
MAC table row, reading/writing what we want and polling for completion.

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/ethernet/mscc/ocelot.c
include/soc/mscc/ocelot.h