Skip to content

Commit

Permalink
[YANG] Update device_metadata to add suppress-fib-pending field (soni…
Browse files Browse the repository at this point in the history
…c-net#19329)

Why I did it
BGP pending FIB suppression is introduced in sonic-net#12853, hence updating the YANG model.

Work item tracking
Microsoft ADO (number only): 28398135
How I did it
Added a new field 'suppress-fib-pending' in the DEVICE_METADATA YANG model table.
Added UT for YANG model changes.

How to verify it
Run PR tests.
Apply empty.json file to verify:

admin@str2-7050cx3-acs-02:~$ sudo config apply-patch empty.json 
Patch Applier: Patch application starting.
Patch Applier: Patch: []
Patch Applier: Getting current config db.
Patch Applier: Simulating the target full config after applying the patch.
Patch Applier: Validating all JsonPatch operations are permitted on the specified fields
Patch Applier: Validating target config does not have empty tables, since they do not show up in ConfigDb.
Patch Applier: Sorting patch updates.
Patch Applier: The patch was converted into 0 changes.
Patch Applier: Applying 0 changes in order.
Patch Applier: Verifying patch updates are reflected on ConfigDB.
Patch Applier: Patch application completed.
Patch applied successfully.
admin@str2-7050cx3-acs-02:~$ 
Signed-off-by: zitingguo-ms zitingguo@microsoft.com
  • Loading branch information
Gfrom2016 authored Jun 20, 2024
1 parent 48ec8cd commit 8fb3fde
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@
"bgp_adv_lo_prefix_as_128": "true",
"yang_config_validation": "disable",
"rack_mgmt_map": "dummy_value",
"timezone": "Europe/Kiev"
"timezone": "Europe/Kiev",
"synchronous_mode": "enable",
"suppress-fib-pending": "disabled"
}
},
"VLAN": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,15 @@
"DEVICE_METADATA_INVALID_CREATE_ONLY_CONFIG_DB_BUFFERS": {
"desc": "Verifying invalid create_only_config_db_buffers value",
"eStrKey": "InvalidValue"
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": {
"desc": "Enable bgp-suppress-fib-pending"
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": {
"desc": "Disable bgp-suppress-fib-pending"
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": {
"desc": "Enable bgp-suppress-fib-pending when synchronous mode is disabled",
"eStr": ["ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature"]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -386,5 +386,35 @@
}
}
}
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"synchronous_mode": "enable",
"suppress-fib-pending": "enabled"
}
}
}
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_DISABLED": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"synchronous_mode": "disable",
"suppress-fib-pending": "disabled"
}
}
}
},
"DEVICE_METADATA_SUPPRESS_PENDING_FIB_ENABLED_SYNCHRONOUS_MODE_DISABLED": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"synchronous_mode": "disable",
"suppress-fib-pending": "enabled"
}
}
}
}
}
9 changes: 9 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-device_metadata.yang
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ module sonic-device_metadata {
otherwise the maximum available buffers (which are read from SAI) will be
created, regardless of the CONFIG_DB buffers configuration.";
}

leaf suppress-fib-pending {
type stypes:admin_mode;
default disabled;
description "Enable BGP suppress FIB pending feature. BGP will wait for route FIB installation before announcing routes";
must "((current() = 'disabled') or (current() = 'enabled' and ../synchronous_mode = 'enable'))" {
error-message "ASIC synchronous mode must be enabled in order to enable suppress FIB pending feature";
}
}
}
/* end of container localhost */
}
Expand Down

0 comments on commit 8fb3fde

Please sign in to comment.