Skip to content

Commit

Permalink
[202211]Added vni field in VRF Yang for VxLAN L3 VNI Support (#13980)
Browse files Browse the repository at this point in the history
Manual cherry-pick of #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 #13456
  • Loading branch information
dgsudharsan committed Feb 28, 2023
1 parent ff5605a commit 76cc29b
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 @@ -1728,6 +1728,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 @@ -1749,7 +1750,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 76cc29b

Please sign in to comment.