Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added vni field in VRF Yang for VxLAN L3 VNI Support #13456 #13735

Merged
merged 3 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -1882,6 +1882,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 @@ -1903,7 +1904,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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,27 @@
}]
}
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tapashdas Can you please add one more test for negative scenario (out of range)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


"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