Skip to content

Commit ebb3945

Browse files
tapashdasdgsudharsan
authored andcommitted
Added vni field in VRF Yang for VxLAN L3 VNI Support sonic-net#13456 (sonic-net#13735)
Why I did it Added vni field in VRF Yang for VxLAN L3 VNI Support. The VRF table schema as per EVPN HLD is below https://github.com/sonic-net/SONiC/blob/master/doc/vxlan/EVPN/EVPN_VXLAN_HLD.md Addresses Issue sonic-net#13456
1 parent 18bc044 commit ebb3945

File tree

5 files changed

+41
-2
lines changed

5 files changed

+41
-2
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ table allow to change properties of a virtual router. Attributes:
17271727
- 'ip_opt_action' contains packet action. Defines the action for
17281728
packets with IP options
17291729
- 'l3_mc_action' contains packet action. Defines the action for
1730-
unknown L3 multicast packets
1730+
- 'vni' contains L3 VNI value. VNI associated Virtual router instance.
17311731

17321732
The packet action could be:
17331733

@@ -1749,7 +1749,8 @@ The packet action could be:
17491749
'src_mac': '02:04:05:06:07:08',
17501750
'ttl_action': 'copy',
17511751
'ip_opt_action': 'deny',
1752-
'l3_mc_action': 'drop'
1752+
'l3_mc_action': 'drop',
1753+
'vni': '100'
17531754
}
17541755
```
17551756

src/sonic-yang-models/tests/files/sample_config_db.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"SAMPLE_CONFIG_DB_JSON": {
33
"VRF": {
44
"Vrf_blue": {
5+
"vni" : "100"
56
}
67
},
78
"DHCP_SERVER": {

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

+7
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@
88
},
99
"VRF_TEST_WITH_FALLBACK": {
1010
"desc": "Configure VRF with fallback in VRF table."
11+
},
12+
"VRF_TEST_WITH_VNI": {
13+
"desc": "Configure VRF with VNI in VRF table."
14+
},
15+
"VRF_TEST_WITH_VNI_OOR": {
16+
"desc": "Configure VRF with out of range VNI in VRF table.",
17+
"eStrKey": "Range"
1118
}
1219
}

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

+22
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,27 @@
2828
}]
2929
}
3030
}
31+
},
32+
33+
"VRF_TEST_WITH_VNI": {
34+
"sonic-vrf:sonic-vrf": {
35+
"sonic-vrf:VRF": {
36+
"VRF_LIST": [{
37+
"name": "Vrf_blue",
38+
"vni": "100"
39+
}]
40+
}
41+
}
42+
},
43+
44+
"VRF_TEST_WITH_VNI_OOR": {
45+
"sonic-vrf:sonic-vrf": {
46+
"sonic-vrf:VRF": {
47+
"VRF_LIST": [{
48+
"name": "Vrf_blue",
49+
"vni": "16777216"
50+
}]
51+
}
52+
}
3153
}
3254
}

src/sonic-yang-models/yang-models/sonic-vrf.yang

+8
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ module sonic-vrf {
4343
"Enable/disable fallback feature which is useful for specified VRF user to access internet through global/main route.";
4444
}
4545

46+
leaf vni {
47+
type uint32 {
48+
range "0..16777215";
49+
}
50+
default 0;
51+
description
52+
"VNI mapped to VRF";
53+
}
4654
} /* end of list VRF_LISt */
4755
} /* end of container VRf */
4856
} /* end of container sonic-vrf */

0 commit comments

Comments
 (0)