if (IS_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);
if (!rif) {
err = -ENOMEM;
if (err)
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);
if (err)
goto err_rif_fdb_op;
return 0;
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);
err_rif_bridge_op:
kfree(rif);
err_rif_alloc:
- mlxsw_sp_router_port_flood_set(mlxsw_sp, f->fid, false);
-err_port_flood_set:
mlxsw_sp_vr_put(vr);
return err;
}
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);
kfree(rif);
- mlxsw_sp_router_port_flood_set(mlxsw_sp, f->fid, false);
-
mlxsw_sp_vr_put(vr);
netdev_dbg(l3_dev, "RIF=%d destroyed\n", rif_index);