get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1529569/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1529569,
    "url": "http://patchwork.ozlabs.org/api/patches/1529569/",
    "web_url": "http://patchwork.ozlabs.org/project/ovn/patch/20210917214945.10284-4-odivlad@gmail.com/",
    "project": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/projects/68/",
        "name": "Open Virtual Network development",
        "link_name": "ovn",
        "list_id": "ovs-dev.openvswitch.org",
        "list_email": "ovs-dev@openvswitch.org",
        "web_url": "http://openvswitch.org/",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20210917214945.10284-4-odivlad@gmail.com>",
    "list_archive_url": null,
    "date": "2021-09-17T21:49:45",
    "name": "[ovs-dev,v3,3/3] ic: add support for routing tables in adv/learn routes",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ab310d137cafaa74076ca4fee5edba733c73c3a5",
    "submitter": {
        "id": 80943,
        "url": "http://patchwork.ozlabs.org/api/people/80943/",
        "name": "Vladislav Odintsov",
        "email": "odivlad@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/ovn/patch/20210917214945.10284-4-odivlad@gmail.com/mbox/",
    "series": [
        {
            "id": 262887,
            "url": "http://patchwork.ozlabs.org/api/series/262887/",
            "web_url": "http://patchwork.ozlabs.org/project/ovn/list/?series=262887",
            "date": "2021-09-17T21:49:42",
            "name": "Add multiple routing tables support to Logical Routers",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/262887/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1529569/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/1529569/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "dev@openvswitch.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "ovs-dev@lists.linuxfoundation.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20210112 header.b=E/GJDQke;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN>)",
            "smtp2.osuosl.org (amavisd-new);\n dkim=pass (2048-bit key) header.d=gmail.com"
        ],
        "Received": [
            "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4HB70w2hnsz9sW8\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 18 Sep 2021 07:50:24 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 878F7425BF;\n\tFri, 17 Sep 2021 21:50:21 +0000 (UTC)",
            "from smtp4.osuosl.org ([127.0.0.1])\n\tby localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id VGb4bQkHcq9a; Fri, 17 Sep 2021 21:50:19 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id 691BB425C6;\n\tFri, 17 Sep 2021 21:50:18 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 363D2C0021;\n\tFri, 17 Sep 2021 21:50:18 +0000 (UTC)",
            "from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 1520FC000F\n for <dev@openvswitch.org>; Fri, 17 Sep 2021 21:50:16 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 28FF3407F0\n for <dev@openvswitch.org>; Fri, 17 Sep 2021 21:50:07 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id fZubYcYoNkmO for <dev@openvswitch.org>;\n Fri, 17 Sep 2021 21:50:05 +0000 (UTC)",
            "from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com\n [IPv6:2a00:1450:4864:20::12b])\n by smtp2.osuosl.org (Postfix) with ESMTPS id 8C2E4407FC\n for <dev@openvswitch.org>; Fri, 17 Sep 2021 21:50:04 +0000 (UTC)",
            "by mail-lf1-x12b.google.com with SMTP id e15so106353lfr.10\n for <dev@openvswitch.org>; Fri, 17 Sep 2021 14:50:04 -0700 (PDT)",
            "from localhost.localdomain (109-252-131-59.dynamic.spd-mgts.ru.\n [109.252.131.59])\n by smtp.gmail.com with ESMTPSA id e17sm831979ljk.133.2021.09.17.14.50.00\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Fri, 17 Sep 2021 14:50:01 -0700 (PDT)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "whitelisted by SQLgrey-1.8.0",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=lKF0IJM4lO3lvOS8cdYWV9oBKrT90BF6G0U2ps/AJaE=;\n b=E/GJDQkeFvAkL6iM1GZE2AxvipXPK4qEeHu/kZ+e21ataRffaFbNsnwNY3ljAHlX43\n 5dNRvJ0aE90pbBDjCuPx8Yk68sOJNxegSKdaOObnkOa3YYek+OjZZ1Hz5sBoTRwKCS9x\n +3qwTVZA5DapoaNzDg1djV8eQFWY26iMUQohAXFvzmbGNzo6Eeds/xU7uw5DxVAMxha4\n McQ6CWIlJBiJmM/Z4jHm0OMRkCnHZoHB+liiIJbwOFVG7gMOCz2sOVnP7N0Uj7xatzOB\n ISh6u3Um94RtbEvVWPAuiqX6aQfaQ6/juyNUJOJT7bwzLT8v6nxGpOlVdPUx2xCRU7oZ\n gCBQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=lKF0IJM4lO3lvOS8cdYWV9oBKrT90BF6G0U2ps/AJaE=;\n b=J6Eo1KxdjdtCCxjufFYF7CQ5eLf/D+ygdm50bgdcxkXwuWrqQOr3DN9ArZMn0fu1tn\n rHidbnxtfLu6pYsimTpQCYvHwACia/48jBqZP2hHx/8p2oSVbjBtkZzHD/rzis/1LQIQ\n yTOWbamuqsGn39j8DRCeie/+mjgWXksSJmNJn1i9w/ZQYjnWDLouhx2X85tysktGmNcl\n pyeE/opJqbSf31EPvoOLtC9DDLbVpz67/y9D9qBmntfs5pUdsvV0MtCdFGcZxGaY9dag\n 1lyGGXg2KbSm58y00r2n/tUhmCDLub39dNOBKu6HIdKW8vX51Sok42V/kGsUeQaC/i9/\n 165g==",
        "X-Gm-Message-State": "AOAM5331vwQYmllbt4FiOtxksR7lh27WU8ijtjpt1BtPTVjOF26F5/sd\n blH0ZlfgVoKwIWAxz3fuzGs4ccfWF2A=",
        "X-Google-Smtp-Source": "\n ABdhPJzXs57xvQ0MEqVDJKqW5Tfq1C3RrZNp/+mp9mUTGBOmxZQiAoUNiROdyIpmgPVLej4vo6bYcg==",
        "X-Received": "by 2002:a2e:a58b:: with SMTP id\n m11mr11648883ljp.342.1631915401432;\n Fri, 17 Sep 2021 14:50:01 -0700 (PDT)",
        "From": "Vladislav Odintsov <odivlad@gmail.com>",
        "To": "dev@openvswitch.org",
        "Date": "Sat, 18 Sep 2021 00:49:45 +0300",
        "Message-Id": "<20210917214945.10284-4-odivlad@gmail.com>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20210917214945.10284-1-odivlad@gmail.com>",
        "References": "<20210917214945.10284-1-odivlad@gmail.com>",
        "MIME-Version": "1.0",
        "Cc": "Vladislav Odintsov <odivlad@gmail.com>",
        "Subject": "[ovs-dev] [PATCH ovn v3 3/3] ic: add support for routing tables in\n\tadv/learn routes",
        "X-BeenThere": "ovs-dev@openvswitch.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "<ovs-dev.openvswitch.org>",
        "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>",
        "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>",
        "List-Post": "<mailto:ovs-dev@openvswitch.org>",
        "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>",
        "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ovs-dev-bounces@openvswitch.org",
        "Sender": "\"dev\" <ovs-dev-bounces@openvswitch.org>"
    },
    "content": "Previously support for multiple routing tables was added\nto northd code.\nThis commit expands support for multiple routing tables\nby adding support of advertising and learning routes with\ntheir routing table information.\n\nTo utilize such feature, user must:\n1. create Logical Router in each AZ;\n2. create IC transit switch for each routing table, that\n   he/she needs;\n3. connect each TS with this LR;\n4. assign routing table for TS's LRP\n   (ovn-nbctl lrp-set-options <lrp> route_table=<>);\n5. enable routes sync (turn on learning and advertising\n   routes in NB_Global table);\n6. create LRPs for subnets in LR, create static routes\n   with supplying route_table parameter.\n\nNote 1: routes for directly-connected networks will be\nlearned to global routing table and if Logical Routers\nhave more than one Transit Switch, which interconnects\nthem, directly-connected routes will be added via each\ntransit switch port and configured as ECMP routes.\n\nNote 2: static routes within route tables will be advertised\nand learned only if interconnecting transit switch's LRPs\nwill have options:route_table same value as route's route_table\nvalue.\n\nSigned-off-by: Vladislav Odintsov <odivlad@gmail.com>\n---\n NEWS                |   4 +\n ic/ovn-ic.c         | 533 ++++++++++++++++++++++++++++----------------\n ovn-ic-sb.ovsschema |   5 +-\n ovn-ic-sb.xml       |  18 ++\n tests/ovn-ic.at     | 440 ++++++++++++++++++++++++++++++++++++\n 5 files changed, 807 insertions(+), 193 deletions(-)",
    "diff": "diff --git a/NEWS b/NEWS\nindex 8a21c029e..3855f0d48 100644\n--- a/NEWS\n+++ b/NEWS\n@@ -12,6 +12,10 @@ OVN v21.09.0 - xx xxx xxxx\n   - Allow static routes without nexthops.\n   - Enabled logical dp groups as a default.  CMS should disable it if not\n     desired.\n+  - Added support for multiple routing tables in Logical Router Static Routes\n+    and LRPs. OVN Interconnection supports routes' route tables as well.\n+    This requires to update schemas for OVN_Northdbound and OVN_IC_Southbound\n+    DBs.\n \n OVN v21.06.0 - 18 Jun 2021\n -------------------------\ndiff --git a/ic/ovn-ic.c b/ic/ovn-ic.c\nindex 92c83d730..3617c7235 100644\n--- a/ic/ovn-ic.c\n+++ b/ic/ovn-ic.c\n@@ -63,9 +63,11 @@ struct ic_context {\n     struct ovsdb_idl_txn *ovninb_txn;\n     struct ovsdb_idl_txn *ovnisb_txn;\n     struct ovsdb_idl_index *nbrec_ls_by_name;\n+    struct ovsdb_idl_index *nbrec_lrp_by_name;\n     struct ovsdb_idl_index *nbrec_port_by_name;\n     struct ovsdb_idl_index *sbrec_chassis_by_name;\n     struct ovsdb_idl_index *sbrec_port_binding_by_name;\n+    struct ovsdb_idl_index *icnbrec_transit_switch_by_name;\n     struct ovsdb_idl_index *icsbrec_port_binding_by_az;\n     struct ovsdb_idl_index *icsbrec_port_binding_by_ts;\n     struct ovsdb_idl_index *icsbrec_port_binding_by_ts_az;\n@@ -773,7 +775,7 @@ port_binding_run(struct ic_context *ctx,\n         icsbrec_port_binding_index_set_transit_switch(isb_pb_key, ts->name);\n \n         ICSBREC_PORT_BINDING_FOR_EACH_EQUAL (isb_pb, isb_pb_key,\n-                                            ctx->icsbrec_port_binding_by_ts) {\n+                                             ctx->icsbrec_port_binding_by_ts) {\n             if (isb_pb->availability_zone == az) {\n                 shash_add(&local_pbs, isb_pb->logical_port, isb_pb);\n                 shash_find_and_delete(&isb_all_local_pbs,\n@@ -844,7 +846,9 @@ port_binding_run(struct ic_context *ctx,\n struct ic_router_info {\n     struct hmap_node node;\n     const struct nbrec_logical_router *lr; /* key of hmap */\n-    const struct icsbrec_port_binding *isb_pb;\n+    const struct icsbrec_port_binding **isb_pbs;\n+    size_t n_isb_pbs;\n+    size_t n_allocated_isb_pbs;\n     struct hmap routes_learned;\n };\n \n@@ -854,6 +858,7 @@ struct ic_route_info {\n     struct in6_addr prefix;\n     unsigned int plen;\n     struct in6_addr nexthop;\n+    const char *route_table;\n \n     /* Either nb_route or nb_lrp is set and the other one must be NULL.\n      * - For a route that is learned from IC-SB, or a static route that is\n@@ -875,13 +880,15 @@ ic_route_hash(const struct in6_addr *prefix, unsigned int plen,\n \n static struct ic_route_info *\n ic_route_find(struct hmap *routes, const struct in6_addr *prefix,\n-              unsigned int plen, const struct in6_addr *nexthop)\n+              unsigned int plen, const struct in6_addr *nexthop,\n+              char *route_table)\n {\n     struct ic_route_info *r;\n     uint32_t hash = ic_route_hash(prefix, plen, nexthop);\n     HMAP_FOR_EACH_WITH_HASH (r, node, hash, routes) {\n         if (ipv6_addr_equals(&r->prefix, prefix) &&\n             r->plen == plen &&\n+            !strcmp(r->route_table ? r->route_table : \"\", route_table) &&\n             ipv6_addr_equals(&r->nexthop, nexthop)) {\n             return r;\n         }\n@@ -926,11 +933,19 @@ add_to_routes_learned(struct hmap *routes_learned,\n                      &prefix, &plen, &nexthop)) {\n         return false;\n     }\n+\n+    if (ic_route_find(routes_learned, &prefix, plen, &nexthop,\n+                      nb_route->route_table)) {\n+        /* Route is already added to learned in previous iteration. */\n+        return true;\n+    }\n+\n     struct ic_route_info *ic_route = xzalloc(sizeof *ic_route);\n     ic_route->prefix = prefix;\n     ic_route->plen = plen;\n     ic_route->nexthop = nexthop;\n     ic_route->nb_route = nb_route;\n+    ic_route->route_table = nb_route->route_table;\n     hmap_insert(routes_learned, &ic_route->node,\n                 ic_route_hash(&prefix, plen, &nexthop));\n     return true;\n@@ -1069,8 +1084,17 @@ static void\n add_to_routes_ad(struct hmap *routes_ad,\n                  const struct nbrec_logical_router_static_route *nb_route,\n                  const struct lport_addresses *nexthop_addresses,\n-                 const struct smap *nb_options)\n+                 const struct smap *nb_options, const char *route_table)\n {\n+    if (strcmp(route_table, nb_route->route_table)) {\n+        if (VLOG_IS_DBG_ENABLED()) {\n+            VLOG_DBG(\"Skip advertising route %s -> %s as its route table %s !=\"\n+                     \" %s of TS port\", nb_route->ip_prefix, nb_route->nexthop,\n+                     nb_route->route_table, route_table);\n+        }\n+        return;\n+    }\n+\n     struct in6_addr prefix, nexthop;\n     unsigned int plen;\n     if (!parse_route(nb_route->ip_prefix, nb_route->nexthop,\n@@ -1088,11 +1112,33 @@ add_to_routes_ad(struct hmap *routes_ad,\n         return;\n     }\n \n+    if (VLOG_IS_DBG_ENABLED()) {\n+        struct ds msg = DS_EMPTY_INITIALIZER;\n+\n+        ds_put_format(&msg, \"Advertising static route: %s -> %s, ic nexthop: \",\n+                      nb_route->ip_prefix, nb_route->nexthop);\n+\n+        if (IN6_IS_ADDR_V4MAPPED(&nexthop)) {\n+            ds_put_format(&msg, IP_FMT,\n+                          IP_ARGS(in6_addr_get_mapped_ipv4(&nexthop)));\n+        } else {\n+            ipv6_format_addr(&nexthop, &msg);\n+        }\n+\n+        ds_put_format(&msg, \", route_table: %s\", strlen(nb_route->route_table)\n+                                                 ? nb_route->route_table\n+                                                 : \"global\");\n+\n+        VLOG_DBG(\"%s\", ds_cstr(&msg));\n+        ds_destroy(&msg);\n+    }\n+\n     struct ic_route_info *ic_route = xzalloc(sizeof *ic_route);\n     ic_route->prefix = prefix;\n     ic_route->plen = plen;\n     ic_route->nexthop = nexthop;\n     ic_route->nb_route = nb_route;\n+    ic_route->route_table = nb_route->route_table;\n     hmap_insert(routes_ad, &ic_route->node,\n                 ic_route_hash(&prefix, plen, &nexthop));\n }\n@@ -1124,8 +1170,8 @@ add_network_to_routes_ad(struct hmap *routes_ad, const char *network,\n     if (VLOG_IS_DBG_ENABLED()) {\n         struct ds msg = DS_EMPTY_INITIALIZER;\n \n-        ds_put_format(&msg, \"Route ad: direct network %s of lrp %s, nexthop \",\n-                      network, nb_lrp->name);\n+        ds_put_format(&msg, \"Adding direct network route to global routing \"\n+                      \"table: %s of lrp %s, nexthop \", network, nb_lrp->name);\n \n         if (IN6_IS_ADDR_V4MAPPED(&nexthop)) {\n             ds_put_format(&msg, IP_FMT,\n@@ -1143,13 +1189,15 @@ add_network_to_routes_ad(struct hmap *routes_ad, const char *network,\n     ic_route->plen = plen;\n     ic_route->nexthop = nexthop;\n     ic_route->nb_lrp = nb_lrp;\n+\n+    /* directly-connected routes go to global route table */\n+    ic_route->route_table = NULL;\n     hmap_insert(routes_ad, &ic_route->node,\n                 ic_route_hash(&prefix, plen, &nexthop));\n }\n \n static bool\n-route_need_learn(struct in6_addr *prefix,\n-                 unsigned int plen,\n+route_need_learn(struct in6_addr *prefix, unsigned int plen,\n                  const struct smap *nb_options)\n {\n     if (!smap_get_bool(nb_options, \"ic-route-learn\", false)) {\n@@ -1172,70 +1220,146 @@ route_need_learn(struct in6_addr *prefix,\n     return true;\n }\n \n+static const char *\n+get_lrp_name_by_ts_port_name(struct ic_context *ctx, const char *ts_port_name)\n+{\n+    const struct nbrec_logical_switch_port *nb_lsp;\n+    const struct nbrec_logical_switch_port *nb_lsp_key =\n+        nbrec_logical_switch_port_index_init_row(ctx->nbrec_port_by_name);\n+    nbrec_logical_switch_port_index_set_name(nb_lsp_key, ts_port_name);\n+    nb_lsp = nbrec_logical_switch_port_index_find(ctx->nbrec_port_by_name,\n+                                                  nb_lsp_key);\n+    nbrec_logical_switch_port_index_destroy_row(nb_lsp_key);\n+\n+    if (!nb_lsp) {\n+        return NULL;\n+    }\n+\n+    return smap_get(&nb_lsp->options, \"router-port\");\n+}\n+\n+static const char *\n+get_route_table_by_lrp_name(struct ic_context *ctx, const char *lrp_name)\n+{\n+    const struct nbrec_logical_router_port *lrp;\n+    const struct nbrec_logical_router_port *lrp_key =\n+        nbrec_logical_router_port_index_init_row(ctx->nbrec_lrp_by_name);\n+    nbrec_logical_router_port_index_set_name(lrp_key, lrp_name);\n+    lrp = nbrec_logical_router_port_index_find(ctx->nbrec_lrp_by_name,\n+                                               lrp_key);\n+    nbrec_logical_router_port_index_destroy_row(lrp_key);\n+\n+    if (lrp) {\n+        return smap_get_def(&lrp->options, \"route_table\", \"\");\n+    }\n+    return \"\";  /* Global route table */\n+}\n+\n+static bool\n+lrp_is_ts_port(struct ic_context *ctx, struct ic_router_info *ic_lr,\n+               const char *lrp_name)\n+{\n+    const struct icsbrec_port_binding *isb_pb;\n+    const char *ts_lrp_name;\n+    for (int i = 0; i < ic_lr->n_isb_pbs; i++) {\n+        isb_pb = ic_lr->isb_pbs[i];\n+        ts_lrp_name = get_lrp_name_by_ts_port_name(ctx, isb_pb->logical_port);\n+        if (!strcmp(ts_lrp_name, lrp_name)) {\n+            return true;\n+        }\n+    }\n+    return false;\n+}\n+\n static void\n-sync_learned_route(struct ic_context *ctx,\n-                   const struct icsbrec_availability_zone *az,\n-                   struct ic_router_info *ic_lr)\n+sync_learned_routes(struct ic_context *ctx,\n+                    const struct icsbrec_availability_zone *az,\n+                    struct ic_router_info *ic_lr)\n {\n     ovs_assert(ctx->ovnnb_txn);\n     const struct icsbrec_route *isb_route;\n     const struct icsbrec_route *isb_route_key =\n         icsbrec_route_index_init_row(ctx->icsbrec_route_by_ts);\n \n-    icsbrec_route_index_set_transit_switch(isb_route_key,\n-                                           ic_lr->isb_pb->transit_switch);\n+    const struct nbrec_nb_global *nb_global =\n+        nbrec_nb_global_first(ctx->ovnnb_idl);\n+    ovs_assert(nb_global);\n \n-    ICSBREC_ROUTE_FOR_EACH_EQUAL (isb_route, isb_route_key,\n-                                  ctx->icsbrec_route_by_ts) {\n-        if (isb_route->availability_zone == az) {\n-            continue;\n-        }\n-        struct in6_addr prefix, nexthop;\n-        unsigned int plen;\n-        if (!parse_route(isb_route->ip_prefix, isb_route->nexthop,\n-                         &prefix, &plen, &nexthop)) {\n-            static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);\n-            VLOG_WARN_RL(&rl, \"Bad route format in IC-SB: %s -> %s. Ignored.\",\n-                         isb_route->ip_prefix, isb_route->nexthop);\n-            continue;\n-        }\n-        const struct nbrec_nb_global *nb_global =\n-            nbrec_nb_global_first(ctx->ovnnb_idl);\n-        ovs_assert(nb_global);\n-        if (!route_need_learn(&prefix, plen, &nb_global->options)) {\n-            continue;\n-        }\n-        struct ic_route_info *route_learned\n-            = ic_route_find(&ic_lr->routes_learned, &prefix, plen, &nexthop);\n-        if (route_learned) {\n-            /* Sync external-ids */\n-            struct uuid ext_id;\n-            smap_get_uuid(&route_learned->nb_route->external_ids,\n-                          \"ic-learned-route\", &ext_id);\n-            if (!uuid_equals(&ext_id, &isb_route->header_.uuid)) {\n+    const char *lrp_name, *ts_route_table;\n+    const struct icsbrec_port_binding *isb_pb;\n+    for (int i = 0; i < ic_lr->n_isb_pbs; i++) {\n+        isb_pb = ic_lr->isb_pbs[i];\n+        lrp_name = get_lrp_name_by_ts_port_name(ctx, isb_pb->logical_port);\n+        ts_route_table = get_route_table_by_lrp_name(ctx, lrp_name);\n+\n+        icsbrec_route_index_set_transit_switch(isb_route_key,\n+                                               isb_pb->transit_switch);\n+\n+        ICSBREC_ROUTE_FOR_EACH_EQUAL (isb_route, isb_route_key,\n+                                      ctx->icsbrec_route_by_ts) {\n+            if (isb_route->availability_zone == az) {\n+                continue;\n+            }\n+\n+            if (strlen(isb_route->route_table) &&\n+                strcmp(isb_route->route_table, ts_route_table)) {\n+                if (VLOG_IS_DBG_ENABLED()) {\n+                    VLOG_DBG(\"Skip learning static route %s -> %s as either \"\n+                             \"its route table %s != %s of TS port or \",\n+                             isb_route->ip_prefix, isb_route->nexthop,\n+                             isb_route->route_table, ts_route_table);\n+                }\n+                continue;\n+            }\n+\n+            struct in6_addr prefix, nexthop;\n+            unsigned int plen;\n+            if (!parse_route(isb_route->ip_prefix, isb_route->nexthop,\n+                             &prefix, &plen, &nexthop)) {\n+                static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);\n+                VLOG_WARN_RL(&rl, \"Bad route format in IC-SB: %s -> %s. Ignored.\",\n+                             isb_route->ip_prefix, isb_route->nexthop);\n+                continue;\n+            }\n+            if (!route_need_learn(&prefix, plen, &nb_global->options)) {\n+                continue;\n+            }\n+            struct ic_route_info *route_learned\n+                = ic_route_find(&ic_lr->routes_learned, &prefix, plen,\n+                                &nexthop, isb_route->route_table);\n+            if (route_learned) {\n+                /* Sync external-ids */\n+                struct uuid ext_id;\n+                smap_get_uuid(&route_learned->nb_route->external_ids,\n+                              \"ic-learned-route\", &ext_id);\n+                if (!uuid_equals(&ext_id, &isb_route->header_.uuid)) {\n+                    char *uuid_s =\n+                        xasprintf(UUID_FMT,\n+                                  UUID_ARGS(&isb_route->header_.uuid));\n+                    nbrec_logical_router_static_route_update_external_ids_setkey(\n+                        route_learned->nb_route, \"ic-learned-route\", uuid_s);\n+                    free(uuid_s);\n+                }\n+                hmap_remove(&ic_lr->routes_learned, &route_learned->node);\n+                free(route_learned);\n+            } else {\n+                /* Create the missing route in NB. */\n+                const struct nbrec_logical_router_static_route *nb_route =\n+                    nbrec_logical_router_static_route_insert(ctx->ovnnb_txn);\n+                nbrec_logical_router_static_route_set_ip_prefix(nb_route,\n+                    isb_route->ip_prefix);\n+                nbrec_logical_router_static_route_set_nexthop(nb_route,\n+                    isb_route->nexthop);\n                 char *uuid_s = xasprintf(UUID_FMT,\n                                          UUID_ARGS(&isb_route->header_.uuid));\n+                nbrec_logical_router_static_route_set_route_table(nb_route,\n+                    isb_route->route_table);\n                 nbrec_logical_router_static_route_update_external_ids_setkey(\n-                    route_learned->nb_route, \"ic-learned-route\", uuid_s);\n+                    nb_route, \"ic-learned-route\", uuid_s);\n                 free(uuid_s);\n+                nbrec_logical_router_update_static_routes_addvalue(ic_lr->lr,\n+                    nb_route);\n             }\n-            hmap_remove(&ic_lr->routes_learned, &route_learned->node);\n-            free(route_learned);\n-        } else {\n-            /* Create the missing route in NB. */\n-            const struct nbrec_logical_router_static_route *nb_route =\n-                nbrec_logical_router_static_route_insert(ctx->ovnnb_txn);\n-            nbrec_logical_router_static_route_set_ip_prefix(\n-                nb_route, isb_route->ip_prefix);\n-            nbrec_logical_router_static_route_set_nexthop(\n-                nb_route, isb_route->nexthop);\n-            char *uuid_s = xasprintf(UUID_FMT,\n-                                     UUID_ARGS(&isb_route->header_.uuid));\n-            nbrec_logical_router_static_route_update_external_ids_setkey(\n-                nb_route, \"ic-learned-route\", uuid_s);\n-            free(uuid_s);\n-            nbrec_logical_router_update_static_routes_addvalue(\n-                ic_lr->lr, nb_route);\n         }\n     }\n     icsbrec_route_index_destroy_row(isb_route_key);\n@@ -1271,10 +1395,10 @@ ad_route_sync_external_ids(const struct ic_route_info *route_adv,\n \n /* Sync routes from routes_ad to IC-SB. */\n static void\n-advertise_route(struct ic_context *ctx,\n-                const struct icsbrec_availability_zone *az,\n-                const char *ts_name,\n-                struct hmap *routes_ad)\n+advertise_routes(struct ic_context *ctx,\n+                 const struct icsbrec_availability_zone *az,\n+                 const char *ts_name,\n+                 struct hmap *routes_ad)\n {\n     ovs_assert(ctx->ovnisb_txn);\n     const struct icsbrec_route *isb_route;\n@@ -1298,7 +1422,8 @@ advertise_route(struct ic_context *ctx,\n             continue;\n         }\n         struct ic_route_info *route_adv =\n-            ic_route_find(routes_ad, &prefix, plen, &nexthop);\n+            ic_route_find(routes_ad, &prefix, plen, &nexthop,\n+                          isb_route->route_table);\n         if (!route_adv) {\n             /* Delete the extra route from IC-SB. */\n             VLOG_DBG(\"Delete route %s -> %s from IC-SB, which is not found\"\n@@ -1338,6 +1463,9 @@ advertise_route(struct ic_context *ctx,\n         }\n         icsbrec_route_set_ip_prefix(isb_route, prefix_s);\n         icsbrec_route_set_nexthop(isb_route, nexthop_s);\n+        icsbrec_route_set_route_table(isb_route, route_adv->route_table\n+                                                 ? route_adv->route_table\n+                                                 : \"\");\n         free(prefix_s);\n         free(nexthop_s);\n \n@@ -1348,23 +1476,97 @@ advertise_route(struct ic_context *ctx,\n     }\n }\n \n-static const char *\n-get_lrp_name_by_ts_port_name(struct ic_context *ctx,\n-                           const char *ts_port_name)\n+static void\n+build_ts_routes_to_adv(struct ic_context *ctx,\n+                       struct ic_router_info *ic_lr,\n+                       struct hmap *routes_ad,\n+                       struct lport_addresses *ts_port_addrs,\n+                       const struct nbrec_nb_global *nb_global,\n+                       const char *ts_route_table)\n {\n-    const struct nbrec_logical_switch_port *nb_lsp;\n-    const struct nbrec_logical_switch_port *nb_lsp_key =\n-        nbrec_logical_switch_port_index_init_row(ctx->nbrec_port_by_name);\n-    nbrec_logical_switch_port_index_set_name(nb_lsp_key, ts_port_name);\n-    nb_lsp = nbrec_logical_switch_port_index_find(ctx->nbrec_port_by_name,\n-                                                  nb_lsp_key);\n-    nbrec_logical_switch_port_index_destroy_row(nb_lsp_key);\n+    const struct nbrec_logical_router *lr = ic_lr->lr;\n+\n+    /* Check static routes of the LR */\n+    for (int i = 0; i < lr->n_static_routes; i++) {\n+        const struct nbrec_logical_router_static_route *nb_route\n+            = lr->static_routes[i];\n+        struct uuid isb_uuid;\n+        if (smap_get_uuid(&nb_route->external_ids, \"ic-learned-route\",\n+                          &isb_uuid)) {\n+            /* It is a learned route */\n+            if (!add_to_routes_learned(&ic_lr->routes_learned, nb_route)) {\n+                static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);\n+                VLOG_WARN_RL(&rl, \"Bad format of learned route in NB: \"\n+                             \"%s -> %s. Delete it.\", nb_route->ip_prefix,\n+                             nb_route->nexthop);\n+                nbrec_logical_router_update_static_routes_delvalue(lr,\n+                    nb_route);\n+            }\n+        } else {\n+            /* It may be a route to be advertised */\n+            add_to_routes_ad(routes_ad, nb_route, ts_port_addrs,\n+                             &nb_global->options, ts_route_table);\n+        }\n+    }\n \n-    if (!nb_lsp) {\n-        return NULL;\n+    /* Check directly-connected subnets of the LR */\n+    for (int i = 0; i < lr->n_ports; i++) {\n+        const struct nbrec_logical_router_port *lrp = lr->ports[i];\n+        if (!lrp_is_ts_port(ctx, ic_lr, lrp->name)) {\n+            for (int j = 0; j < lrp->n_networks; j++) {\n+                add_network_to_routes_ad(routes_ad, lrp->networks[j], lrp,\n+                                         ts_port_addrs,\n+                                         &nb_global->options);\n+            }\n+        } else {\n+            /* The router port of the TS port is ignored. */\n+            VLOG_DBG(\"Skip advertising direct route of lrp %s (TS port)\",\n+                     lrp->name);\n+        }\n     }\n+}\n \n-    return smap_get(&nb_lsp->options, \"router-port\");\n+static void\n+advertise_lr_routes(struct ic_context *ctx,\n+                    const struct icsbrec_availability_zone *az,\n+                    struct ic_router_info *ic_lr)\n+{\n+    const struct nbrec_nb_global *nb_global =\n+        nbrec_nb_global_first(ctx->ovnnb_idl);\n+    ovs_assert(nb_global);\n+\n+    const struct icsbrec_port_binding *isb_pb;\n+    const char *lrp_name, *route_table;\n+    struct lport_addresses ts_port_addrs;\n+    const struct nbrec_logical_router *lr = ic_lr->lr;\n+    const struct icnbrec_transit_switch *ts, *key =\n+        icnbrec_transit_switch_index_init_row(\n+            ctx->icnbrec_transit_switch_by_name);\n+\n+    struct hmap routes_ad = HMAP_INITIALIZER(&routes_ad);\n+    for (int i = 0; i < ic_lr->n_isb_pbs; i++) {\n+        isb_pb = ic_lr->isb_pbs[i];\n+        icnbrec_transit_switch_index_set_name(key, isb_pb->transit_switch);\n+        ts = icnbrec_transit_switch_index_find(\n+            ctx->icnbrec_transit_switch_by_name, key);\n+\n+        if (!extract_lsp_addresses(isb_pb->address, &ts_port_addrs)) {\n+            static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);\n+            VLOG_INFO_RL(&rl, \"Route sync ignores port %s on ts %s for router\"\n+                         \" %s because the addresses are invalid.\",\n+                         isb_pb->logical_port, isb_pb->transit_switch,\n+                         lr->name);\n+            continue;\n+        }\n+        lrp_name = get_lrp_name_by_ts_port_name(ctx, isb_pb->logical_port);\n+        route_table = get_route_table_by_lrp_name(ctx, lrp_name);\n+        build_ts_routes_to_adv(ctx, ic_lr, &routes_ad, &ts_port_addrs,\n+                               nb_global, route_table);\n+        advertise_routes(ctx, az, ts->name, &routes_ad);\n+        destroy_lport_addresses(&ts_port_addrs);\n+    }\n+    hmap_destroy(&routes_ad);\n+    icnbrec_transit_switch_index_destroy_row(key);\n }\n \n static void\n@@ -1375,131 +1577,70 @@ route_run(struct ic_context *ctx,\n         return;\n     }\n \n-    const struct nbrec_nb_global *nb_global =\n-        nbrec_nb_global_first(ctx->ovnnb_idl);\n-    ovs_assert(nb_global);\n-\n-    const struct icnbrec_transit_switch *ts;\n-    ICNBREC_TRANSIT_SWITCH_FOR_EACH (ts, ctx->ovninb_idl) {\n-        struct hmap ic_lrs = HMAP_INITIALIZER(&ic_lrs);\n-        struct hmap routes_ad = HMAP_INITIALIZER(&routes_ad);\n-\n-        const struct icsbrec_port_binding *isb_pb;\n-        const struct icsbrec_port_binding *isb_pb_key =\n-            icsbrec_port_binding_index_init_row(\n-                ctx->icsbrec_port_binding_by_ts_az);\n-        icsbrec_port_binding_index_set_transit_switch(isb_pb_key, ts->name);\n-        icsbrec_port_binding_index_set_availability_zone(isb_pb_key, az);\n-\n-        /* Each port on TS maps to a logical router, which is stored in the\n-         * external_ids:router-id of the IC SB port_binding record. */\n-        ICSBREC_PORT_BINDING_FOR_EACH_EQUAL (isb_pb, isb_pb_key,\n-                                             ctx->icsbrec_port_binding_by_ts_az)\n-        {\n-            const char *ts_lrp_name =\n-                get_lrp_name_by_ts_port_name(ctx, isb_pb->logical_port);\n-            if (!ts_lrp_name) {\n-                static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);\n-                VLOG_WARN_RL(&rl, \"Route sync ignores port %s on ts %s \"\n-                             \"because logical router port is not found in NB.\",\n-                             isb_pb->logical_port, ts->name);\n-                continue;\n-            }\n+    struct hmap ic_lrs = HMAP_INITIALIZER(&ic_lrs);\n+    const struct icsbrec_port_binding *isb_pb;\n+    const struct icsbrec_port_binding *isb_pb_key =\n+        icsbrec_port_binding_index_init_row(ctx->icsbrec_port_binding_by_az);\n+    icsbrec_port_binding_index_set_availability_zone(isb_pb_key, az);\n \n-            struct uuid lr_uuid;\n-            if (!smap_get_uuid(&isb_pb->external_ids, \"router-id\", &lr_uuid)) {\n-                VLOG_DBG(\"IC-SB Port_Binding %s doesn't have \"\n-                         \"external_ids:router-id set.\", isb_pb->logical_port);\n-                continue;\n-            }\n-            const struct nbrec_logical_router *lr\n-                = nbrec_logical_router_get_for_uuid(ctx->ovnnb_idl, &lr_uuid);\n-            if (!lr) {\n-                continue;\n-            }\n+    /* Each port on TS maps to a logical router, which is stored in the\n+     * external_ids:router-id of the IC SB port_binding record.\n+     * Here we build info for interconnected Logical Router:\n+     * collect IC Port Binding to process routes sync later on. */\n+    ICSBREC_PORT_BINDING_FOR_EACH_EQUAL (isb_pb, isb_pb_key,\n+                                         ctx->icsbrec_port_binding_by_az)\n+    {\n+        const char *ts_lrp_name =\n+            get_lrp_name_by_ts_port_name(ctx, isb_pb->logical_port);\n+        if (!ts_lrp_name) {\n+            static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);\n+            VLOG_WARN_RL(&rl, \"Route sync ignores port %s on ts %s because \"\n+                         \"logical router port is not found in NB. Deleting it\",\n+                         isb_pb->logical_port, isb_pb->transit_switch);\n+            icsbrec_port_binding_delete(isb_pb);\n+            continue;\n+        }\n \n-            if (ic_router_find(&ic_lrs, lr)) {\n-                static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);\n-                VLOG_INFO_RL(&rl, \"Route sync ignores port %s on ts %s for \"\n-                             \"router %s because the router has another port \"\n-                             \"connected to same ts.\", isb_pb->logical_port,\n-                             ts->name, lr->name);\n-                continue;\n-            }\n+        struct uuid lr_uuid;\n+        if (!smap_get_uuid(&isb_pb->external_ids, \"router-id\", &lr_uuid)) {\n+            VLOG_DBG(\"IC-SB Port_Binding %s doesn't have \"\n+                     \"external_ids:router-id set.\", isb_pb->logical_port);\n+            continue;\n+        }\n \n-            struct lport_addresses ts_port_addrs;\n-            if (!extract_lsp_addresses(isb_pb->address, &ts_port_addrs)) {\n-                static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 1);\n-                VLOG_INFO_RL(&rl, \"Route sync ignores port %s on ts %s for \"\n-                             \"router %s because the addresses are invalid.\",\n-                             isb_pb->logical_port, ts->name, lr->name);\n-                continue;\n-            }\n+        const struct nbrec_logical_router *lr\n+            = nbrec_logical_router_get_for_uuid(ctx->ovnnb_idl, &lr_uuid);\n+        if (!lr) {\n+            continue;\n+        }\n \n-            struct ic_router_info *ic_lr = xzalloc(sizeof *ic_lr);\n+        struct ic_router_info *ic_lr = ic_router_find(&ic_lrs, lr);\n+        if (!ic_lr) {\n+            ic_lr = xzalloc(sizeof *ic_lr);\n             ic_lr->lr = lr;\n-            ic_lr->isb_pb = isb_pb;\n             hmap_init(&ic_lr->routes_learned);\n             hmap_insert(&ic_lrs, &ic_lr->node, uuid_hash(&lr->header_.uuid));\n-\n-            /* Check static routes of the LR */\n-            for (int i = 0; i < lr->n_static_routes; i++) {\n-                const struct nbrec_logical_router_static_route *nb_route\n-                    = lr->static_routes[i];\n-                struct uuid isb_uuid;\n-                if (smap_get_uuid(&nb_route->external_ids,\n-                                  \"ic-learned-route\", &isb_uuid)) {\n-                    /* It is a learned route */\n-                    if (!add_to_routes_learned(&ic_lr->routes_learned,\n-                                               nb_route)) {\n-                        static struct vlog_rate_limit rl =\n-                            VLOG_RATE_LIMIT_INIT(5, 1);\n-                        VLOG_WARN_RL(&rl, \"Bad format of learned route in NB:\"\n-                                     \" %s -> %s. Delete it.\",\n-                                     nb_route->ip_prefix, nb_route->nexthop);\n-                        nbrec_logical_router_update_static_routes_delvalue(\n-                            lr, nb_route);\n-                    }\n-                } else {\n-                    /* It may be a route to be advertised */\n-                    add_to_routes_ad(&routes_ad, nb_route, &ts_port_addrs,\n-                                     &nb_global->options);\n-                }\n-            }\n-\n-            /* Check direct-connected subnets of the LR */\n-            for (int i = 0; i < lr->n_ports; i++) {\n-                const struct nbrec_logical_router_port *lrp = lr->ports[i];\n-                if (!strcmp(lrp->name, ts_lrp_name)) {\n-                    /* The router port of the TS port is ignored. */\n-                    VLOG_DBG(\"Route ad: skip lrp %s (TS port: %s)\",\n-                             lrp->name, isb_pb->logical_port);\n-                    continue;\n-                }\n-\n-                for (int j = 0; j < lrp->n_networks; j++) {\n-                    add_network_to_routes_ad(&routes_ad, lrp->networks[j],\n-                                             lrp, &ts_port_addrs,\n-                                             &nb_global->options);\n-                }\n-            }\n-\n-            destroy_lport_addresses(&ts_port_addrs);\n         }\n-        icsbrec_port_binding_index_destroy_row(isb_pb_key);\n-\n-        advertise_route(ctx, az, ts->name, &routes_ad);\n-        hmap_destroy(&routes_ad);\n \n-        struct ic_router_info *ic_lr, *next;\n-        HMAP_FOR_EACH_SAFE (ic_lr, next, node, &ic_lrs) {\n-            sync_learned_route(ctx, az, ic_lr);\n-            hmap_destroy(&ic_lr->routes_learned);\n-            hmap_remove(&ic_lrs, &ic_lr->node);\n-            free(ic_lr);\n+        if (ic_lr->n_isb_pbs == ic_lr->n_allocated_isb_pbs) {\n+            ic_lr->isb_pbs = x2nrealloc(ic_lr->isb_pbs,\n+                                        &ic_lr->n_allocated_isb_pbs,\n+                                        sizeof *ic_lr->isb_pbs);\n         }\n-        hmap_destroy(&ic_lrs);\n+        ic_lr->isb_pbs[ic_lr->n_isb_pbs++] = isb_pb;\n     }\n+    icsbrec_port_binding_index_destroy_row(isb_pb_key);\n+\n+    struct ic_router_info *ic_lr, *next;\n+    HMAP_FOR_EACH_SAFE (ic_lr, next, node, &ic_lrs) {\n+        advertise_lr_routes(ctx, az, ic_lr);\n+        sync_learned_routes(ctx, az, ic_lr);\n+        free(ic_lr->isb_pbs);\n+        hmap_destroy(&ic_lr->routes_learned);\n+        hmap_remove(&ic_lrs, &ic_lr->node);\n+        free(ic_lr);\n+    }\n+    hmap_destroy(&ic_lrs);\n }\n \n static void\n@@ -1697,6 +1838,9 @@ main(int argc, char *argv[])\n     struct ovsdb_idl_index *nbrec_port_by_name\n         = ovsdb_idl_index_create1(ovnnb_idl_loop.idl,\n                                   &nbrec_logical_switch_port_col_name);\n+    struct ovsdb_idl_index *nbrec_lrp_by_name\n+        = ovsdb_idl_index_create1(ovnnb_idl_loop.idl,\n+                                  &nbrec_logical_router_port_col_name);\n     struct ovsdb_idl_index *sbrec_port_binding_by_name\n         = ovsdb_idl_index_create1(ovnsb_idl_loop.idl,\n                                   &sbrec_port_binding_col_logical_port);\n@@ -1704,6 +1848,10 @@ main(int argc, char *argv[])\n         = ovsdb_idl_index_create1(ovnsb_idl_loop.idl,\n                                   &sbrec_chassis_col_name);\n \n+    struct ovsdb_idl_index *icnbrec_transit_switch_by_name\n+        = ovsdb_idl_index_create1(ovninb_idl_loop.idl,\n+                                  &icnbrec_transit_switch_col_name);\n+\n     struct ovsdb_idl_index *icsbrec_port_binding_by_az\n         = ovsdb_idl_index_create1(ovnisb_idl_loop.idl,\n                                   &icsbrec_port_binding_col_availability_zone);\n@@ -1762,9 +1910,12 @@ main(int argc, char *argv[])\n                 .ovnisb_idl = ovnisb_idl_loop.idl,\n                 .ovnisb_txn = ovsdb_idl_loop_run(&ovnisb_idl_loop),\n                 .nbrec_ls_by_name = nbrec_ls_by_name,\n+                .nbrec_lrp_by_name = nbrec_lrp_by_name,\n                 .nbrec_port_by_name = nbrec_port_by_name,\n                 .sbrec_port_binding_by_name = sbrec_port_binding_by_name,\n                 .sbrec_chassis_by_name = sbrec_chassis_by_name,\n+                .icnbrec_transit_switch_by_name =\n+                    icnbrec_transit_switch_by_name,\n                 .icsbrec_port_binding_by_az = icsbrec_port_binding_by_az,\n                 .icsbrec_port_binding_by_ts = icsbrec_port_binding_by_ts,\n                 .icsbrec_port_binding_by_ts_az = icsbrec_port_binding_by_ts_az,\ndiff --git a/ovn-ic-sb.ovsschema b/ovn-ic-sb.ovsschema\nindex 5364b21b4..140ced149 100644\n--- a/ovn-ic-sb.ovsschema\n+++ b/ovn-ic-sb.ovsschema\n@@ -1,7 +1,7 @@\n {\n     \"name\": \"OVN_IC_Southbound\",\n-    \"version\": \"1.0.0\",\n-    \"cksum\": \"108951192 6585\",\n+    \"version\": \"1.1.0\",\n+    \"cksum\": \"3076915724 6636\",\n     \"tables\": {\n         \"IC_SB_Global\": {\n             \"columns\": {\n@@ -92,6 +92,7 @@\n                 \"transit_switch\": {\"type\": \"string\"},\n                 \"availability_zone\": {\"type\": {\"key\": {\"type\": \"uuid\",\n                                       \"refTable\": \"Availability_Zone\"}}},\n+                \"route_table\": {\"type\": \"string\"},\n                 \"ip_prefix\": {\"type\": \"string\"},\n                 \"nexthop\": {\"type\": \"string\"},\n                 \"external_ids\": {\ndiff --git a/ovn-ic-sb.xml b/ovn-ic-sb.xml\nindex 3582cff47..2f2ecf952 100644\n--- a/ovn-ic-sb.xml\n+++ b/ovn-ic-sb.xml\n@@ -306,6 +306,24 @@\n         The availability zone that has advertised the route.\n       </column>\n \n+      <column name=\"route_table\">\n+        Route table within which this route was created.\n+        Empty value means \"global\" routing table.\n+        <p>\n+        Routes for directly-connected networks will be\n+        learned to global routing table and if Logical Routers\n+        have more than one Transit Switch, which interconnects\n+        them, directly-connected routes will be added via each\n+        transit switch port and configured as ECMP routes.\n+        </p>\n+        <p>\n+        Static routes within route tables will be advertised\n+        and learned only if interconnecting transit switch's LRPs\n+        will have <code>options:route_table</code> same value as\n+        route's <code>route_table</code> value.\n+        </p>\n+      </column>\n+\n       <column name=\"ip_prefix\">\n         IP prefix of this route (e.g. 192.168.100.0/24).\n       </column>\ndiff --git a/tests/ovn-ic.at b/tests/ovn-ic.at\nindex 3aab54362..5803f76e9 100644\n--- a/tests/ovn-ic.at\n+++ b/tests/ovn-ic.at\n@@ -430,3 +430,443 @@ OVN_CLEANUP_IC([az1], [az2])\n \n AT_CLEANUP\n ])\n+\n+OVN_FOR_EACH_NORTHD([\n+AT_SETUP([ovn-ic -- route sync -- route tables])\n+\n+ovn_init_ic_db\n+ovn-ic-nbctl ts-add ts1\n+\n+for i in 1 2; do\n+    ovn_start az$i\n+    ovn_as az$i\n+\n+    # Enable route learning at AZ level\n+    ovn-nbctl set nb_global . options:ic-route-learn=true\n+    # Enable route advertising at AZ level\n+    ovn-nbctl set nb_global . options:ic-route-adv=true\n+\n+    # Create LRP and connect to TS\n+    ovn-nbctl lr-add lr$i\n+    ovn-nbctl lrp-add lr$i lrp-lr$i-ts1 aa:aa:aa:aa:aa:0$i 169.254.100.$i/24\n+    ovn-nbctl lsp-add ts1 lsp-ts1-lr$i \\\n+            -- lsp-set-addresses lsp-ts1-lr$i router \\\n+            -- lsp-set-type lsp-ts1-lr$i router \\\n+            -- lsp-set-options lsp-ts1-lr$i router-port=lrp-lr$i-ts1\n+\n+    # Create static routes\n+    ovn-nbctl lr-route-add lr$i 10.11.$i.0/24 169.254.0.1\n+\n+    # Create a src-ip route, which shouldn't be synced\n+    ovn-nbctl --policy=src-ip --route-table=rtb1 lr-route-add lr$i 10.22.$i.0/24 169.254.0.2\n+done\n+\n+for i in 1 2; do\n+    OVS_WAIT_UNTIL([ovn_as az$i ovn-nbctl lr-route-list lr$i | grep learned])\n+done\n+\n+AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl\n+IPv4 Routes\n+Route Table global:\n+             10.11.1.0/24               169.254.0.1 dst-ip\n+             10.11.2.0/24             169.254.100.2 dst-ip (learned)\n+\n+Route Table rtb1:\n+             10.22.1.0/24               169.254.0.2 src-ip\n+])\n+\n+# move routes from global route table to rtb1\n+for i in 1 2; do\n+    ovn_as az$i ovn-nbctl lr-route-del lr$i 10.11.$i.0/24 169.254.0.1\n+    ovn_as az$i ovn-nbctl --route-table=rtb1 lr-route-add lr$i 10.11.$i.0/24 169.254.0.1\n+done\n+\n+for i in 1 2; do\n+    OVS_WAIT_WHILE([ovn_as az$i ovn-nbctl lr-route-list lr$i | grep learned])\n+done\n+\n+# ensure route from rtb1 is not learned to any route table as route table is\n+# not set to TS port\n+AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl\n+IPv4 Routes\n+Route Table rtb1:\n+             10.11.1.0/24               169.254.0.1 dst-ip\n+             10.22.1.0/24               169.254.0.2 src-ip\n+])\n+\n+# assign route table rtb1 to TS port on AZ2 and check routes are advertised to IC SB DB\n+check ovn_as az2 ovn-nbctl lrp-set-options lrp-lr2-ts1 route_table=rtb1\n+OVS_WAIT_UNTIL([ovn-ic-sbctl find route route_table=rtb1 | grep 10.11.2.0/24])\n+\n+# ensure route was not learned as on AZ1 TS port's LRP was not set to route table rtb1\n+AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl\n+IPv4 Routes\n+Route Table rtb1:\n+             10.11.1.0/24               169.254.0.1 dst-ip\n+             10.22.1.0/24               169.254.0.2 src-ip\n+])\n+\n+# set TS port's LRP to route table rtb1 to learn routes from AZ2 from rtb1\n+check ovn_as az1 ovn-nbctl lrp-set-options lrp-lr1-ts1 route_table=rtb1\n+\n+OVS_WAIT_UNTIL([ovn_as az1 ovn-nbctl --route-table=rtb1 lr-route-list lr1 | grep learned])\n+AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl\n+IPv4 Routes\n+Route Table rtb1:\n+             10.11.1.0/24               169.254.0.1 dst-ip\n+             10.11.2.0/24             169.254.100.2 dst-ip (learned)\n+             10.22.1.0/24               169.254.0.2 src-ip\n+])\n+\n+# Delete route in AZ1, AZ2's learned route should be deleted.\n+ovn_as az1 ovn-nbctl --route-table=rtb1 lr-route-del lr1 10.11.1.0/24\n+OVS_WAIT_WHILE([ovn_as az2 ovn-nbctl --route-table=rtb1 lr-route-list lr2 | grep learned])\n+\n+# Add the route back\n+ovn_as az1 ovn-nbctl --route-table=rtb1 lr-route-add lr1 10.11.1.0/24 169.254.0.1\n+OVS_WAIT_UNTIL([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned])\n+\n+# Disable route-learning for AZ1\n+ovn_as az1 ovn-nbctl set nb_global . options:ic-route-learn=false\n+OVS_WAIT_WHILE([ovn_as az1 ovn-nbctl lr-route-list lr1 | grep learned])\n+AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr1], [0], [dnl\n+IPv4 Routes\n+Route Table rtb1:\n+             10.11.1.0/24               169.254.0.1 dst-ip\n+             10.22.1.0/24               169.254.0.2 src-ip\n+])\n+\n+# AZ1 should still advertise and AZ2 should still learn the route\n+AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned], [0], [ignore])\n+AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2], [0], [dnl\n+IPv4 Routes\n+Route Table rtb1:\n+             10.11.1.0/24             169.254.100.1 dst-ip (learned)\n+             10.11.2.0/24               169.254.0.1 dst-ip\n+             10.22.2.0/24               169.254.0.2 src-ip\n+])\n+\n+# Disable route-advertising for AZ1\n+ovn_as az1 ovn-nbctl set nb_global . options:ic-route-adv=false\n+\n+# AZ2 shouldn't have the route learned, because AZ1 have stopped advertising.\n+OVS_WAIT_WHILE([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned])\n+\n+# Add default route in AZ1\n+ovn_as az1 ovn-nbctl --route-table=rtb1 lr-route-add lr1 0.0.0.0/0 169.254.0.3\n+\n+# Re-enable router-advertising & learn for AZ1\n+ovn_as az1 ovn-nbctl set nb_global . options:ic-route-adv=true\n+ovn_as az1 ovn-nbctl set nb_global . options:ic-route-learn=true\n+\n+for i in 1 2; do\n+    OVS_WAIT_UNTIL([ovn_as az$i ovn-nbctl lr-route-list lr$i | grep learned])\n+done\n+\n+# Default route should NOT get advertised or learned, by default.\n+AT_CHECK([ovn-ic-sbctl find route ip_prefix=\"0.0.0.0/0\"], [0], [])\n+\n+# Enable default route advertising in AZ1, ensure it advertised, but not learned\n+ovn_as az1 ovn-nbctl set nb_global . options:ic-route-adv-default=true\n+OVS_WAIT_UNTIL([ovn-ic-sbctl find route ip_prefix=\"0.0.0.0/0\" route_table=rtb1 | grep 0.0.0.0])\n+OVS_WAIT_WHILE([ovn_as az2 ovn-nbctl --route-table=rtb1 lr-route-list lr2 | grep learned | grep 0.0.0.0])\n+\n+# Enable default route learning in AZ2\n+ovn_as az2 ovn-nbctl set nb_global . options:ic-route-learn-default=true\n+OVS_WAIT_UNTIL([ovn_as az2 ovn-nbctl --route-table=rtb1 lr-route-list lr2 | grep learned | grep 0.0.0.0])\n+\n+# Test directly connected subnet route advertising. Route should go to global route table.\n+ovn_as az1 ovn-nbctl lrp-add lr1 lrp-lr1-ls1 aa:aa:aa:aa:bb:01 \"192.168.0.1/24\"\n+OVS_WAIT_UNTIL([ovn-ic-sbctl find route ip_prefix=\"192.168.0.1/24\" route_table=\"\\\"\\\"\" | grep 192.168.0.1/24])\n+OVS_WAIT_UNTIL([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned | grep 192.168])\n+AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2], [0], [dnl\n+IPv4 Routes\n+Route Table global:\n+           192.168.0.0/24             169.254.100.1 dst-ip (learned)\n+\n+Route Table rtb1:\n+             10.11.1.0/24             169.254.100.1 dst-ip (learned)\n+             10.11.2.0/24               169.254.0.1 dst-ip\n+             10.22.2.0/24               169.254.0.2 src-ip\n+                0.0.0.0/0             169.254.100.1 dst-ip (learned)\n+])\n+\n+# Delete the directly connected subnet from AZ1, learned route should be\n+# removed from AZ2.\n+ovn_as az1 ovn-nbctl lrp-del lrp-lr1-ls1\n+OVS_WAIT_WHILE([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned | grep 192.168])\n+\n+# Test blacklist routes\n+# Add back the directly connected 192.168 route.\n+ovn_as az1 ovn-nbctl lrp-add lr1 lrp-lr1-ls1 aa:aa:aa:aa:bb:01 \"192.168.0.1/24\"\n+OVS_WAIT_UNTIL([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned | grep 192.168])\n+# Now add 10.11.0.0/16 and 192.168.0.0/16 to blacklist in AZ2.\n+check ovn_as az2 ovn-nbctl set nb_global . options:ic-route-blacklist=\"10.11.0.0/16,192.168.0.0/16\"\n+# AZ2 shouldn't learn 192.168 route any more.\n+OVS_WAIT_WHILE([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned | grep 192.168])\n+# AZ1 shouldn't learn 10.11 any more.\n+OVS_WAIT_WHILE([ovn_as az1 ovn-nbctl lr-route-list lr1 | grep learned | grep 10.11])\n+AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2], [0], [dnl\n+IPv4 Routes\n+Route Table rtb1:\n+             10.11.2.0/24               169.254.0.1 dst-ip\n+             10.22.2.0/24               169.254.0.2 src-ip\n+                0.0.0.0/0             169.254.100.1 dst-ip (learned)\n+])\n+\n+OVN_CLEANUP_IC([az1], [az2])\n+\n+AT_CLEANUP\n+])\n+\n+\n+OVN_FOR_EACH_NORTHD([\n+AT_SETUP([ovn-ic -- route sync -- multiple route tables])\n+\n+ovn_init_ic_db\n+ovn-ic-nbctl ts-add ts1\n+\n+for i in 1 2; do\n+    ovn_start az$i\n+    ovn_as az$i\n+\n+    # Enable route learning at AZ level\n+    ovn-nbctl set nb_global . options:ic-route-learn=true\n+    # Enable route advertising at AZ level\n+    ovn-nbctl set nb_global . options:ic-route-adv=true\n+done\n+\n+# Create new transit switches and LRs. Test topology is next:\n+# VPC1:\n+#                       / transit switch (ts11) \\\n+# logical router (lr11) - transit switch (ts12) - logical router (lr12)\n+#                       \\ transit switch (ts13) /\n+#\n+# VPC2:\n+#                       / transit switch (ts21) \\\n+# logical router (lr21)                           logical router (lr22)\n+#                       \\ transit switch (ts22) /\n+#\n+# each LR has one connected subnet except TS port\n+\n+\n+# VPC1\n+# create lr11, lr12, ts11, ts12, ts13 and connect them\n+# assign route tables rtb1, rtb2, rtb3 to ts ports\n+for i in 1 2; do\n+    ovn_as az$i\n+\n+    lr=lr1$i\n+    ovn-nbctl lr-add $lr\n+\n+    for j in 1 2 3; do\n+        ts=ts1$j\n+        ovn-ic-nbctl --may-exist ts-add $ts\n+\n+        lrp=lrp-$lr-$ts\n+        lsp=lsp-$ts-$lr\n+        # Create LRP and connect to TS\n+        ovn-nbctl lrp-add $lr $lrp aa:aa:aa:aa:a$j:0$i 169.254.10$j.$i/24\n+        ovn-nbctl lrp-set-options $lrp route_table=rtb$j\n+        ovn-nbctl lsp-add $ts $lsp \\\n+                -- lsp-set-addresses $lsp router \\\n+                -- lsp-set-type $lsp router \\\n+                -- lsp-set-options $lsp router-port=$lrp\n+    done\n+done\n+\n+# VPC2\n+# create lr21, lr22, ts21, ts22 and connect them\n+# assign route tables rtb1, rtb2, rtb3 to ts ports\n+for i in 1 2; do\n+    ovn_as az$i\n+\n+    lr=lr2$i\n+    ovn-nbctl lr-add $lr\n+\n+    for j in 1 2; do\n+        ts=ts2$j\n+        ovn-ic-nbctl --may-exist ts-add $ts\n+\n+        lrp=lrp-$lr-$ts\n+        lsp=lsp-$ts-$lr\n+        # Create LRP and connect to TS\n+        ovn-nbctl lrp-add $lr $lrp aa:aa:aa:aa:a$j:0$i 169.254.10$j.$i/24\n+        ovn-nbctl lrp-set-options $lrp route_table=rtb$j\n+        ovn-nbctl lsp-add $ts $lsp \\\n+                -- lsp-set-addresses $lsp router \\\n+                -- lsp-set-type $lsp router \\\n+                -- lsp-set-options $lsp router-port=$lrp\n+    done\n+done\n+\n+# Create directly-connected and static routes in VPC1\n+ovn_as az2 ovn-nbctl lrp-add lr12 lrp-lr12 aa:aa:aa:aa:bb:01 \"192.168.0.1/24\"\n+ovn_as az2 ovn-nbctl --route-table=rtb1 lr-route-add lr12 10.10.10.0/24 192.168.0.10\n+ovn_as az2 ovn-nbctl --route-table=rtb2 lr-route-add lr12 10.10.10.0/24 192.168.0.11\n+ovn_as az2 ovn-nbctl --route-table=rtb3 lr-route-add lr12 10.10.10.0/24 192.168.0.12\n+\n+# Create directly-connected route in VPC2\n+ovn_as az2 ovn-nbctl lrp-add lr22 lrp-lr22 aa:aa:aa:aa:bb:01 \"192.168.0.1/24\"\n+\n+# Test direct routes from lr12 were learned to lr11\n+AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep 192.168 |\n+             grep learned | awk '{print $1, $2, $5}' | sort ], [0], [dnl\n+192.168.0.0/24 169.254.101.2 ecmp\n+192.168.0.0/24 169.254.102.2 ecmp\n+192.168.0.0/24 169.254.103.2 ecmp\n+])\n+\n+# Test static routes from lr12 rtbs rtb1,rtb2,rtb3 were learned to lr11\n+AT_CHECK([ovn_as az1 ovn-nbctl --route-table=rtb1 lr-route-list lr11], [0], [dnl\n+IPv4 Routes\n+Route Table rtb1:\n+            10.10.10.0/24             169.254.101.2 dst-ip (learned)\n+])\n+AT_CHECK([ovn_as az1 ovn-nbctl --route-table=rtb2 lr-route-list lr11], [0], [dnl\n+IPv4 Routes\n+Route Table rtb2:\n+            10.10.10.0/24             169.254.102.2 dst-ip (learned)\n+])\n+AT_CHECK([ovn_as az1 ovn-nbctl --route-table=rtb3 lr-route-list lr11], [0], [dnl\n+IPv4 Routes\n+Route Table rtb3:\n+            10.10.10.0/24             169.254.103.2 dst-ip (learned)\n+])\n+\n+# Test routes from lr12 didn't leak as learned to lr21\n+AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr21 | grep 192.168 | sort], [0], [dnl\n+           192.168.0.0/24             169.254.101.2 dst-ip (learned) ecmp\n+           192.168.0.0/24             169.254.102.2 dst-ip (learned) ecmp\n+])\n+\n+OVN_CLEANUP_IC([az1], [az2])\n+\n+AT_CLEANUP\n+])\n+\n+\n+OVN_FOR_EACH_NORTHD([\n+AT_SETUP([ovn-ic -- route sync -- multiple route tables IPv6])\n+\n+ovn_init_ic_db\n+ovn-ic-nbctl ts-add ts1\n+\n+for i in 1 2; do\n+    ovn_start az$i\n+    ovn_as az$i\n+\n+    # Enable route learning at AZ level\n+    ovn-nbctl set nb_global . options:ic-route-learn=true\n+    # Enable route advertising at AZ level\n+    ovn-nbctl set nb_global . options:ic-route-adv=true\n+done\n+\n+# Create new transit switches and LRs. Test topology is next:\n+# VPC1:\n+#                       / transit switch (ts11) \\\n+# logical router (lr11) - transit switch (ts12) - logical router (lr12)\n+#                       \\ transit switch (ts13) /\n+#\n+# VPC2:\n+#                       / transit switch (ts21) \\\n+# logical router (lr21)                           logical router (lr22)\n+#                       \\ transit switch (ts22) /\n+#\n+# each LR has one connected subnet except TS port\n+\n+\n+# VPC1\n+# create lr11, lr12, ts11, ts12, ts13 and connect them\n+# assign route tables rtb1, rtb2, rtb3 to ts ports\n+for i in 1 2; do\n+    ovn_as az$i\n+\n+    lr=lr1$i\n+    ovn-nbctl lr-add $lr\n+\n+    for j in 1 2 3; do\n+        ts=ts1$j\n+        ovn-ic-nbctl --may-exist ts-add $ts\n+\n+        lrp=lrp-$lr-$ts\n+        lsp=lsp-$ts-$lr\n+        # Create LRP and connect to TS\n+        ovn-nbctl lrp-add $lr $lrp aa:aa:aa:aa:a$j:0$i 2001:db8:$j::$i/64\n+        ovn-nbctl lrp-set-options $lrp route_table=rtb$j\n+        ovn-nbctl lsp-add $ts $lsp \\\n+                -- lsp-set-addresses $lsp router \\\n+                -- lsp-set-type $lsp router \\\n+                -- lsp-set-options $lsp router-port=$lrp\n+    done\n+done\n+\n+# VPC2\n+# create lr21, lr22, ts21, ts22 and connect them\n+# assign route tables rtb1, rtb2, rtb3 to ts ports\n+for i in 1 2; do\n+    ovn_as az$i\n+\n+    lr=lr2$i\n+    ovn-nbctl lr-add $lr\n+\n+    for j in 1 2; do\n+        ts=ts2$j\n+        ovn-ic-nbctl --may-exist ts-add $ts\n+\n+        lrp=lrp-$lr-$ts\n+        lsp=lsp-$ts-$lr\n+        # Create LRP and connect to TS\n+        ovn-nbctl lrp-add $lr $lrp aa:aa:aa:aa:a$j:0$i 2001:db8:$j::$i/64\n+        ovn-nbctl lrp-set-options $lrp route_table=rtb$j\n+        ovn-nbctl lsp-add $ts $lsp \\\n+                -- lsp-set-addresses $lsp router \\\n+                -- lsp-set-type $lsp router \\\n+                -- lsp-set-options $lsp router-port=$lrp\n+    done\n+done\n+\n+# Create directly-connected and static routes in VPC1\n+ovn_as az2 ovn-nbctl lrp-add lr12 lrp-lr12 aa:aa:aa:aa:bb:01 \"2001:db8:200::1/64\"\n+ovn_as az2 ovn-nbctl --route-table=rtb1 lr-route-add lr12 2001:db8:aaaa::/64 2001:db8:200::10\n+ovn_as az2 ovn-nbctl --route-table=rtb2 lr-route-add lr12 2001:db8:aaaa::/64 2001:db8:200::11\n+ovn_as az2 ovn-nbctl --route-table=rtb3 lr-route-add lr12 2001:db8:aaaa::/64 2001:db8:200::12\n+\n+# Create directly-connected route in VPC2\n+ovn_as az2 ovn-nbctl lrp-add lr22 lrp-lr22 aa:aa:aa:aa:bb:01 \"2001:db8:200::1/64\"\n+\n+# Test direct routes from lr12 were learned to lr11\n+AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep 2001:db8:200 |\n+             grep learned | awk '{print $1, $2, $5}' | sort], [0], [dnl\n+2001:db8:200::/64 2001:db8:1::2 ecmp\n+2001:db8:200::/64 2001:db8:2::2 ecmp\n+2001:db8:200::/64 2001:db8:3::2 ecmp\n+])\n+\n+# Test static routes from lr12 rtbs rtb1,rtb2,rtb3 were learned to lr11\n+AT_CHECK([ovn_as az1 ovn-nbctl --route-table=rtb1 lr-route-list lr11], [0], [dnl\n+IPv6 Routes\n+Route Table rtb1:\n+       2001:db8:aaaa::/64             2001:db8:1::2 dst-ip (learned)\n+])\n+AT_CHECK([ovn_as az1 ovn-nbctl --route-table=rtb2 lr-route-list lr11], [0], [dnl\n+IPv6 Routes\n+Route Table rtb2:\n+       2001:db8:aaaa::/64             2001:db8:2::2 dst-ip (learned)\n+])\n+AT_CHECK([ovn_as az1 ovn-nbctl --route-table=rtb3 lr-route-list lr11], [0], [dnl\n+IPv6 Routes\n+Route Table rtb3:\n+       2001:db8:aaaa::/64             2001:db8:3::2 dst-ip (learned)\n+])\n+\n+# Test routes from lr12 didn't leak as learned to lr21\n+AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr21 | grep 2001 | sort], [0], [dnl\n+        2001:db8:200::/64             2001:db8:1::2 dst-ip (learned) ecmp\n+        2001:db8:200::/64             2001:db8:2::2 dst-ip (learned) ecmp\n+])\n+\n+OVN_CLEANUP_IC([az1], [az2])\n+\n+AT_CLEANUP\n+])\n",
    "prefixes": [
        "ovs-dev",
        "v3",
        "3/3"
    ]
}