]> git.baikalelectronics.ru Git - kernel.git/commit
net: lan966x: Fix usage of lan966x->mac_lock when used by FDB
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Thu, 14 Jul 2022 19:40:40 +0000 (21:40 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Jul 2022 03:00:00 +0000 (20:00 -0700)
commita323e858eca4ff2e9d3b85523445b9e8793f36d0
tree953f205f20f82e79d5501db326d72d40b787fa71
parentd4d9d397f9d2c146f7474ac3de63dcc3ed8a6829
net: lan966x: Fix usage of lan966x->mac_lock when used by FDB

When the SW bridge was trying to add/remove entries to/from HW, the
access to HW was not protected by any lock. In this way, it was
possible to have race conditions.
Fix this by using the lan966x->mac_lock to protect parallel access to HW
for this cases.

Fixes: e507b4e791603 ("net: lan966x: More MAC table functionality")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microchip/lan966x/lan966x_mac.c