]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: Back up static FDB entries in kernel memory
authorVladimir Oltean <olteanv@gmail.com>
Tue, 25 Jun 2019 23:39:38 +0000 (02:39 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Jun 2019 18:03:21 +0000 (11:03 -0700)
commitca86007d36af687887dd980457f679b8e68ca855
tree5614f882f20e7af24e88dc29f73dd7ab9dfa53d3
parent7ad87166cda7c90a27da99d4eab1fe2a803cd11f
net: dsa: sja1105: Back up static FDB entries in kernel memory

After commit 5cb685ca9515 ("net: dsa: sja1105: Add support for
configuring address ageing time"), we started to reset the switch rather
often (each time the bridge core changes the ageing time on a switch
port).

The unfortunate reality is that SJA1105 doesn't have any {cold, warm,
whatever} reset mode in which it accepts a new configuration stream
without flushing the FDB.  Instead, in its world, the FDB *is* an
optional part of the static configuration.

So we play its game, and do what we also do for VLANs: for each 'bridge
fdb' command, we add the FDB entry through the dynamic interface, and we
append the in-kernel static config memory with info that we're going to
use later, when the next reset command is going to be issued.

The result is that 'bridge fdb' commands are now persistent (dynamically
learned entries are lost, but that's ok).

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_main.c