]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: serialize access to the MAC table
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 24 Oct 2021 17:17:51 +0000 (20:17 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Oct 2021 11:59:41 +0000 (12:59 +0100)
commit4ff1b75b22b3ef43c6f15705e611ef9c062e252e
tree16bb4823f558fb446ebf61ce0ea2e5643460115b
parent9719340c00fec0da08ba5acf76cd6cfb68b61294
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