mlxsw: spectrum_router: Offload neighbours based on NUD state change
authorYotam Gigi <yotamg@mellanox.com>
Tue, 5 Jul 2016 09:27:44 +0000 (11:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2016 16:06:29 +0000 (09:06 -0700)
commita6bf9e933daf9609c3673e8348e7f95f3ef325c7
treefc5df7e6d823242911b31989054f3992dc26c5ba
parentc723c735fa6bacfdb01c4697c2cfeba142990d18
mlxsw: spectrum_router: Offload neighbours based on NUD state change

Listen to any NEIGH_UPDATE events sent and program the device
accordingly. If NUD state is VALID and neighbour isn't yet offloaded,
then program it into the device's table. Otherwise, just edit its
parameters.

If NUD state machine transitioned neighbour out of VALID state and it's
present in the device's table, then remove it.

Note that the device is programmed in delayed work, as the netevent
notification chain is atomic and prevents us from going to sleep.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c