> On 5 Apr 2024, at 18:35, Ihar Hrachyshka <[email protected]> wrote:
> 
> On Thu, Apr 4, 2024 at 3:56 PM Vladislav Odintsov <[email protected] 
> <mailto:[email protected]>> 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 <http://ovn-northd.at/> 
>> b/tests/ovn-northd.at <http://ovn-northd.at/>
>> index 6edb1129e..cef144f10 100644
>> --- a/tests/ovn-northd.at <http://ovn-northd.at/>
>> +++ b/tests/ovn-northd.at <http://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 <[email protected] 
>>> <mailto:[email protected]>> 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 <[email protected] 
>>> <mailto:[email protected]>>
>>> ---
>>> tests/ovn-northd.at <http://ovn-northd.at/> | 17 +++++++++++------
>>> 1 file changed, 11 insertions(+), 6 deletions(-)
>>> 
>>> diff --git a/tests/ovn-northd.at <http://ovn-northd.at/> 
>>> b/tests/ovn-northd.at <http://ovn-northd.at/>
>>> index fc2c972a4..e8ea8b050 100644
>>> --- a/tests/ovn-northd.at <http://ovn-northd.at/>
>>> +++ b/tests/ovn-northd.at <http://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
>>> [email protected] <mailto:[email protected]>
>>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>> 
>> 
>> 
>> 
>> Regards,
>> Vladislav Odintsov
>> 


Regards,
Vladislav Odintsov

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to