{"id":1554073,"url":"http://patchwork.ozlabs.org/api/patches/1554073/","web_url":"http://patchwork.ozlabs.org/project/ovn/patch/20211111191306.6369-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":"<20211111191306.6369-4-odivlad@gmail.com>","list_archive_url":null,"date":"2021-11-11T19:13:04","name":"[ovs-dev,v7,3/5] northd, utils: support for RouteTables in LRs","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"7e6d67044aa1b3af856de380b6164c8ace45d0a9","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/20211111191306.6369-4-odivlad@gmail.com/mbox/","series":[{"id":271600,"url":"http://patchwork.ozlabs.org/api/series/271600/","web_url":"http://patchwork.ozlabs.org/project/ovn/list/?series=271600","date":"2021-11-11T19:13:01","name":"Add multiple routing tables support to Logical Routers","version":7,"mbox":"http://patchwork.ozlabs.org/series/271600/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1554073/comments/","check":"fail","checks":"http://patchwork.ozlabs.org/api/patches/1554073/checks/","tags":{},"related":[],"headers":{"Return-Path":" \n If ECMP routes with symmetric reply are configured in the\n- \n+ If a packet arrived at this table from Logical Router Port P\n+ which has \n+ This table contains the following logical flows:\n+ \n+ Priority-100 flow with match \n+ A priority-0 logical flow with match \n A packet that arrives at this table is an IP packet that should be\n@@ -3362,10 +3390,10 @@ output;\n \n IPv4 routing table. For each route to IPv4 network N with\n netmask M, on router port P with IP address\n- A and Ethernet\n- address E, a logical flow with match OVN_Northbound
database for a gateway router, a priority-300\n+ OVN_Northbound
database for a gateway router, a priority-400\n flow is added for each router port on which symmetric replies are\n configured. The matching logic for these ports essentially reverses the\n configured logic of the ECMP route. So for instance, a route with a\n@@ -3291,7 +3291,35 @@ output;\n \n \n \n- Ingress Table 10: IP Routing
\n+ Ingress Table 10: IP Routing Pre
\n+\n+ options:route_table
value set, a logical flow with\n+ match inport == \"P\"
with priority 100 and action,\n+ setting unique-generated per-datapath 32-bit value (non-zero) in OVS\n+ register 7. This register is checked in next table.\n+ \n+
\n+\n+ inport == \"LRP_NAME\"
value\n+ and action, which set route table identifier in reg7.\n+ 1
has actions\n+ next;
.\n+ Ingress Table 11: IP Routing
\n \n ip4.dst ==\n- N/M
, whose priority is the number of\n- 1-bits in M, has the following actions:\n+ A and Ethernet address E, a logical flow with\n+ match ip4.dst == N/M
, whose\n+ priority is 100 + the number of 1-bits in M, has the\n+ following actions:\n \n@@ -3428,6 +3456,13 @@ next;\n If the address A is in the link-local scope, the\n route will be limited to sending on the ingress port.\n
\n+ For routes with route_table
value set\n+ reg7 == id
is prefixed in logical flow match portion.\n+ Priority for routes with route_table
value set is\n+ the number of 1-bits in M.\n+
\n This table implements the second part of IP routing for ECMP routes\n@@ -3506,7 +3541,7 @@ outport = P;\n \n \n \n-
\n This table adds flows for the logical router policies configured\n on the logical router. Please see the\n@@ -3578,7 +3613,7 @@ next;\n \n \n \n-
\n This table handles the ECMP for the router policies configured\n with multiple nexthops.\n@@ -3622,7 +3657,7 @@ outport = P\n \n \n \n-
\n Any packet that reaches this table is an IP packet whose next-hop\n@@ -3813,7 +3848,7 @@ outport = P\n \n \n \n-
\n For distributed logical routers or gateway routers with gateway\n@@ -3843,7 +3878,7 @@ REGBIT_PKT_LARGER = check_pkt_larger(L); next;\n and advances to the next table.\n
\n \n-\n For distributed logical routers or gateway routers with gateway port\n@@ -3906,7 +3941,7 @@ icmp6 {\n and advances to the next table.\n
\n \n-\n For distributed logical routers where one or more of the logical router\n@@ -3953,7 +3988,7 @@ icmp6 {\n \n \n \n-
\n In the common case where the Ethernet destination has been resolved, this\ndiff --git a/ovn-nb.ovsschema b/ovn-nb.ovsschema\nindex 5dee04fe9..55977339a 100644\n--- a/ovn-nb.ovsschema\n+++ b/ovn-nb.ovsschema\n@@ -1,7 +1,7 @@\n {\n \"name\": \"OVN_Northbound\",\n- \"version\": \"5.33.1\",\n- \"cksum\": \"1931852754 30731\",\n+ \"version\": \"5.34.1\",\n+ \"cksum\": \"2177334725 30782\",\n \"tables\": {\n \"NB_Global\": {\n \"columns\": {\n@@ -407,6 +407,7 @@\n \"isRoot\": false},\n \"Logical_Router_Static_Route\": {\n \"columns\": {\n+ \"route_table\": {\"type\": \"string\"},\n \"ip_prefix\": {\"type\": \"string\"},\n \"policy\": {\"type\": {\"key\": {\"type\": \"string\",\n \"enum\": [\"set\", [\"src-ip\",\ndiff --git a/ovn-nb.xml b/ovn-nb.xml\nindex 036ffa64f..4a1d4abdf 100644\n--- a/ovn-nb.xml\n+++ b/ovn-nb.xml\n@@ -2820,6 +2820,14 @@\n prefix according to RFC3663\n
\n \n+\n+route_table
value. Routes to directly connected networks\n+ from same Logical Router and routes without route_table
\n+ option set have higher priority than routes with\n+ route_table
option set.\n+ \n+ Any string to place route to separate routing table. If Logical Router\n+ Port has configured value in other than empty string, OVN\n+ performs route lookup for all packets entering Logical Router ingress\n+ pipeline from this port in the following manner:\n+
\n+\n+route_table
value set and routes to directly connected\n+ networks.\n+ route_table
value\n+ as specified in LRP's options:route_table field.\n+ ovn-ic
populates this key if the route is learned from the\n global database. In this case the value\ndiff --git a/tests/ovn-ic.at b/tests/ovn-ic.at\nindex 7e8498b2f..d1764d05b 100644\n--- a/tests/ovn-ic.at\n+++ b/tests/ovn-ic.at\n@@ -282,6 +282,7 @@ 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 10.22.1.0/24 169.254.0.2 src-ip\n@@ -300,6 +301,7 @@ 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 global:\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@@ -315,6 +317,7 @@ ovn_as az1 ovn-nbctl set nb_global . options:ic-route-adv=false\n OVS_WAIT_WHILE([ovn_as az2 ovn-nbctl lr-route-list lr2 | grep learned])\n AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2], [0], [dnl\n IPv4 Routes\n+Route Table global:\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@@ -333,6 +336,7 @@ done\n # Default route should NOT get advertised or learned, by default.\n AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr2], [0], [dnl\n IPv4 Routes\n+Route Table global:\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\ndiff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at\nindex a8946fef8..911310aeb 100644\n--- a/tests/ovn-nbctl.at\n+++ b/tests/ovn-nbctl.at\n@@ -1522,6 +1522,7 @@ AT_CHECK([ovn-nbctl --ecmp --policy=src-ip lr-route-add lr0 20.0.0.0/24 11.0.0.1\n \n AT_CHECK([ovn-nbctl lr-route-list lr0], [0], [dnl\n IPv4 Routes\n+Route Table