Skip to content

Commit

Permalink
Added vni field in VRF Yang for VxLAN L3 VNI Support #13456 (#13735)
Browse files Browse the repository at this point in the history
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 #13456
  • Loading branch information
tapashdas authored Feb 23, 2023
1 parent ee1b6b3 commit 95ce319
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,7 @@ table allow to change properties of a virtual router. Attributes:
packets with IP options
- 'l3_mc_action' contains packet action. Defines the action for
unknown L3 multicast packets
- 'vni' contains L3 VNI value. VNI associated Virtual router instance.

The packet action could be:

Expand All @@ -1904,7 +1905,8 @@ The packet action could be:
'src_mac': '02:04:05:06:07:08',
'ttl_action': 'copy',
'ip_opt_action': 'deny',
'l3_mc_action': 'drop'
'l3_mc_action': 'drop',
'vni': '100'
}
```

Expand Down
1 change: 1 addition & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"SAMPLE_CONFIG_DB_JSON": {
"VRF": {
"Vrf_blue": {
"vni" : "100"
}
},
"DHCP_SERVER": {
Expand Down
7 changes: 7 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/vrf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@
},
"VRF_TEST_WITH_FALLBACK": {
"desc": "Configure VRF with fallback in VRF table."
},
"VRF_TEST_WITH_VNI": {
"desc": "Configure VRF with VNI in VRF table."
},
"VRF_TEST_WITH_VNI_OOR": {
"desc": "Configure VRF with out of range VNI in VRF table.",
"eStrKey": "Range"
}
}
22 changes: 22 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/vrf.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,27 @@
}]
}
}
},

"VRF_TEST_WITH_VNI": {
"sonic-vrf:sonic-vrf": {
"sonic-vrf:VRF": {
"VRF_LIST": [{
"name": "Vrf_blue",
"vni": "100"
}]
}
}
},

"VRF_TEST_WITH_VNI_OOR": {
"sonic-vrf:sonic-vrf": {
"sonic-vrf:VRF": {
"VRF_LIST": [{
"name": "Vrf_blue",
"vni": "16777216"
}]
}
}
}
}
8 changes: 8 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-vrf.yang
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ module sonic-vrf {
"Enable/disable fallback feature which is useful for specified VRF user to access internet through global/main route.";
}

leaf vni {
type uint32 {
range "0..16777215";
}
default 0;
description
"VNI mapped to VRF";
}
} /* end of list VRF_LISt */
} /* end of container VRf */
} /* end of container sonic-vrf */
Expand Down

0 comments on commit 95ce319

Please sign in to comment.