]> git.baikalelectronics.ru Git - kernel.git/commit
net: lan966x: Fix assignment of the MAC address
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Fri, 13 May 2022 18:00:30 +0000 (20:00 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 17 May 2022 08:03:14 +0000 (10:03 +0200)
commitc71830063043f98231c6eddc891a6341346005f6
tree74b49b894d1f47cb4c4aa41e6cb592d394bd7dc5
parent556d0f7712c30b8488f76054212e5ac0da003b99
net: lan966x: Fix assignment of the MAC address

The following two scenarios were failing for lan966x.
1. If the port had the address X and then trying to assign the same
   address, then the HW was just removing this address because first it
   tries to learn new address and then delete the old one. As they are
   the same the HW remove it.
2. If the port eth0 was assigned the same address as one of the other
   ports eth1 then when assigning back the address to eth0 then the HW
   was deleting the address of eth1.

The case 1. is fixed by checking if the port has already the same
address while case 2. is fixed by checking if the address is used by any
other port.

Fixes: 178db1b95c6dac ("net: lan966x: add mactable support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Link: https://lore.kernel.org/r/20220513180030.3076793-1-horatiu.vultur@microchip.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/microchip/lan966x/lan966x_main.c