Commit 8e3482d6 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

mlxsw: spectrum_router: Flood packets to router after RIF creation

If a packet ingress the router but can't be assigned an ingress RIF,
it's dropped.

Therefore, in the case of RIF configured on top of a bridge, it makes
sense to start flooding broadcast packets to the router only after the
RIF was created.
Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b8f09a0
...@@ -3353,10 +3353,6 @@ static int mlxsw_sp_rif_bridge_create(struct mlxsw_sp *mlxsw_sp, ...@@ -3353,10 +3353,6 @@ static int mlxsw_sp_rif_bridge_create(struct mlxsw_sp *mlxsw_sp,
if (IS_ERR(vr)) if (IS_ERR(vr))
return PTR_ERR(vr); return PTR_ERR(vr);
err = mlxsw_sp_router_port_flood_set(mlxsw_sp, f->fid, true);
if (err)
goto err_port_flood_set;
rif = mlxsw_sp_rif_alloc(rif_index, vr->id, l3_dev, f, false); rif = mlxsw_sp_rif_alloc(rif_index, vr->id, l3_dev, f, false);
if (!rif) { if (!rif) {
err = -ENOMEM; err = -ENOMEM;
...@@ -3367,6 +3363,10 @@ static int mlxsw_sp_rif_bridge_create(struct mlxsw_sp *mlxsw_sp, ...@@ -3367,6 +3363,10 @@ static int mlxsw_sp_rif_bridge_create(struct mlxsw_sp *mlxsw_sp,
if (err) if (err)
goto err_rif_bridge_op; goto err_rif_bridge_op;
err = mlxsw_sp_router_port_flood_set(mlxsw_sp, f->fid, true);
if (err)
goto err_port_flood_set;
err = mlxsw_sp_rif_fdb_op(mlxsw_sp, l3_dev->dev_addr, f->fid, true); err = mlxsw_sp_rif_fdb_op(mlxsw_sp, l3_dev->dev_addr, f->fid, true);
if (err) if (err)
goto err_rif_fdb_op; goto err_rif_fdb_op;
...@@ -3380,12 +3380,12 @@ static int mlxsw_sp_rif_bridge_create(struct mlxsw_sp *mlxsw_sp, ...@@ -3380,12 +3380,12 @@ static int mlxsw_sp_rif_bridge_create(struct mlxsw_sp *mlxsw_sp,
return 0; return 0;
err_rif_fdb_op: err_rif_fdb_op:
mlxsw_sp_router_port_flood_set(mlxsw_sp, f->fid, false);
err_port_flood_set:
mlxsw_sp_rif_bridge_op(mlxsw_sp, rif, false); mlxsw_sp_rif_bridge_op(mlxsw_sp, rif, false);
err_rif_bridge_op: err_rif_bridge_op:
kfree(rif); kfree(rif);
err_rif_alloc: err_rif_alloc:
mlxsw_sp_router_port_flood_set(mlxsw_sp, f->fid, false);
err_port_flood_set:
mlxsw_sp_vr_put(vr); mlxsw_sp_vr_put(vr);
return err; return err;
} }
...@@ -3406,12 +3406,12 @@ void mlxsw_sp_rif_bridge_destroy(struct mlxsw_sp *mlxsw_sp, ...@@ -3406,12 +3406,12 @@ void mlxsw_sp_rif_bridge_destroy(struct mlxsw_sp *mlxsw_sp,
mlxsw_sp_rif_fdb_op(mlxsw_sp, l3_dev->dev_addr, f->fid, false); mlxsw_sp_rif_fdb_op(mlxsw_sp, l3_dev->dev_addr, f->fid, false);
mlxsw_sp_router_port_flood_set(mlxsw_sp, f->fid, false);
mlxsw_sp_rif_bridge_op(mlxsw_sp, rif, false); mlxsw_sp_rif_bridge_op(mlxsw_sp, rif, false);
kfree(rif); kfree(rif);
mlxsw_sp_router_port_flood_set(mlxsw_sp, f->fid, false);
mlxsw_sp_vr_put(vr); mlxsw_sp_vr_put(vr);
netdev_dbg(l3_dev, "RIF=%d destroyed\n", rif_index); netdev_dbg(l3_dev, "RIF=%d destroyed\n", rif_index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment