mlxsw: spectrum_fid: Allow FID lookup by its index
authorIdo Schimmel <idosch@mellanox.com>
Wed, 21 Nov 2018 08:02:45 +0000 (08:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Nov 2018 01:10:31 +0000 (17:10 -0800)
commit5d44a712e6af87842b6d3a01481ff020d1d2fddd
tree956e7bba3aa055bdbe8cbc5f0b65a09dd5ee6cff
parent5bae63d9b7627939eb67a7720548c82562ef7fa3
mlxsw: spectrum_fid: Allow FID lookup by its index

When processing a notification about a new FDB entry learned from a
VxLAN tunnel, the driver is provided with the FID index among other
parameters.

The driver potentially needs to update the bridge and VxLAN drivers
about the new entry using a pointer to the VxLAN device and the
corresponding VNI.

These two parameters are stored in the FID, so add a new function that
allows looking up a FID based on its index.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c