forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding YANG model for TC_TO_DSCP_MAP (sonic-net#21395)
Fixed issue : sonic-net#20575 Why I did it "config-reload" in dualtor topologies were failing due to absence of TC_TO_DSCP Yang model. The above failure was seen after the the PR sonic-net/sonic-utilities#3102 How to verify it Step-1: In DUT add the yang file to "/usr/local/yang-models/sonic-tc-dscp-map.yang" to this path. Step-2: config reload -y Tested branch (Please provide the tested image version) 202411 Description for the changelog Adding YANG model for TC_TO_DSCP_MAP along with test files.
- Loading branch information
1 parent
dae9be5
commit ab63ada
Showing
6 changed files
with
182 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
module sonic-tc-dscp-map { | ||
|
||
yang-version 1.1; | ||
|
||
namespace "http://github.com/sonic-net/sonic-tc-dscp-map"; | ||
|
||
prefix tdm; | ||
|
||
import sonic-types { | ||
prefix stypes; | ||
} | ||
|
||
organization | ||
"SONiC"; | ||
|
||
contact | ||
"SONiC"; | ||
|
||
description | ||
"TC_TO_DSCP_MAP yang Module for SONiC OS"; | ||
|
||
revision 2025-01-10 { | ||
description | ||
"Initial revision."; | ||
} | ||
|
||
container sonic-tc-dscp-map { | ||
|
||
container TC_TO_DSCP_MAP { | ||
|
||
description "TC_TO_DSCP_MAP part of config_db.json"; | ||
|
||
list TC_TO_DSCP_MAP_LIST { | ||
|
||
key "name"; | ||
|
||
leaf name { | ||
type string { | ||
pattern '[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,31})'; | ||
length 1..32 { | ||
error-message "Invalid length for map name."; | ||
error-app-tag map-name-invalid-length; | ||
} | ||
} | ||
} | ||
|
||
list TC_TO_DSCP_MAP { //this is list inside list for storing mapping between two fields | ||
|
||
key "tc"; | ||
|
||
leaf tc { | ||
type stypes:tc_type; | ||
} | ||
|
||
leaf dscp { | ||
type string { | ||
pattern "6[0-3]|[1-5][0-9]?|[0-9]?" { | ||
error-message "Invalid DSCP"; | ||
error-app-tag dscp-invalid; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |