Skip to content

Commit 8339ffe

Browse files
authored
Added the 'ttl_mode' attribute for VxLANs. (#24657)
Why I did it To allow specifying the decap TTL mode used for each VxLAN tunnel. Work item tracking Microsoft ADO (number only): 35743756 How I did it Added the new attribtue ttl_mode for each VxLAN, which can be set to uniform or pipe. sonic-swss PR: sonic-net/sonic-swss#3963 How to verify it Run the tests modified in this PR, or build an image with these changes and see if this attribute can be set without any errors.
1 parent 1754233 commit 8339ffe

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

src/sonic-yang-models/doc/Configuration.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,7 +2837,8 @@ Single tunnel example:
28372837
"VXLAN_TUNNEL": {
28382838
"vtep1": {
28392839
"src_ip": "10.10.10.10",
2840-
"dst_ip": "12.12.12.12"
2840+
"dst_ip": "12.12.12.12",
2841+
"ttl_mode": "pipe"
28412842
}
28422843
},
28432844
"VXLAN_TUNNEL_MAP": {
@@ -2864,7 +2865,8 @@ Dual tunnel example:
28642865
"VXLAN_TUNNEL": {
28652866
"vtep1": {
28662867
"src_ip": "10.10.10.10",
2867-
"dst_ip": "12.12.12.12"
2868+
"dst_ip": "12.12.12.12",
2869+
"ttl_mode": "uniform"
28682870
},
28692871
"vtep2": {
28702872
"src_ip": "10.20.10.10",

src/sonic-yang-models/tests/yang_model_tests/tests/vxlan.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,12 @@
4141
},
4242
"VXLAN_TUNNEL_NAME_STRING_VALID_TEST": {
4343
"desc": "Tunnel name as arbitrary string is valid"
44+
},
45+
"VXLAN_TUNNEL_VALID_TTL_MODE_TEST": {
46+
"desc": "Valid config with 'pipe' and 'uniform' TTL modes"
47+
},
48+
"VXLAN_TUNNEL_INVALID_TTL_MODE_TEST": {
49+
"desc": "Invalid config with an unsupported TTL mode",
50+
"eStrKey": "Pattern"
4451
}
4552
}

src/sonic-yang-models/tests/yang_model_tests/tests_config/vxlan.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,5 +351,36 @@
351351
]
352352
}
353353
}
354+
},
355+
"VXLAN_TUNNEL_VALID_TTL_MODE_TEST": {
356+
"sonic-vxlan:sonic-vxlan": {
357+
"sonic-vxlan:VXLAN_TUNNEL": {
358+
"VXLAN_TUNNEL_LIST": [
359+
{
360+
"name": "tunnel_v4-1",
361+
"src_ip": "5.6.7.8",
362+
"ttl_mode": "pipe"
363+
},
364+
{
365+
"name": "tunnel_v4-2",
366+
"src_ip": "1.2.3.4",
367+
"ttl_mode": "uniform"
368+
}
369+
]
370+
}
371+
}
372+
},
373+
"VXLAN_TUNNEL_INVALID_TTL_MODE_TEST": {
374+
"sonic-vxlan:sonic-vxlan": {
375+
"sonic-vxlan:VXLAN_TUNNEL": {
376+
"VXLAN_TUNNEL_LIST": [
377+
{
378+
"name": "invalid_tunnel",
379+
"src_ip": "1.2.3.4",
380+
"ttl_mode": "invalid"
381+
}
382+
]
383+
}
384+
}
354385
}
355-
}
386+
}

src/sonic-yang-models/yang-models/sonic-vxlan.yang

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ module sonic-vxlan {
5959
leaf dst_ip {
6060
type inet:ip-address;
6161
}
62+
63+
leaf ttl_mode {
64+
description "Decap TTL mode";
65+
type string {
66+
pattern "uniform|pipe";
67+
}
68+
}
6269
}
6370
}
6471

0 commit comments

Comments
 (0)