Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from Azure:master #1933

Merged
merged 1 commit into from
Dec 16, 2021
Merged
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
1 change: 1 addition & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def run(self):
'./yang-models/sonic-exp-fc-map.yang',
'./yang-models/sonic-dscp-tc-map.yang',
'./yang-models/sonic-dot1p-tc-map.yang',
'./yang-models/sonic-storm-control.yang',
'./yang-models/sonic-tc-priority-group-map.yang',
'./yang-models/sonic-tc-queue-map.yang',
'./yang-models/sonic-pfc-priority-queue-map.yang',
Expand Down
13 changes: 11 additions & 2 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,13 +973,22 @@
"polling_interval": "0"
}
},

"WARM_RESTART": {
"bgp": {
"bgp_timer": "500"
}
},

"PORT_STORM_CONTROL": {
"Ethernet0|broadcast": {
"kbps": "10000"
},
"Ethernet0|unknown-multicast": {
"kbps": "30000"
},
"Ethernet0|unknown-unicast": {
"kbps": "20000"
}
},
"PFC_WD": {
"Ethernet9": {
"action": "drop",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"STORM_BROADCAST_TEST": {
"desc": "Broadcast storm-control"
},
"STORM_UUCAST_TEST": {
"desc": "unknown-unicast storm-control"
},
"STORM_UMCAST_TEST": {
"desc": "unknown-multicast storm-control"
},
"STORM_INVALID_STORM_TYPE_TEST": {
"desc": "storm-control invalid storm-type",
"eStrKey" : "InvalidValue",
"eStr": ["storm_type"]
},
"STORM_BROADCAST_INVALID_KBPS": {
"desc": "Broadcast storm-control invalid kbps",
"eStrKey" : "InvalidValue",
"eStr": ["kbps"]
},
"STORM_BROADCAST_INVALID_INTERFACE": {
"desc": "Broadcast storm-control invalid interface",
"eStrKey" : "LeafRef",
"eStr": ["Eth"]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{
"STORM_BROADCAST_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-storm-control:sonic-storm-control": {
"sonic-storm-control:PORT_STORM_CONTROL": {
"sonic-storm-control:PORT_STORM_CONTROL_LIST": [
{
"ifname": "Ethernet0",
"storm_type": "broadcast",
"kbps": "100000"
}
]
}
}
},
"STORM_UUCAST_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-storm-control:sonic-storm-control": {
"sonic-storm-control:PORT_STORM_CONTROL": {
"sonic-storm-control:PORT_STORM_CONTROL_LIST": [
{
"ifname": "Ethernet0",
"storm_type": "unknown-unicast",
"kbps": "200000"
}
]
}
}
},
"STORM_UMCAST_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-storm-control:sonic-storm-control": {
"sonic-storm-control:PORT_STORM_CONTROL": {
"sonic-storm-control:PORT_STORM_CONTROL_LIST": [
{
"ifname": "Ethernet0",
"storm_type": "unknown-multicast",
"kbps": "300000"
}
]
}
}
},
"STORM_INVALID_STORM_TYPE_TEST": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-storm-control:sonic-storm-control": {
"sonic-storm-control:PORT_STORM_CONTROL": {
"sonic-storm-control:PORT_STORM_CONTROL_LIST": [
{
"ifname": "Ethernet0",
"storm_type": "xyz",
"kbps": "400000"
}
]
}
}
},
"STORM_BROADCAST_INVALID_KBPS": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-storm-control:sonic-storm-control": {
"sonic-storm-control:PORT_STORM_CONTROL": {
"sonic-storm-control:PORT_STORM_CONTROL_LIST": [
{
"ifname": "Ethernet0",
"storm_type": "broadcast",
"kbps": "xyz-kbps-value"
}
]
}
}
},
"STORM_BROADCAST_INVALID_INTERFACE": {
"sonic-port:sonic-port": {
"sonic-port:PORT": {
"PORT_LIST": [
{
"admin_status": "up",
"alias": "eth0",
"description": "Ethernet0",
"lanes": "65",
"mtu": 9000,
"name": "Ethernet0",
"speed": 25000
}
]
}
},
"sonic-storm-control:sonic-storm-control": {
"sonic-storm-control:PORT_STORM_CONTROL": {
"sonic-storm-control:PORT_STORM_CONTROL_LIST": [
{
"ifname": "Eth",
"storm_type": "broadcast",
"kbps": "500000"
}
]
}
}
}
}
56 changes: 56 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-storm-control.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module sonic-storm-control {
namespace "http://github.com/Azure/sonic-storm-control";
yang-version "1";

prefix ssc;

import sonic-port {
prefix prt;
}

organization
"SONiC";

contact
"SONiC";

description
"This module defines configuration and operational state
data for broadcast, unknown-unicast and unknown-multicast (BUM) storm-control.
storm-control can be enabled on ethernet interfaces.
Rate is defined in bits-per-second. All three types of storm-control can be
enabled on an interface.";

revision 2021-12-13 {
description
"Initial revision";
}

container sonic-storm-control {
container PORT_STORM_CONTROL {
list PORT_STORM_CONTROL_LIST {
key "ifname storm_type";
/*scommon:key-pattern "PORT_STORM_CONTROL|{ifname}|{storm_type}";*/
leaf ifname {
type leafref {
path "/prt:sonic-port/prt:PORT/prt:PORT_LIST/prt:name";
}
}
leaf storm_type {
type enumeration{
enum broadcast;
enum unknown-unicast;
enum unknown-multicast;
}
}
leaf kbps {
type uint64 {
range "0..100000000" {
error-message "kbps value out of range";
}
}
}
}
}
}
}