dfddd55cbf
#### Why I did it POLL_INTERVAL cannot be set if any of the detection/restoration times in this table is less than the POLL_INTERVAL. #### How I did it Add "must" constraint to make sure detection/restoration times are greater than POLL_INTERVAL. #### How to verify it Use apply-patch command to update POLL_INTERVAL. Build sonic-yang-model.
86 lines
2.9 KiB
YANG
86 lines
2.9 KiB
YANG
module sonic-pfcwd {
|
|
namespace "http://github.com/Azure/sonic-pfcwd";
|
|
prefix sonic-pfcwd;
|
|
|
|
yang-version 1.1;
|
|
|
|
import sonic-port {
|
|
prefix port;
|
|
}
|
|
|
|
organization
|
|
"SONiC";
|
|
|
|
contact
|
|
"SONiC";
|
|
|
|
description
|
|
"SONIC PFC Watchdog parameters";
|
|
|
|
revision 2021-07-01 {
|
|
description
|
|
"Initial revision.";
|
|
}
|
|
|
|
container sonic-pfcwd {
|
|
container PFC_WD {
|
|
list PFC_WD_LIST {
|
|
key "ifname";
|
|
leaf ifname {
|
|
type union {
|
|
type leafref {
|
|
path "/port:sonic-port/port:PORT/port:PORT_LIST/port:name";
|
|
}
|
|
type string {
|
|
pattern "GLOBAL" {
|
|
error-message "Invalid interface name";
|
|
error-app-tag interface-name-invalid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
leaf action {
|
|
must "../ifname != 'GLOBAL'";
|
|
type enumeration {
|
|
enum drop;
|
|
enum forward;
|
|
enum alert;
|
|
}
|
|
description
|
|
"PFC watchdog action when entering storm state.";
|
|
}
|
|
leaf detection_time {
|
|
must "../ifname != 'GLOBAL'";
|
|
must "(not(boolean(current()/../../PFC_WD_LIST[ifname='GLOBAL'])) or (current() >= current()/../../PFC_WD_LIST[ifname='GLOBAL']/POLL_INTERVAL))" {
|
|
error-message "detection_time must be greater than or equal to POLL_INTERVAL";
|
|
}
|
|
type uint32 {
|
|
range 100..5000;
|
|
}
|
|
description
|
|
"Detection interval for pause storm in msec.";
|
|
}
|
|
leaf restoration_time {
|
|
must "../ifname != 'GLOBAL'";
|
|
must "(not(boolean(current()/../../PFC_WD_LIST[ifname='GLOBAL'])) or (current() >= current()/../../PFC_WD_LIST[ifname='GLOBAL']/POLL_INTERVAL))" {
|
|
error-message "restoration_time must be greater than or equal to POLL_INTERVAL";
|
|
}
|
|
type uint32 {
|
|
range 100..60000;
|
|
}
|
|
description
|
|
"Time delay before resuming normal PFC operation in msec.";
|
|
}
|
|
leaf POLL_INTERVAL {
|
|
must "../ifname = 'GLOBAL'";
|
|
type uint32 {
|
|
range 100..3000;
|
|
}
|
|
description
|
|
"PFC watchdog global polling interval in msec.";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|