diff mbox series

[ovs-dev,1/2] northd: allow having VXLAN encaps in ovn-ic enabled setup

Message ID 20211123170739.86576-1-odivlad@gmail.com
State Accepted
Headers show
Series [ovs-dev,1/2] northd: allow having VXLAN encaps in ovn-ic enabled setup | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Vladislav Odintsov Nov. 23, 2021, 5:07 p.m. UTC
In ovn-ic enabled setups, which also use VXLAN encapsulation
(for instance, for VTEP-switches) interconnected transit switches
(datapaths) were not configured after the patch from "Fixes" tag.
This was due to the fact that ovn-ic utilises tunnel key for
transit switches > OVN_VXLAN_MIN_MULTICAST.

This patch allows having such setup.

Fixes: fd44d7595 (Enforce datapath and port key constraints in vxlan mode)
Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
---
 northd/northd.c | 4 +++-
 tests/ovn-ic.at | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

Comments

Numan Siddique Nov. 29, 2021, 6:18 p.m. UTC | #1
On Tue, Nov 23, 2021 at 12:08 PM Vladislav Odintsov <odivlad@gmail.com> wrote:
>
> In ovn-ic enabled setups, which also use VXLAN encapsulation
> (for instance, for VTEP-switches) interconnected transit switches
> (datapaths) were not configured after the patch from "Fixes" tag.
> This was due to the fact that ovn-ic utilises tunnel key for
> transit switches > OVN_VXLAN_MIN_MULTICAST.
>
> This patch allows having such setup.
>
> Fixes: fd44d7595 (Enforce datapath and port key constraints in vxlan mode)
> Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>

Thanks.  I applied this patch to the main branch and backported to branch-21.09.

Regards
Numan

> ---
>  northd/northd.c | 4 +++-
>  tests/ovn-ic.at | 3 +++
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/northd/northd.c b/northd/northd.c
> index 2b7dd5980..0145a4943 100644
> --- a/northd/northd.c
> +++ b/northd/northd.c
> @@ -1439,7 +1439,9 @@ ovn_datapath_assign_requested_tnl_id(struct northd_input *input_data,
>                                         : &od->nbr->options);
>      uint32_t tunnel_key = smap_get_int(other_config, "requested-tnl-key", 0);
>      if (tunnel_key) {
> -        if (is_vxlan_mode(input_data) && tunnel_key >= 1 << 12) {
> +        const char *interconn_ts = smap_get(other_config, "interconn-ts");
> +        if (!interconn_ts && is_vxlan_mode(input_data) &&
> +            tunnel_key >= 1 << 12) {
>              static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
>              VLOG_WARN_RL(&rl, "Tunnel key %"PRIu32" for datapath %s is "
>                           "incompatible with VXLAN", tunnel_key,
> diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at
> index a189a8fed..05bd3e9a6 100644
> --- a/tests/ovn-ic.at
> +++ b/tests/ovn-ic.at
> @@ -38,6 +38,9 @@ AT_SETUP([ovn-ic -- transit switch handling])
>  ovn_init_ic_db
>  ovn_start az1
>
> +# create fake chassis with vxlan encap to enforce requested tunnel key checks
> +ovn-sbctl chassis-add fakechassis vxlan 192.168.0.2
> +
>  AT_CHECK([ovn-ic-nbctl ts-add ts1])
>  AT_CHECK([ovn-ic-nbctl ts-add ts2])
>
> --
> 2.30.0
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
Vladislav Odintsov Nov. 29, 2021, 6:18 p.m. UTC | #2
Thanks!

regards,
Vladislav Odintsov

> On 29 Nov 2021, at 21:18, Numan Siddique <numans@ovn.org> wrote:
> 
> On Tue, Nov 23, 2021 at 12:08 PM Vladislav Odintsov <odivlad@gmail.com> wrote:
>> 
>> In ovn-ic enabled setups, which also use VXLAN encapsulation
>> (for instance, for VTEP-switches) interconnected transit switches
>> (datapaths) were not configured after the patch from "Fixes" tag.
>> This was due to the fact that ovn-ic utilises tunnel key for
>> transit switches > OVN_VXLAN_MIN_MULTICAST.
>> 
>> This patch allows having such setup.
>> 
>> Fixes: fd44d7595 (Enforce datapath and port key constraints in vxlan mode)
>> Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
> 
> Thanks.  I applied this patch to the main branch and backported to branch-21.09.
> 
> Regards
> Numan
> 
>> ---
>> northd/northd.c | 4 +++-
>> tests/ovn-ic.at | 3 +++
>> 2 files changed, 6 insertions(+), 1 deletion(-)
>> 
>> diff --git a/northd/northd.c b/northd/northd.c
>> index 2b7dd5980..0145a4943 100644
>> --- a/northd/northd.c
>> +++ b/northd/northd.c
>> @@ -1439,7 +1439,9 @@ ovn_datapath_assign_requested_tnl_id(struct northd_input *input_data,
>>                                        : &od->nbr->options);
>>     uint32_t tunnel_key = smap_get_int(other_config, "requested-tnl-key", 0);
>>     if (tunnel_key) {
>> -        if (is_vxlan_mode(input_data) && tunnel_key >= 1 << 12) {
>> +        const char *interconn_ts = smap_get(other_config, "interconn-ts");
>> +        if (!interconn_ts && is_vxlan_mode(input_data) &&
>> +            tunnel_key >= 1 << 12) {
>>             static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
>>             VLOG_WARN_RL(&rl, "Tunnel key %"PRIu32" for datapath %s is "
>>                          "incompatible with VXLAN", tunnel_key,
>> diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at
>> index a189a8fed..05bd3e9a6 100644
>> --- a/tests/ovn-ic.at
>> +++ b/tests/ovn-ic.at
>> @@ -38,6 +38,9 @@ AT_SETUP([ovn-ic -- transit switch handling])
>> ovn_init_ic_db
>> ovn_start az1
>> 
>> +# create fake chassis with vxlan encap to enforce requested tunnel key checks
>> +ovn-sbctl chassis-add fakechassis vxlan 192.168.0.2
>> +
>> AT_CHECK([ovn-ic-nbctl ts-add ts1])
>> AT_CHECK([ovn-ic-nbctl ts-add ts2])
>> 
>> --
>> 2.30.0
>> 
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
diff mbox series

Patch

diff --git a/northd/northd.c b/northd/northd.c
index 2b7dd5980..0145a4943 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -1439,7 +1439,9 @@  ovn_datapath_assign_requested_tnl_id(struct northd_input *input_data,
                                        : &od->nbr->options);
     uint32_t tunnel_key = smap_get_int(other_config, "requested-tnl-key", 0);
     if (tunnel_key) {
-        if (is_vxlan_mode(input_data) && tunnel_key >= 1 << 12) {
+        const char *interconn_ts = smap_get(other_config, "interconn-ts");
+        if (!interconn_ts && is_vxlan_mode(input_data) &&
+            tunnel_key >= 1 << 12) {
             static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1);
             VLOG_WARN_RL(&rl, "Tunnel key %"PRIu32" for datapath %s is "
                          "incompatible with VXLAN", tunnel_key,
diff --git a/tests/ovn-ic.at b/tests/ovn-ic.at
index a189a8fed..05bd3e9a6 100644
--- a/tests/ovn-ic.at
+++ b/tests/ovn-ic.at
@@ -38,6 +38,9 @@  AT_SETUP([ovn-ic -- transit switch handling])
 ovn_init_ic_db
 ovn_start az1
 
+# create fake chassis with vxlan encap to enforce requested tunnel key checks
+ovn-sbctl chassis-add fakechassis vxlan 192.168.0.2
+
 AT_CHECK([ovn-ic-nbctl ts-add ts1])
 AT_CHECK([ovn-ic-nbctl ts-add ts2])