mlxsw: spectrum_router: Mark RIF index as taken before creation
authorNir Dotan <nird@mellanox.com>
Sun, 20 Jan 2019 06:50:46 +0000 (06:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 20 Jan 2019 19:12:57 +0000 (11:12 -0800)
commita04563e4892c585d63870f33e4650a98e09b243f
tree906124a210ea8e5140b59cbe5bfd51e5e8b9bbb3
parent3c747500daedb037a9c9ccec61270c3aaf5d678e
mlxsw: spectrum_router: Mark RIF index as taken before creation

The presence of an allocated RIF in mlxsw_sp->router->rifs[rif_index] marks
that rif_index as taken.
Set the marking of a taken RIF to happen before calling ops->create in
order to allow creation of a GRE underlay RIF, which may be allocated and
created as part of an overlay RIF creation.

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