frr-mgmt-framework, YANG: add IPv6 ND/RA support for VLAN_INTERFACE#26872
Open
zedzean wants to merge 1 commit intosonic-net:masterfrom
Open
frr-mgmt-framework, YANG: add IPv6 ND/RA support for VLAN_INTERFACE#26872zedzean wants to merge 1 commit intosonic-net:masterfrom
zedzean wants to merge 1 commit intosonic-net:masterfrom
Conversation
|
|
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Add support for IPv6 Neighbor Discovery / Router Advertisement configuration on VLAN interfaces via ConfigDB. Aligned with HLD PR sonic-net/SONiC#2165. Three interface-level flag leaves are added to VLAN_INTERFACE_LIST with OpenConfig mapping specified in the HLD: * nd_suppress_ra -> oc-ip:router-advertisement/config/suppress * nd_managed_config_flag -> oc-ip:router-advertisement/config/managed * nd_other_config_flag -> oc-ip:router-advertisement/config/other-config A fourth leaf (nd_ra_interval) is added as an extension with no OpenConfig mapping in the current HLD, bounded to the FRR-supported range of 1..1800 seconds. frrcfgd translates each ConfigDB field to the equivalent FRR vtysh command in the interface context, using the standard {no:no-prefix} convention from PR sonic-net#21697 (admin_status handler). DELETE events restore the per-flag FRR default via two handler variants (hdl_nd_flag_default_on and hdl_nd_flag_default_off) so the interface ends up in the same state as if the ConfigDB entry had never existed. Tests added: * tests/yang_model_tests/tests/vlan_interface.json (10 cases: 5 positive, 4 negative, 1 combined) * tests/yang_model_tests/tests_config/vlan_interface.json * tests/files/sample_config_db.json updated with ND fields on Vlan111 Signed-off-by: Zaahir Ahmed Syed <zaahir@cloudflare.com>
3dd8e4f to
05622c4
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
There is no ConfigDB-native mechanism to configure IPv6 Neighbor Discovery / Router Advertisement parameters on VLAN interfaces in SONiC today. The only way to apply
ipv6 nd suppress-ra,ipv6 nd managed-config-flag,ipv6 nd other-config-flag, oripv6 nd ra-interval <N>to an SVI is to issue vtysh commands manually, which do not persist and are outside the frrcfgd management framework.This change aligns with the direction proposed in SONiC HLD #2165 (OpenConfig Interfaces Router Advertisement, targeted at the 202605 release) by adding the three interface-level flag leaves to
VLAN_INTERFACE_LISTand implementing the frrcfgd translation to zebra interface-context commands.A fourth leaf (
nd_ra_interval) is added as a SONiC-native extension. It has no OpenConfig mapping in the current HLD but is useful for the common operational case of tuning the unsolicited RA cadence. Reviewers: if you'dprefer this deferred to a separate PR until it lands in the HLD, please say so and I'll split the patch.
How I did it
YANG (
sonic-vlan.yang): added four new leaves toVLAN_INTERFACE_LIST:nd_suppress_rabooleanrouter-advertisement/config/suppressnd_managed_config_flagbooleanrouter-advertisement/config/managednd_other_config_flagbooleanrouter-advertisement/config/other-confignd_ra_intervaluint32range1..1800A new revision entry was added to the yang file.
frrcfgd (
frrcfgd.py): subscribed to theVLAN_INTERFACEtable, introduced avlan_intf_nd_key_mapusing the standard{no:no-prefix}convention established by PR #21697 (hdl_admin_statusstyle). Interface-context command dispatch follows the existingPIM_INTERFACE/IGMP_INTERFACEpattern.DELETE semantics restore per-flag FRR defaults rather than blindly emitting
no <cmd>. Two handler variants make this explicit:hdl_nd_flag_default_on(used forsuppress-rawhose FRR default is enabled on non-P2P interfaces) andhdl_nd_flag_default_off(used for the M/O flags whose FRR default is disabled). This keeps the observable behaviour symmetric: creating then deleting aVLAN_INTERFACEentry leaves the interface in the same state as if the entry had never existed.How to verify it
Yang validation rejects invalid input:
DELETE restores the FRR default:
Tested on SONiC in unified routing config mode with FRR 10.4.1 on a
top-of-rack switch. Full test matrix (19 tests: 9 direct ConfigDB writes,
3 delete-semantics checks, 7 apply-patch end-to-end) passes.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
frr-mgmt-framework, YANG: add IPv6 ND/RA support for VLAN_INTERFACE
Link to config_db schema for YANG module changes
See HLD sonic-net/SONiC#2165 for the schema spec.
A picture of a cute animal (not mandatory but encouraged)