Re: [ovs-dev] [PATCH ovn] Make tunnel ids exhaustion test case trigger the problem.

2024-04-05 Thread Ihar Hrachyshka
On Fri, Apr 5, 2024 at 11:38 AM Vladislav Odintsov 
wrote:

>
>
> On 5 Apr 2024, at 18:35, Ihar Hrachyshka  wrote:
>
> On Thu, Apr 4, 2024 at 3:56 PM Vladislav Odintsov 
> wrote:
>
>> Thanks Ihar for the patch.
>>
>> It definitely triggers the bug mentioned in Fixes commit, but how do you
>> like next diff as an alternative?
>> It seems a little easier to me, because it shows the real limit and the
>> situation where the problem was (separate ls-add):
>>
>>
> Ah, I think we are talking about two separate scenarios, both resulting in
> *hint out of [min; max] bounds!
>
> - You are talking about hint=0 with min:max = [1; 4096] - which indeed can
> be triggered by creating a new DP *after* tunnel ids are exhausted;
> - I am talking about a more obscure case where hint=4097 (because
> originally there were no vxlan chassis in the cluster); then a vxlan
> chassis is created (reducing max to 4096); then the allocation function is
> entered with hint=4097.
>
> Both scenarios are fixed by your patch. It may be worth having both test
> cases, one per scenario, in the test suite then. What do you think?
>
>
> I agree, it’s worth adding both.
> Thanks for clarification!
>
>
v2 with both cases here:
https://patchwork.ozlabs.org/project/ovn/patch/20240405155915.624103-1-ihrac...@redhat.com/


>
> (Side Note: I now find the runtime flip of max cap as a vxlan chassis is
> added - that I myself implemented - unfortunate.)
>
> Ihar
>
>
>> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
>> index 6edb1129e..cef144f10 100644
>> --- a/tests/ovn-northd.at
>> +++ b/tests/ovn-northd.at
>> @@ -2862,13 +2862,18 @@ ovn-sbctl \
>>
>>  cmd="ovn-nbctl --wait=sb"
>>
>> -for i in {1..4097}; do
>> +for i in {1..4095}; do
>>  cmd="${cmd} -- ls-add lsw-${i}"
>>  done
>>
>>  eval $cmd
>>
>> -check_row_count nb:Logical_Switch 4097
>> +check_row_count nb:Logical_Switch 4095
>> +wait_row_count sb:Datapath_Binding 4095
>> +
>> +ovn-nbctl ls-add lsw-exhausted
>> +
>> +check_row_count nb:Logical_Switch 4096
>>  wait_row_count sb:Datapath_Binding 4095
>>
>>  OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted"
>> northd/ovn-northd.log])
>>
>>
>> On 4 Apr 2024, at 20:13, Ihar Hrachyshka  wrote:
>>
>> The original version of the scenario passed with or without the fix.
>>
>> Fixes: a1f165a7b807 ("northd: fix infinite loop in ovn_allocate_tnlid()")
>> Signed-off-by: Ihar Hrachyshka 
>> ---
>> tests/ovn-northd.at | 17 +++--
>> 1 file changed, 11 insertions(+), 6 deletions(-)
>>
>> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
>> index fc2c972a4..e8ea8b050 100644
>> --- a/tests/ovn-northd.at
>> +++ b/tests/ovn-northd.at
>> @@ -2826,11 +2826,6 @@ OVN_FOR_EACH_NORTHD_NO_HV([
>> AT_SETUP([check tunnel ids exhaustion])
>> ovn_start
>>
>> -# Create a fake chassis with vxlan encap to lower MAX DP tunnel key to
>> 2^12
>> -ovn-sbctl \
>> ---id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
>> --- --id=@c create chassis name=hv1 encaps=@e
>> -
>> cmd="ovn-nbctl --wait=sb"
>>
>> for i in {1..4097}; do
>> @@ -2840,7 +2835,17 @@ done
>> eval $cmd
>>
>> check_row_count nb:Logical_Switch 4097
>> -wait_row_count sb:Datapath_Binding 4095
>> +wait_row_count sb:Datapath_Binding 4097
>> +
>> +# Now create a fake chassis with vxlan encap to lower MAX DP tunnel key
>> to 2^12
>> +ovn-sbctl \
>> +--id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
>> +-- --id=@c create chassis name=hv1 encaps=@e
>> +
>> +ovn-nbctl --wait=sb ls-add lsw-exhausted
>> +
>> +check_row_count nb:Logical_Switch 4098
>> +wait_row_count sb:Datapath_Binding 4097
>>
>> OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted"
>> northd/ovn-northd.log])
>>
>> --
>> 2.41.0
>>
>> ___
>> dev mailing list
>> d...@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>
>>
>>
>>
>>
>> Regards,
>> Vladislav Odintsov
>>
>>
>
> Regards,
> Vladislav Odintsov
>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] Make tunnel ids exhaustion test case trigger the problem.

2024-04-05 Thread Vladislav Odintsov


> On 5 Apr 2024, at 18:35, Ihar Hrachyshka  wrote:
> 
> On Thu, Apr 4, 2024 at 3:56 PM Vladislav Odintsov  > wrote:
>> Thanks Ihar for the patch.
>> 
>> It definitely triggers the bug mentioned in Fixes commit, but how do you 
>> like next diff as an alternative?
>> It seems a little easier to me, because it shows the real limit and the 
>> situation where the problem was (separate ls-add):
>> 
> 
> Ah, I think we are talking about two separate scenarios, both resulting in 
> *hint out of [min; max] bounds!
> 
> - You are talking about hint=0 with min:max = [1; 4096] - which indeed can be 
> triggered by creating a new DP *after* tunnel ids are exhausted;
> - I am talking about a more obscure case where hint=4097 (because originally 
> there were no vxlan chassis in the cluster); then a vxlan chassis is created 
> (reducing max to 4096); then the allocation function is entered with 
> hint=4097.
> 
> Both scenarios are fixed by your patch. It may be worth having both test 
> cases, one per scenario, in the test suite then. What do you think?

I agree, it’s worth adding both.
Thanks for clarification!

> 
> (Side Note: I now find the runtime flip of max cap as a vxlan chassis is 
> added - that I myself implemented - unfortunate.)
> 
> Ihar
>  
>> diff --git a/tests/ovn-northd.at  
>> b/tests/ovn-northd.at 
>> index 6edb1129e..cef144f10 100644
>> --- a/tests/ovn-northd.at 
>> +++ b/tests/ovn-northd.at 
>> @@ -2862,13 +2862,18 @@ ovn-sbctl \
>>  
>>  cmd="ovn-nbctl --wait=sb"
>>  
>> -for i in {1..4097}; do
>> +for i in {1..4095}; do
>>  cmd="${cmd} -- ls-add lsw-${i}"
>>  done
>>  
>>  eval $cmd
>>  
>> -check_row_count nb:Logical_Switch 4097
>> +check_row_count nb:Logical_Switch 4095
>> +wait_row_count sb:Datapath_Binding 4095
>> +
>> +ovn-nbctl ls-add lsw-exhausted
>> +
>> +check_row_count nb:Logical_Switch 4096
>>  wait_row_count sb:Datapath_Binding 4095
>>  
>>  OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted" 
>> northd/ovn-northd.log])
>> 
>> 
>>> On 4 Apr 2024, at 20:13, Ihar Hrachyshka >> > wrote:
>>> 
>>> The original version of the scenario passed with or without the fix.
>>> 
>>> Fixes: a1f165a7b807 ("northd: fix infinite loop in ovn_allocate_tnlid()")
>>> Signed-off-by: Ihar Hrachyshka >> >
>>> ---
>>> tests/ovn-northd.at  | 17 +++--
>>> 1 file changed, 11 insertions(+), 6 deletions(-)
>>> 
>>> diff --git a/tests/ovn-northd.at  
>>> b/tests/ovn-northd.at 
>>> index fc2c972a4..e8ea8b050 100644
>>> --- a/tests/ovn-northd.at 
>>> +++ b/tests/ovn-northd.at 
>>> @@ -2826,11 +2826,6 @@ OVN_FOR_EACH_NORTHD_NO_HV([
>>> AT_SETUP([check tunnel ids exhaustion])
>>> ovn_start
>>> 
>>> -# Create a fake chassis with vxlan encap to lower MAX DP tunnel key to 2^12
>>> -ovn-sbctl \
>>> ---id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
>>> --- --id=@c create chassis name=hv1 encaps=@e
>>> -
>>> cmd="ovn-nbctl --wait=sb"
>>> 
>>> for i in {1..4097}; do
>>> @@ -2840,7 +2835,17 @@ done
>>> eval $cmd
>>> 
>>> check_row_count nb:Logical_Switch 4097
>>> -wait_row_count sb:Datapath_Binding 4095
>>> +wait_row_count sb:Datapath_Binding 4097
>>> +
>>> +# Now create a fake chassis with vxlan encap to lower MAX DP tunnel key to 
>>> 2^12
>>> +ovn-sbctl \
>>> +--id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
>>> +-- --id=@c create chassis name=hv1 encaps=@e
>>> +
>>> +ovn-nbctl --wait=sb ls-add lsw-exhausted
>>> +
>>> +check_row_count nb:Logical_Switch 4098
>>> +wait_row_count sb:Datapath_Binding 4097
>>> 
>>> OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted" 
>>> northd/ovn-northd.log])
>>> 
>>> -- 
>>> 2.41.0
>>> 
>>> ___
>>> dev mailing list
>>> d...@openvswitch.org 
>>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>> 
>> 
>> 
>> 
>> Regards,
>> Vladislav Odintsov
>> 


Regards,
Vladislav Odintsov

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] Make tunnel ids exhaustion test case trigger the problem.

2024-04-05 Thread Ihar Hrachyshka
On Thu, Apr 4, 2024 at 3:56 PM Vladislav Odintsov  wrote:

> Thanks Ihar for the patch.
>
> It definitely triggers the bug mentioned in Fixes commit, but how do you
> like next diff as an alternative?
> It seems a little easier to me, because it shows the real limit and the
> situation where the problem was (separate ls-add):
>
>
Ah, I think we are talking about two separate scenarios, both resulting in
*hint out of [min; max] bounds!

- You are talking about hint=0 with min:max = [1; 4096] - which indeed can
be triggered by creating a new DP *after* tunnel ids are exhausted;
- I am talking about a more obscure case where hint=4097 (because
originally there were no vxlan chassis in the cluster); then a vxlan
chassis is created (reducing max to 4096); then the allocation function is
entered with hint=4097.

Both scenarios are fixed by your patch. It may be worth having both test
cases, one per scenario, in the test suite then. What do you think?

(Side Note: I now find the runtime flip of max cap as a vxlan chassis is
added - that I myself implemented - unfortunate.)

Ihar


> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
> index 6edb1129e..cef144f10 100644
> --- a/tests/ovn-northd.at
> +++ b/tests/ovn-northd.at
> @@ -2862,13 +2862,18 @@ ovn-sbctl \
>
>  cmd="ovn-nbctl --wait=sb"
>
> -for i in {1..4097}; do
> +for i in {1..4095}; do
>  cmd="${cmd} -- ls-add lsw-${i}"
>  done
>
>  eval $cmd
>
> -check_row_count nb:Logical_Switch 4097
> +check_row_count nb:Logical_Switch 4095
> +wait_row_count sb:Datapath_Binding 4095
> +
> +ovn-nbctl ls-add lsw-exhausted
> +
> +check_row_count nb:Logical_Switch 4096
>  wait_row_count sb:Datapath_Binding 4095
>
>  OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted"
> northd/ovn-northd.log])
>
>
> On 4 Apr 2024, at 20:13, Ihar Hrachyshka  wrote:
>
> The original version of the scenario passed with or without the fix.
>
> Fixes: a1f165a7b807 ("northd: fix infinite loop in ovn_allocate_tnlid()")
> Signed-off-by: Ihar Hrachyshka 
> ---
> tests/ovn-northd.at | 17 +++--
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
> index fc2c972a4..e8ea8b050 100644
> --- a/tests/ovn-northd.at
> +++ b/tests/ovn-northd.at
> @@ -2826,11 +2826,6 @@ OVN_FOR_EACH_NORTHD_NO_HV([
> AT_SETUP([check tunnel ids exhaustion])
> ovn_start
>
> -# Create a fake chassis with vxlan encap to lower MAX DP tunnel key to
> 2^12
> -ovn-sbctl \
> ---id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
> --- --id=@c create chassis name=hv1 encaps=@e
> -
> cmd="ovn-nbctl --wait=sb"
>
> for i in {1..4097}; do
> @@ -2840,7 +2835,17 @@ done
> eval $cmd
>
> check_row_count nb:Logical_Switch 4097
> -wait_row_count sb:Datapath_Binding 4095
> +wait_row_count sb:Datapath_Binding 4097
> +
> +# Now create a fake chassis with vxlan encap to lower MAX DP tunnel key
> to 2^12
> +ovn-sbctl \
> +--id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
> +-- --id=@c create chassis name=hv1 encaps=@e
> +
> +ovn-nbctl --wait=sb ls-add lsw-exhausted
> +
> +check_row_count nb:Logical_Switch 4098
> +wait_row_count sb:Datapath_Binding 4097
>
> OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted"
> northd/ovn-northd.log])
>
> --
> 2.41.0
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
>
>
>
> Regards,
> Vladislav Odintsov
>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] Make tunnel ids exhaustion test case trigger the problem.

2024-04-05 Thread Vladislav Odintsov
Yes, this diff is from main.
To trigger an initial bug it is enough to create a new ls/lr while all 
available tunnel ids are used for datapaths (4095).
This is because we need to enter ovn_allocate_tnlid() with *hint=0 to trigger 
infinite loop.
That is why I suggest just to create 4095 LSs and then create another one.
I’ve tested this diff and see that northd goes to 100% CPU and doesn’t print 
warn log about ids exhaustion.

> On 4 Apr 2024, at 23:34, Ihar Hrachyshka  wrote:
> 
> On Thu, Apr 4, 2024 at 3:56 PM Vladislav Odintsov  wrote:
> 
>> Thanks Ihar for the patch.
>> 
>> It definitely triggers the bug mentioned in Fixes commit, but how do you
>> like next diff as an alternative?
>> It seems a little easier to me, because it shows the real limit and the
>> situation where the problem was (separate ls-add):
>> 
> 
> Is it a diff from main? I don't think it will trigger the issue. The key is
> to trigger northd to change its max cap for tunnel ids AFTER it bumped hint
> beyond the "vxlan mode max tun_id" (which is why I have to create vxlan
> chassis AFTER I create enough LSs to get into unsafe territory.)
> 
> Note: I haven't tried your version yet; I may check your version some time
> later. So it's the initial thought only.
> 
> 
>> 
>> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
>> index 6edb1129e..cef144f10 100644
>> --- a/tests/ovn-northd.at
>> +++ b/tests/ovn-northd.at
>> @@ -2862,13 +2862,18 @@ ovn-sbctl \
>> 
>> cmd="ovn-nbctl --wait=sb"
>> 
>> -for i in {1..4097}; do
>> +for i in {1..4095}; do
>> cmd="${cmd} -- ls-add lsw-${i}"
>> done
>> 
>> eval $cmd
>> 
>> -check_row_count nb:Logical_Switch 4097
>> +check_row_count nb:Logical_Switch 4095
>> +wait_row_count sb:Datapath_Binding 4095
>> +
>> +ovn-nbctl ls-add lsw-exhausted
>> +
>> +check_row_count nb:Logical_Switch 4096
>> wait_row_count sb:Datapath_Binding 4095
>> 
>> OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted"
>> northd/ovn-northd.log])
>> 
>> 
>> On 4 Apr 2024, at 20:13, Ihar Hrachyshka  wrote:
>> 
>> The original version of the scenario passed with or without the fix.
>> 
>> Fixes: a1f165a7b807 ("northd: fix infinite loop in ovn_allocate_tnlid()")
>> Signed-off-by: Ihar Hrachyshka 
>> ---
>> tests/ovn-northd.at | 17 +++--
>> 1 file changed, 11 insertions(+), 6 deletions(-)
>> 
>> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
>> index fc2c972a4..e8ea8b050 100644
>> --- a/tests/ovn-northd.at
>> +++ b/tests/ovn-northd.at
>> @@ -2826,11 +2826,6 @@ OVN_FOR_EACH_NORTHD_NO_HV([
>> AT_SETUP([check tunnel ids exhaustion])
>> ovn_start
>> 
>> -# Create a fake chassis with vxlan encap to lower MAX DP tunnel key to
>> 2^12
>> -ovn-sbctl \
>> ---id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
>> --- --id=@c create chassis name=hv1 encaps=@e
>> -
>> cmd="ovn-nbctl --wait=sb"
>> 
>> for i in {1..4097}; do
>> @@ -2840,7 +2835,17 @@ done
>> eval $cmd
>> 
>> check_row_count nb:Logical_Switch 4097
>> -wait_row_count sb:Datapath_Binding 4095
>> +wait_row_count sb:Datapath_Binding 4097
>> +
>> +# Now create a fake chassis with vxlan encap to lower MAX DP tunnel key
>> to 2^12
>> +ovn-sbctl \
>> +--id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
>> +-- --id=@c create chassis name=hv1 encaps=@e
>> +
>> +ovn-nbctl --wait=sb ls-add lsw-exhausted
>> +
>> +check_row_count nb:Logical_Switch 4098
>> +wait_row_count sb:Datapath_Binding 4097
>> 
>> OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted"
>> northd/ovn-northd.log])
>> 
>> --
>> 2.41.0
>> 
>> ___
>> dev mailing list
>> d...@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>> 
>> 
>> 
>> 
>> 
>> Regards,
>> Vladislav Odintsov
>> 
>> 
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Regards,
Vladislav Odintsov

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] Make tunnel ids exhaustion test case trigger the problem.

2024-04-04 Thread Ihar Hrachyshka
On Thu, Apr 4, 2024 at 3:56 PM Vladislav Odintsov  wrote:

> Thanks Ihar for the patch.
>
> It definitely triggers the bug mentioned in Fixes commit, but how do you
> like next diff as an alternative?
> It seems a little easier to me, because it shows the real limit and the
> situation where the problem was (separate ls-add):
>

Is it a diff from main? I don't think it will trigger the issue. The key is
to trigger northd to change its max cap for tunnel ids AFTER it bumped hint
beyond the "vxlan mode max tun_id" (which is why I have to create vxlan
chassis AFTER I create enough LSs to get into unsafe territory.)

Note: I haven't tried your version yet; I may check your version some time
later. So it's the initial thought only.


>
> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
> index 6edb1129e..cef144f10 100644
> --- a/tests/ovn-northd.at
> +++ b/tests/ovn-northd.at
> @@ -2862,13 +2862,18 @@ ovn-sbctl \
>
>  cmd="ovn-nbctl --wait=sb"
>
> -for i in {1..4097}; do
> +for i in {1..4095}; do
>  cmd="${cmd} -- ls-add lsw-${i}"
>  done
>
>  eval $cmd
>
> -check_row_count nb:Logical_Switch 4097
> +check_row_count nb:Logical_Switch 4095
> +wait_row_count sb:Datapath_Binding 4095
> +
> +ovn-nbctl ls-add lsw-exhausted
> +
> +check_row_count nb:Logical_Switch 4096
>  wait_row_count sb:Datapath_Binding 4095
>
>  OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted"
> northd/ovn-northd.log])
>
>
> On 4 Apr 2024, at 20:13, Ihar Hrachyshka  wrote:
>
> The original version of the scenario passed with or without the fix.
>
> Fixes: a1f165a7b807 ("northd: fix infinite loop in ovn_allocate_tnlid()")
> Signed-off-by: Ihar Hrachyshka 
> ---
> tests/ovn-northd.at | 17 +++--
> 1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
> index fc2c972a4..e8ea8b050 100644
> --- a/tests/ovn-northd.at
> +++ b/tests/ovn-northd.at
> @@ -2826,11 +2826,6 @@ OVN_FOR_EACH_NORTHD_NO_HV([
> AT_SETUP([check tunnel ids exhaustion])
> ovn_start
>
> -# Create a fake chassis with vxlan encap to lower MAX DP tunnel key to
> 2^12
> -ovn-sbctl \
> ---id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
> --- --id=@c create chassis name=hv1 encaps=@e
> -
> cmd="ovn-nbctl --wait=sb"
>
> for i in {1..4097}; do
> @@ -2840,7 +2835,17 @@ done
> eval $cmd
>
> check_row_count nb:Logical_Switch 4097
> -wait_row_count sb:Datapath_Binding 4095
> +wait_row_count sb:Datapath_Binding 4097
> +
> +# Now create a fake chassis with vxlan encap to lower MAX DP tunnel key
> to 2^12
> +ovn-sbctl \
> +--id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
> +-- --id=@c create chassis name=hv1 encaps=@e
> +
> +ovn-nbctl --wait=sb ls-add lsw-exhausted
> +
> +check_row_count nb:Logical_Switch 4098
> +wait_row_count sb:Datapath_Binding 4097
>
> OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted"
> northd/ovn-northd.log])
>
> --
> 2.41.0
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
>
>
>
> Regards,
> Vladislav Odintsov
>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH ovn] Make tunnel ids exhaustion test case trigger the problem.

2024-04-04 Thread Vladislav Odintsov
Thanks Ihar for the patch.

It definitely triggers the bug mentioned in Fixes commit, but how do you like 
next diff as an alternative?
It seems a little easier to me, because it shows the real limit and the 
situation where the problem was (separate ls-add):

diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index 6edb1129e..cef144f10 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -2862,13 +2862,18 @@ ovn-sbctl \
 
 cmd="ovn-nbctl --wait=sb"
 
-for i in {1..4097}; do
+for i in {1..4095}; do
 cmd="${cmd} -- ls-add lsw-${i}"
 done
 
 eval $cmd
 
-check_row_count nb:Logical_Switch 4097
+check_row_count nb:Logical_Switch 4095
+wait_row_count sb:Datapath_Binding 4095
+
+ovn-nbctl ls-add lsw-exhausted
+
+check_row_count nb:Logical_Switch 4096
 wait_row_count sb:Datapath_Binding 4095
 
 OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted" 
northd/ovn-northd.log])


> On 4 Apr 2024, at 20:13, Ihar Hrachyshka  wrote:
> 
> The original version of the scenario passed with or without the fix.
> 
> Fixes: a1f165a7b807 ("northd: fix infinite loop in ovn_allocate_tnlid()")
> Signed-off-by: Ihar Hrachyshka 
> ---
> tests/ovn-northd.at | 17 +++--
> 1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
> index fc2c972a4..e8ea8b050 100644
> --- a/tests/ovn-northd.at
> +++ b/tests/ovn-northd.at
> @@ -2826,11 +2826,6 @@ OVN_FOR_EACH_NORTHD_NO_HV([
> AT_SETUP([check tunnel ids exhaustion])
> ovn_start
> 
> -# Create a fake chassis with vxlan encap to lower MAX DP tunnel key to 2^12
> -ovn-sbctl \
> ---id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
> --- --id=@c create chassis name=hv1 encaps=@e
> -
> cmd="ovn-nbctl --wait=sb"
> 
> for i in {1..4097}; do
> @@ -2840,7 +2835,17 @@ done
> eval $cmd
> 
> check_row_count nb:Logical_Switch 4097
> -wait_row_count sb:Datapath_Binding 4095
> +wait_row_count sb:Datapath_Binding 4097
> +
> +# Now create a fake chassis with vxlan encap to lower MAX DP tunnel key to 
> 2^12
> +ovn-sbctl \
> +--id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
> +-- --id=@c create chassis name=hv1 encaps=@e
> +
> +ovn-nbctl --wait=sb ls-add lsw-exhausted
> +
> +check_row_count nb:Logical_Switch 4098
> +wait_row_count sb:Datapath_Binding 4097
> 
> OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted" 
> northd/ovn-northd.log])
> 
> -- 
> 2.41.0
> 
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev




Regards,
Vladislav Odintsov

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


[ovs-dev] [PATCH ovn] Make tunnel ids exhaustion test case trigger the problem.

2024-04-04 Thread Ihar Hrachyshka
The original version of the scenario passed with or without the fix.

Fixes: a1f165a7b807 ("northd: fix infinite loop in ovn_allocate_tnlid()")
Signed-off-by: Ihar Hrachyshka 
---
 tests/ovn-northd.at | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index fc2c972a4..e8ea8b050 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -2826,11 +2826,6 @@ OVN_FOR_EACH_NORTHD_NO_HV([
 AT_SETUP([check tunnel ids exhaustion])
 ovn_start
 
-# Create a fake chassis with vxlan encap to lower MAX DP tunnel key to 2^12
-ovn-sbctl \
---id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
--- --id=@c create chassis name=hv1 encaps=@e
-
 cmd="ovn-nbctl --wait=sb"
 
 for i in {1..4097}; do
@@ -2840,7 +2835,17 @@ done
 eval $cmd
 
 check_row_count nb:Logical_Switch 4097
-wait_row_count sb:Datapath_Binding 4095
+wait_row_count sb:Datapath_Binding 4097
+
+# Now create a fake chassis with vxlan encap to lower MAX DP tunnel key to 2^12
+ovn-sbctl \
+--id=@e create encap chassis_name=hv1 ip="192.168.0.1" type="vxlan" \
+-- --id=@c create chassis name=hv1 encaps=@e
+
+ovn-nbctl --wait=sb ls-add lsw-exhausted
+
+check_row_count nb:Logical_Switch 4098
+wait_row_count sb:Datapath_Binding 4097
 
 OVS_WAIT_UNTIL([grep "all datapath tunnel ids exhausted" 
northd/ovn-northd.log])
 
-- 
2.41.0

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev