mlxsw: spectrum_switchdev: Check success of FDB add operation
authorShalom Toledo <shalomt@mellanox.com>
Thu, 1 Mar 2018 10:37:05 +0000 (11:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Mar 2018 06:41:11 +0000 (22:41 -0800)
commit2229dd5dd6c6d55465e197e77bfcd605d9bea475
tree950cbb785de7c861f8c3b633b01436710672ae1e
parent9f02a069bfdda6dcb5970cfe7ebab50859f58127
mlxsw: spectrum_switchdev: Check success of FDB add operation

[ Upstream commit 0a8a1bf17e3af34f1f8d2368916a6327f8b3bfd5 ]

Until now, we assumed that in case of error when adding FDB entries, the
write operation will fail, but this is not the case. Instead, we need to
check that the number of entries reported in the response is equal to
the number of entries specified in the request.

Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
Reported-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Reviewed-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_switchdev.c