mlxsw: spectrum_router: Correctly dump neighbour activity
commit224fb8cbefb229d9ce7b01ac5c4979bb0020cf38
authorArkadi Sharshevsky <arkadis@mellanox.com>
Fri, 11 Nov 2016 15:34:26 +0000 (11 16:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Nov 2016 09:11:36 +0000 (21 10:11 +0100)
treec69b01381892b72170dec6f54c4612d9d248a6fb
parent9092bbd64bd91d4cd08f9221368913f8cbec2a40
mlxsw: spectrum_router: Correctly dump neighbour activity

[ Upstream commit 42cdb338f40a98e6558bae35456fe86b6e90e1ef ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c