mlxsw: spectrum_router: Correctly dump neighbour activity
authorArkadi Sharshevsky <arkadis@mellanox.com>
Fri, 11 Nov 2016 15:34:26 +0000 (16:34 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 13 Nov 2016 17:51:00 +0000 (12:51 -0500)
commit42cdb338f40a98e6558bae35456fe86b6e90e1ef
tree3574728ce3bf65ab262de17abd6cc03e6dd1cd4a
parent2d644d4c7506646f9c4a2afceb7fd5f030bc0c9f
mlxsw: spectrum_router: Correctly dump neighbour activity

The device's neighbour table is periodically dumped in order to update
the kernel about active neighbours. A single dump session may span
multiple queries, until the response carries less records than requested
or when a record (can contain up to four neighbour entries) is not full.
Current code stops the session when the number of returned records is
zero, which can result in infinite loop in case of high packet rate.

Fix this by stopping the session according to the above logic.

Fixes: c723c735fa6b ("mlxsw: spectrum_router: Periodically update the kernel's neigh table")
Signed-off-by: Arkadi Sharshevsky <arkadis@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