mlxsw_sp->acl_tcam_ops = &mlxsw_sp1_acl_tcam_ops;
        mlxsw_sp->nve_ops_arr = mlxsw_sp1_nve_ops_arr;
        mlxsw_sp->mac_mask = mlxsw_sp1_mac_mask;
+       mlxsw_sp->rif_ops_arr = mlxsw_sp1_rif_ops_arr;
 
        return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info);
 }
        mlxsw_sp->acl_tcam_ops = &mlxsw_sp2_acl_tcam_ops;
        mlxsw_sp->nve_ops_arr = mlxsw_sp2_nve_ops_arr;
        mlxsw_sp->mac_mask = mlxsw_sp2_mac_mask;
+       mlxsw_sp->rif_ops_arr = mlxsw_sp2_rif_ops_arr;
 
        return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info);
 }
 
        MLXSW_SP_RIF_TYPE_MAX,
 };
 
+struct mlxsw_sp_rif_ops;
+
+extern const struct mlxsw_sp_rif_ops *mlxsw_sp1_rif_ops_arr[];
+extern const struct mlxsw_sp_rif_ops *mlxsw_sp2_rif_ops_arr[];
+
 enum mlxsw_sp_fid_type {
        MLXSW_SP_FID_TYPE_8021Q,
        MLXSW_SP_FID_TYPE_8021D,
        const struct mlxsw_sp_mr_tcam_ops *mr_tcam_ops;
        const struct mlxsw_sp_acl_tcam_ops *acl_tcam_ops;
        const struct mlxsw_sp_nve_ops **nve_ops_arr;
+       const struct mlxsw_sp_rif_ops **rif_ops_arr;
 };
 
 static inline struct mlxsw_sp_upper *
 
        int i, err;
 
        type = mlxsw_sp_dev_rif_type(mlxsw_sp, params->dev);
-       ops = mlxsw_sp->router->rif_ops_arr[type];
+       ops = mlxsw_sp->rif_ops_arr[type];
 
        vr = mlxsw_sp_vr_get(mlxsw_sp, tb_id ? : RT_TABLE_MAIN, extack);
        if (IS_ERR(vr))
        if (!mlxsw_sp->router->rifs)
                return -ENOMEM;
 
-       mlxsw_sp->router->rif_ops_arr = mlxsw_sp1_rif_ops_arr;
-
        return 0;
 }