e9fee8635c
#### Why I did it Support the following tables which were introduced during dynamic buffer calculation - LOSSLESS_TRAFFIC_PATTERN - DEFAULT_LOSSLESS_BUFFER_PARAMETER #### How I did it - LOSSLESS_TRAFFIC_PATTERN |name|type|range|mandatory|description| |---|---|---|---|---| |mtu|uint16|64~10240|true|The maximum packet size of a lossless packet| |small_packet_percentage|uint8|0~100|true|The percentage of small packet| - DEFAULT_LOSSLESS_BUFFER_PARAMETER |name|type|range|mandatory|description| |---|---|---|---|---| |default_dynamic_th|int8|-8~7|true|The default dynamic_th for all buffer profiles that are dynamically generated for lossless PG| |over_subscribe_ratio|uint16|-|false|The oversubscribe ratio for shared headroom pool.| |||||Semantically, the upper bound is the number of physical ports but it can not be represented in the yang module. So we keep the upper bound open. As the type is (signed) integer whose lower bound is 0 by nature, we do not need to specify the range.| #### How to verify it Run unit test
59 lines
2.0 KiB
YANG
59 lines
2.0 KiB
YANG
module sonic-lossless-traffic-pattern {
|
|
|
|
yang-version 1.1;
|
|
|
|
namespace "http://github.com/Azure/sonic-lossless-traffic-pattern";
|
|
|
|
prefix lossless-traffic-pattern;
|
|
|
|
description "LOSSLESS_TRAFFIC_PATTERN YANG module for SONiC OS";
|
|
|
|
revision 2022-05-31 {
|
|
description "Initial version";
|
|
}
|
|
|
|
container sonic-lossless-traffic-pattern {
|
|
container LOSSLESS_TRAFFIC_PATTERN {
|
|
|
|
description "LOSSLESS_TRAFFIC_PATTERN part of config_db.json";
|
|
|
|
list LOSSLESS_TRAFFIC_PATTERN_LIST {
|
|
key "name";
|
|
|
|
leaf name {
|
|
type string {
|
|
pattern '[a-zA-Z0-9]{1}([-a-zA-Z0-9_]{0,31})' {
|
|
error-message "Invalid lossless traffic pattern list name.";
|
|
error-app-tag lossless-traffic-pattern-invalid-list-name;
|
|
}
|
|
length 1..32 {
|
|
error-message "Invalid length for the lossless traffic pattern list name.";
|
|
error-app-tag lossless-traffic-pattern-invalid-list-name-length;
|
|
}
|
|
}
|
|
}
|
|
|
|
leaf mtu {
|
|
type uint16 {
|
|
range 1..9216 {
|
|
error-message "Invaild MTU which should be in [1, 9216].";
|
|
}
|
|
}
|
|
mandatory true;
|
|
description "The maximum packet size of a lossless packet";
|
|
}
|
|
|
|
leaf small_packet_percentage {
|
|
type uint8 {
|
|
range 0..100 {
|
|
error-message "Invalid small packets percentage which should be in [0, 100].";
|
|
}
|
|
}
|
|
mandatory true;
|
|
description "The percentage of small packets which is used to calculate the headroom size";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|