Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/sonic-yang-models/tests/yang_model_tests/tests/port.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,22 @@
},
"PORT_WITH_NO_LANES_ON_MULT_ASIC_VS_2": {
"desc": "PORT_WITH_NO_LANES_ON_MULT_ASIC_VS_2 no failure."
},
"PORT_VALID_DAMPING_AIED_TEST": {
"desc": "PORT_VALID_DAMPING_AIED_TEST no failure."
},
"PORT_VALID_DAMPING_AIED_MONITOR_TEST": {
"desc": "PORT_VALID_DAMPING_AIED_MONITOR_TEST no failure."
},
"PORT_INVALID_DAMPING_ALGORITHM_TEST": {
"desc": "PORT_INVALID_DAMPING_ALGORITHM_TEST invalid algorithm pattern failure.",
"eStrKey" : "Pattern",
"eStr": ["disabled|aied|aied-monitor"]
},
"PORT_INVALID_DAMPING_HALFLIFE_GT_MAXSUPPRESS_TEST": {
"desc": "PORT_INVALID_DAMPING_HALFLIFE_GT_MAXSUPPRESS_TEST must condition failure.",
"eStrKey" : "None",
"eStr": ["decay_half_life must be less than or equal to max_suppress_time"]
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,86 @@
"alias": "etp1a",
"speed": 100000,
"role": "Int"


}
]
}
}
},

"PORT_VALID_DAMPING_AIED_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"link_event_damping_algorithm": "aied",
"max_suppress_time": 20,
"decay_half_life": 5,
"suppress_threshold": 2000,
"reuse_threshold": 1000,
"flap_penalty": 1000
}
]
}
}
},

"PORT_VALID_DAMPING_AIED_MONITOR_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"link_event_damping_algorithm": "aied-monitor",
"max_suppress_time": 20,
"decay_half_life": 5,
"suppress_threshold": 2000,
"reuse_threshold": 1000,
"flap_penalty": 1000
}
]
}
}
},

"PORT_INVALID_DAMPING_ALGORITHM_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"link_event_damping_algorithm": "invalid_value"
}
]
}
}
},

"PORT_INVALID_DAMPING_HALFLIFE_GT_MAXSUPPRESS_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"name": "Ethernet8",
"alias": "eth8",
"lanes": "65",
"speed": 25000,
"link_event_damping_algorithm": "aied",
"max_suppress_time": 10,
"decay_half_life": 15,
"suppress_threshold": 2000,
"reuse_threshold": 1000,
"flap_penalty": 1000
}
]
}
Expand Down
73 changes: 73 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,79 @@ module sonic-port{
description "Enable or disable fast link-up on the port";
}

leaf link_event_damping_algorithm {
description "Link event damping algorithm.
'disabled' - no damping applied to this interface.
'aied' - Additive Increase Exponential Decrease algorithm
based on RFC 2439. Actively suppresses link events
when penalty exceeds suppress threshold.
'aied-monitor' - Same AIED algorithm but monitor-only mode.
Calculates penalties and emits syslog messages but
does NOT suppress link events. Use to safely tune
parameters in production before enabling full
dampening. Recommended by RFC 7196.";
type string {
pattern "disabled|aied|aied-monitor";
}
default "disabled";
}

leaf max_suppress_time {
description "Maximum time in seconds that an interface can remain
in damped (suppressed) state since the last link-down
event, regardless of accumulated penalty.
A value of 0 means this parameter is not configured.
Industry default: 20 seconds.";
type uint32;
default 0;
}

leaf decay_half_life {
description "Time in seconds after which the accumulated penalty
is halved if the interface remains stable (no flaps).
Must be less than or equal to max_suppress_time.
A value of 0 means this parameter is not configured.
Industry default: 5 seconds.";
must "current() = 0 or ../max_suppress_time = 0 or current() <= ../max_suppress_time" {
error-message "decay_half_life must be less than or equal to max_suppress_time";
}
type uint32;
default 0;
}

leaf suppress_threshold {
description "Penalty threshold above which damping is activated
on the interface. Link events are suppressed when the
accumulated penalty exceeds this value.
A value of 0 means this parameter is not configured.
Industry default: 2000.";
type uint32;
default 0;
}

leaf reuse_threshold {
description "Penalty threshold at or below which damping is
deactivated. The interface returns to normal operation
when penalty decays to this value.
Must be less than or equal to suppress_threshold.
A value of 0 means this parameter is not configured.
Industry default: 1000.";
must "current() = 0 or ../suppress_threshold = 0 or current() <= ../suppress_threshold" {
error-message "reuse_threshold must be less than or equal to suppress_threshold";
}
type uint32;
default 0;
}

leaf flap_penalty {
description "Penalty value added to accumulated penalty for each
link-down (UP to DOWN) transition event.
A value of 0 means this parameter is not configured.
Industry standard: 1000.";
type uint32;
default 0;
}


} /* end of list PORT_LIST */

Expand Down
Loading