[ovs-dev] [ovn-ipv6 14/26] ovn: Support multiple addresses on a single logical router port.

Zong Kai Li zealokii at gmail.com
Tue Jul 12 12:55:15 UTC 2016


> diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
> index 5102948..460d5bd 100644
> --- a/ovn/ovn-nb.ovsschema
> +++ b/ovn/ovn-nb.ovsschema
> @@ -1,7 +1,7 @@
>  {
>      "name": "OVN_Northbound",
> -    "version": "4.0.0",
> -    "cksum": "2156178478 7460",
> +    "version": "5.0.0",
> +    "cksum": "849073644 7576",
>      "tables": {
>          "Logical_Switch": {
>              "columns": {
> @@ -123,7 +123,9 @@
>          "Logical_Router_Port": {
>              "columns": {
>                  "name": {"type": "string"},
> -                "network": {"type": "string"},
> +                "networks": {"type": {"key": "string",
> +                                      "min": 1,
> +                                      "max": "unlimited"}},
>                  "mac": {"type": "string"},
>                  "peer": {"type": {"key": "string", "min": 0, "max": 1}},
>                  "enabled": {"type": {"key": "boolean", "min": 0, "max": 1}},
> diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
> index 1eeec22..e571eeb 100644
> --- a/ovn/ovn-nb.xml
> +++ b/ovn/ovn-nb.xml
> @@ -794,11 +794,13 @@
>        </p>
>      </column>
>
> -    <column name="network">
> -      The IP address of the router and the netmask.  For example,
> -      <code>192.168.0.1/24</code> indicates that the router's IP address is
> -      192.168.0.1 and that packets destined to 192.168.0.<var>x</var> should be
> -      routed to this port.
> +    <column name="networks">
> +      <p>
> +        The IP addresses and netmasks of the router.  For example,
> +        <code>192.168.0.1/24</code> indicates that the router's IP
> +        address is 192.168.0.1 and that packets destined to
> +        192.168.0.<var>x</var> should be routed to this port.
> +      </p>
>      </column>
>

I just considered about this patch again in my afternoon. Let me share
my new idea about this.
My idea is, maybe we can directly parse a lsp.addresses for its
patched lrp when that lsp.type is "router".
This should be the simplest way to align lrp.network and lrp.mac to
lsp.addresses when lsp.type is "router".
We even don't need to change current OVN NB DB schema, and
extract_lsp_addresses can work for this.

A router could connect to either a switch or another router, and a
lsp.peer should either be empty or be set with another lsp.name.
So when a lrp has its nbr->peer been set, we should parse current
network and mac column for it. For peer router port still these to
build static route.
And when a lrp has empty nbr->peer, we can let lsp processing branch
in join_logical_ports to extract addresses for it.
And even, for op is lrp and op->peer->nbs is NULL case, we can
directly use ip, network, mask via op->peer, without extracting
addresses for lrp at first.

I can't figure why a patched lsp and lrp could have different
addresses, networks, masks, macs. So I think this should make sense.
:)

Thanks.
Zong Kai, LI



More information about the dev mailing list