UDF yang model definition.#26874
Open
srodd-nexthop wants to merge 3 commits into
Open
Conversation
|
|
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced Apr 17, 2026
7a10672 to
0de8e26
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
0de8e26 to
31eba2e
Compare
Collaborator
|
/azp run Azure.sonic-buildimage |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Author
|
/azp run Azure.sonic-buildimage |
|
Commenter does not have sufficient privileges for PR 26874 in repo sonic-net/sonic-buildimage |
6 tasks
srodd-nexthop
added a commit
to nexthop-ai/sonic-mgmt
that referenced
this pull request
May 11, 2026
Adds tests/udf/test_udf.py covering the UDF feature added in sonic-net/sonic-swss#4493 (UdfOrch), sonic-net/sonic-buildimage#26874 (YANG), and sonic-net/sonic-sairedis#1856 (meta validation). Registers the suite under t0 and t1-lag in .azure-pipelines/pr_test_scripts.yaml. Coverage (18 test classes, 30+ test methods): - Baseline ASIC_DB programming and CONFIG_DB schema - UDP traffic match through UDF-backed ACL fields - ACL rule create/delete with UDF dependencies - UDF/ACL teardown ordering (correct-order and wrong-order recovery) - ACL rule priority shadowing - Forward reference resolution (TABLE_TYPE configured before SELECTOR) - Multiple selectors per UDF group, distinct OIDs - Invalid CONFIG_DB rejection (negative tests) - SAI UDF_MATCH/UDF attribute round-trip from CONFIG_DB - L3-type auto-mask, L4-port-zero match presence detection - Match type filtering at packet level - Selector field validation (missing/unknown base, missing match) - Selector immutability and idempotent SET handling - UDF_MATCH refcount sharing across selectors (dedup) - UDF_GROUP refcount layering (TABLE_TYPE / TABLE / multi-table) - ACL rule blocking selector deletion - Edge cases (rule with UDF not in table, double-delete, type-vs-table deletion ordering) - End-to-end traffic with full UDF + ACL pipeline All config done directly via sonic-cfggen -j -w; SAI object lifecycle verified via ASIC_DB OID diffing. Module-scoped LogAnalyzer captures unexpected orchagent errors in non-failing mode (negative tests deliberately trigger SWSS_LOG_ERRORs that are ignored via regex). conftest.py overrides yang_validation_check with a UDF-scoped equivalent that validates only UDF/UDF_SELECTOR tables against sonic-udf.yang (avoids spurious failures from FLEX_COUNTER_TABLE entries not covered by installed YANG models on some platforms). Signed-off-by: satishkumar <srodd@nexthop.ai>
srodd-nexthop
added a commit
to nexthop-ai/sonic-mgmt
that referenced
this pull request
May 11, 2026
Adds tests/udf/test_udf.py covering the UDF feature added in sonic-net/sonic-swss#4493 (UdfOrch), sonic-net/sonic-buildimage#26874 (YANG), and sonic-net/sonic-sairedis#1856 (meta validation). Registers the suite under t0 and t1-lag in .azure-pipelines/pr_test_scripts.yaml. Coverage (18 test classes, 30+ test methods): - Baseline ASIC_DB programming and CONFIG_DB schema - UDP traffic match through UDF-backed ACL fields - ACL rule create/delete with UDF dependencies - UDF/ACL teardown ordering (correct-order and wrong-order recovery) - ACL rule priority shadowing - Forward reference resolution (TABLE_TYPE configured before SELECTOR) - Multiple selectors per UDF group, distinct OIDs - Invalid CONFIG_DB rejection (negative tests) - SAI UDF_MATCH/UDF attribute round-trip from CONFIG_DB - L3-type auto-mask, L4-port-zero match presence detection - Match type filtering at packet level - Selector field validation (missing/unknown base, missing match) - Selector immutability and idempotent SET handling - UDF_MATCH refcount sharing across selectors (dedup) - UDF_GROUP refcount layering (TABLE_TYPE / TABLE / multi-table) - ACL rule blocking selector deletion - Edge cases (rule with UDF not in table, double-delete, type-vs-table deletion ordering) - End-to-end traffic with full UDF + ACL pipeline All config done directly via sonic-cfggen -j -w; SAI object lifecycle verified via ASIC_DB OID diffing. Module-scoped LogAnalyzer captures unexpected orchagent errors in non-failing mode (negative tests deliberately trigger SWSS_LOG_ERRORs that are ignored via regex). Signed-off-by: satishkumar <srodd@nexthop.ai>
srodd-nexthop
added a commit
to nexthop-ai/sonic-mgmt
that referenced
this pull request
May 11, 2026
Adds tests/udf/test_udf.py covering the UDF feature added in sonic-net/sonic-swss#4493 (UdfOrch), sonic-net/sonic-buildimage#26874 (YANG), and sonic-net/sonic-sairedis#1856 (meta validation). Registers the suite under t0 and t1-lag in .azure-pipelines/pr_test_scripts.yaml. Coverage (18 test classes, 30+ test methods): - Baseline ASIC_DB programming and CONFIG_DB schema - UDP traffic match through UDF-backed ACL fields - ACL rule create/delete with UDF dependencies - UDF/ACL teardown ordering (correct-order and wrong-order recovery) - ACL rule priority shadowing - Forward reference resolution (TABLE_TYPE configured before SELECTOR) - Multiple selectors per UDF group, distinct OIDs - Invalid CONFIG_DB rejection (negative tests) - SAI UDF_MATCH/UDF attribute round-trip from CONFIG_DB - L3-type auto-mask, L4-port-zero match presence detection - Match type filtering at packet level - Selector field validation (missing/unknown base, missing match) - Selector immutability and idempotent SET handling - UDF_MATCH refcount sharing across selectors (dedup) - UDF_GROUP refcount layering (TABLE_TYPE / TABLE / multi-table) - ACL rule blocking selector deletion - Edge cases (rule with UDF not in table, double-delete, type-vs-table deletion ordering) - End-to-end traffic with full UDF + ACL pipeline All config done directly via sonic-cfggen -j -w; SAI object lifecycle verified via ASIC_DB OID diffing. Module-scoped LogAnalyzer captures unexpected orchagent errors in non-failing mode (negative tests deliberately trigger SWSS_LOG_ERRORs that are ignored via regex). Signed-off-by: satishkumar <srodd@nexthop.ai>
Signed-off-by: satishkumar rodd <srodd@nexthop.ai>
31eba2e to
ec20204
Compare
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
srodd-nexthop
added a commit
to nexthop-ai/sonic-mgmt
that referenced
this pull request
May 12, 2026
Adds tests/udf/test_udf.py covering the UDF feature added in sonic-net/sonic-swss#4493 (UdfOrch), sonic-net/sonic-buildimage#26874 (YANG), and sonic-net/sonic-sairedis#1856 (meta validation). Registers the suite under t0 and t1-lag in .azure-pipelines/pr_test_scripts.yaml. Coverage (18 test classes, 30+ test methods): - Baseline ASIC_DB programming and CONFIG_DB schema - UDP traffic match through UDF-backed ACL fields - ACL rule create/delete with UDF dependencies - UDF/ACL teardown ordering (correct-order and wrong-order recovery) - ACL rule priority shadowing - Forward reference resolution (TABLE_TYPE configured before SELECTOR) - Multiple selectors per UDF group, distinct OIDs - Invalid CONFIG_DB rejection (negative tests) - SAI UDF_MATCH/UDF attribute round-trip from CONFIG_DB - L3-type auto-mask, L4-port-zero match presence detection - Match type filtering at packet level - Selector field validation (missing/unknown base, missing match) - Selector immutability and idempotent SET handling - UDF_MATCH refcount sharing across selectors (dedup) - UDF_GROUP refcount layering (TABLE_TYPE / TABLE / multi-table) - ACL rule blocking selector deletion - Edge cases (rule with UDF not in table, double-delete, type-vs-table deletion ordering) - End-to-end traffic with full UDF + ACL pipeline All config done directly via sonic-cfggen -j -w; SAI object lifecycle verified via ASIC_DB OID diffing. Module-scoped LogAnalyzer captures unexpected orchagent errors in non-failing mode (negative tests deliberately trigger SWSS_LOG_ERRORs that are ignored via regex). Signed-off-by: satishkumar <srodd@nexthop.ai>
Signed-off-by: Satishkumar Rodd <srodd@nexthop.ai>
Signed-off-by: Satishkumar Rodd <srodd@nexthop.ai>
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.
HLD: sonic-net/SONiC#2299
Why I did it
Adds the YANG model for the new UDF (User-Defined Field) feature in SONiC. UDF allows ACLs to match on arbitrary byte offsets within a packet, enabling classification of protocols not covered by standard ACL fields (e.g., RoCEv2 BTH, GRE inner headers).
The companion orchagent implementation is in sonic-net/sonic-swss#4493. This PR adds only the YANG schema.
Work item tracking
How I did it
Added
src/sonic-yang-models/yang-models/sonic-udf.yangdefining two CONFIG_DB tables:UDF— UDF field definition. Keys:UDF_NAME. Fields:length(1–255),field_type(GENERIC|HASH),description.UDF_SELECTOR— per-packet-type extraction rule. Keys:UDF_NAME|SELECTOR_NAME. Flat CONFIG_DB fields:select_base(enumL2|L3|L4, mandatory) andselect_offset(uint8 0–255, mandatory) — extraction locationmatch_l2_type/match_l2_type_mask,match_l3_type/match_l3_type_mask,match_gre_type/match_gre_type_mask,match_l4_dst_port/match_l4_dst_port_mask— packet-match criteria (hex strings; at least one of the four type/port fields must be set)match_priority(uint8 0–255, default 0) — selector priority when multiple matchUDF_SELECTOR.UDF_NAMEis aleafreftoUDF.UDF_NAME, so a selector cannot reference a non-existent UDF field.Also updated:
src/sonic-yang-models/setup.pyto register the new module.src/sonic-yang-models/tests/files/sample_config_db.jsonwith aUDF+UDF_SELECTORexample for validation.How to verify it
The
sample_config_db.jsonadditions exercise the new leafref and per-field type/pattern validation; validation should pass cleanly.Which release branch to backport (provide reason below if selected)
Not a backport — new feature.
Tested branch (Please provide the tested image version)
masterDescription for the changelog
Add YANG model for UDF (
UDFandUDF_SELECTORtables) to support ACL matching on user-defined byte offsets.