Skip to content

Commit

Permalink
[yang] Support ASIC/SDK health event (sonic-net#17879)
Browse files Browse the repository at this point in the history
Support ASIC/SDK health event

- Suppress ASIC/SDK health event configuration
- New event

Signed-off-by: Stephen Sun <[email protected]>
  • Loading branch information
stephenxs authored May 7, 2024
1 parent 4f5cb87 commit bbf4b86
Show file tree
Hide file tree
Showing 9 changed files with 298 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Table of Contents

* [ACL and Mirroring](#acl-and-mirroring)
* [BGP BBR](#bgp-bbr)
* [ASIC SDK health event](#asic-sdk-health-event)
* [BGP Device Global](#bgp-device-global)
* [BGP Sessions](#bgp-sessions)
* [BUFFER_PG](#buffer_pg)
Expand Down Expand Up @@ -383,6 +384,27 @@ The **BGP_BBR** table contains device-level BBR state.
}
}
```
### ASIC SDK health event

ASIC/SDK health event related configuration is defined in **SUPPRESS_ASIC_SDK_HEALTH_EVENT** table.

```
"SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
"notice": {
"categories": [
"asic_hw"
],
"max_events": "1000"
},
"warning": {
"categories": [
"software",
"cpu_hw"
]
}
}
```

### BGP Device Global

The **BGP_DEVICE_GLOBAL** table contains device-level BGP global state.
Expand Down
1 change: 1 addition & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def run(self):
'./yang-models/sonic-routing-policy-sets.yang',
'./yang-models/sonic-sflow.yang',
'./yang-models/sonic-snmp.yang',
'./yang-models/sonic-suppress-asic-sdk-health-event.yang',
'./yang-models/sonic-syslog.yang',
'./yang-models/sonic-system-aaa.yang',
'./yang-models/sonic-system-tacacs.yang',
Expand Down
6 changes: 6 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,12 @@
}

},
"SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
"notice": {
"categories": ["firmware", "asic_hw"],
"max_events": "1024"
}
},
"SYSTEM_DEFAULTS": {
"tunnel_qos_remap": {
"status": "enabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,19 @@
},
"SONIC_EVENTS_SWSS_SELECT_OPERATION_FAILURE_VALID": {
"desc": "VALID SELECT_OPERATION_FAILURE EVENT."
},
"SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_VALID": {
"desc": "VALID ASIC_SDK_HEALTH EVENT."
},
"SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_VALID_MASIC": {
"desc": "VALID ASIC_SDK_HEALTH EVENT."
},
"SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_INVALID_SEVERITY": {
"desc": "ASIC_SDK_HEALTH_INVALID_SEVERITY failure.",
"eStrKey": "InvalidValue"
},
"SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_INVALID_CATEGORY": {
"desc": "ASIC_SDK_HEALTH_INVALID_CATEGORY failure.",
"eStrKey": "InvalidValue"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_FATAL": {
"desc": "Load suppress ASIC/SDK health event list for fatal."
},
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_WARNING": {
"desc": "Load suppress ASIC/SDK health event list for warning."
},
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_NOTICE": {
"desc": "Load suppress ASIC/SDK health event list for notice."
},
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_SEVERITY": {
"desc": "Load suppress ASIC/SDK health event list for notice.",
"eStrKey": "InvalidValue"
},
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_NEGATIVE_MAX_EVENTS": {
"desc": "Load suppress ASIC/SDK health event list missing name.",
"eStrKey": "InvalidValue"
},
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_MAX_EVENTS": {
"desc": "Load suppress ASIC/SDK health event list missing name.",
"eStrKey": "InvalidValue"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,56 @@
}
}
},
"SONIC_EVENTS_SWSS_SELECT_OPERATION_FAILURE_VALID": {
"SONIC_EVENTS_SWSS_SELECT_OPERATION_FAILURE_VALID": {
"sonic-events-swss:sonic-events-swss": {
"sonic-events-swss:select-operation-failure": {
"operation_result": "operation_result",
"command": "command",
"timestamp": "1985-04-12T23:20:50.52Z"
}
}
},
"SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_VALID": {
"sonic-events-swss:sonic-events-swss": {
"sonic-events-swss:asic-sdk-health-event": {
"severity": "fatal",
"category": "asic_hw",
"description": "\ndescription\n",
"timestamp": "1985-04-12T23:20:50.52Z",
"sai_timestamp": "1985-04-12 23:20:50"
}
}
},
"SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_VALID_MASIC": {
"sonic-events-swss:sonic-events-swss": {
"sonic-events-swss:asic-sdk-health-event": {
"severity": "fatal",
"category": "asic_hw",
"asic_name": "asic0",
"description": "\ndescription\n",
"timestamp": "1985-04-12T23:20:50.52Z",
"sai_timestamp": "1985-04-12 23:20:50"
}
}
},
"SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_INVALID_SEVERITY": {
"sonic-events-swss:sonic-events-swss": {
"sonic-events-swss:asic-sdk-health-event": {
"severity": "unknown",
"category": "asic_hw",
"description": "\ndescription\n",
"timestamp": "1985-04-12T23:20:50.52Z"
}
}
},
"SONIC_EVENTS_SWSS_ASIC_SDK_HEALTH_INVALID_CATEGORY": {
"sonic-events-swss:sonic-events-swss": {
"sonic-events-swss:asic-sdk-health-event": {
"severity": "fatal",
"category": "unknown",
"description": "\ndescription\n",
"timestamp": "1985-04-12T23:20:50.52Z"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_FATAL": {
"sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": {
"sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
{
"severity": "fatal",
"categories": ["software","firmware"]
}
]
}
}
},

"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_WARNING": {
"sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": {
"sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
{
"severity": "warning",
"categories": ["asic_hw","cpu_hw"]
}
]
}
}
},

"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_VALID_NOTICE": {
"sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": {
"sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
{
"severity": "notice",
"categories": ["software","firmware","cpu_hw","asic_hw"],
"max_events": "100"
}
]
}
}
},

"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_SEVERITY": {
"sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": {
"sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
{
"severity": "unknown",
"categories": ["software","firmware","cpu_hw","asic_hw"]
}
]
}
}
},

"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_CATEGORY": {
"sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": {
"sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
{
"severity": "notice",
"categories": ["software","unknown","cpu_hw","asic_hw"]
}
]
}
}
},

"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_NEGATIVE_MAX_EVENTS": {
"sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": {
"sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
{
"severity": "notice",
"max_events": "-1"
}
]
}
}
},

"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST_INVALID_MAX_EVENTS": {
"sonic-suppress-asic-sdk-health-event:sonic-suppress-asic-sdk-health-event": {
"sonic-suppress-asic-sdk-health-event:SUPPRESS_ASIC_SDK_HEALTH_EVENT": {
"SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST": [
{
"severity": "notice",
"max_events": "NaN"
}
]
}
}
}
}
36 changes: 36 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-events-swss.yang
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,41 @@ module sonic-events-swss {

uses evtcmn:sonic-events-cmn;
}

container asic-sdk-health-event {
evtcmn:ALARM_SEVERITY_MAJOR;
description
"Declares an event for ASIC/SDK health event.";
leaf asic_name {
type string {
pattern 'asic[0-9]{1,2}';
}
}
leaf severity {
type enumeration {
enum fatal;
enum warning;
enum notice;
}
}
leaf category {
type enumeration {
enum software;
enum firmware;
enum cpu_hw;
enum asic_hw;
}
}
leaf description {
type string;
}
leaf sai_timestamp {
type string {
pattern '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}';
}
}

uses evtcmn:sonic-events-cmn;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module sonic-suppress-asic-sdk-health-event {

yang-version 1.1;

namespace "http://github.com/sonic-net/sonic-suppress-asic-sdk-health-event";

prefix sch;

organization
"SONiC";

contact
"SONiC";

description
"Suppress ASIC/SDK health event yang Module for SONiC OS";

revision 2023-11-29 {
description
"Initial revision";
}

container sonic-suppress-asic-sdk-health-event {

container SUPPRESS_ASIC_SDK_HEALTH_EVENT {

description "SUPPRESS_ASIC_SDK_HEALTH_EVENT part of config_db.json";

list SUPPRESS_ASIC_SDK_HEALTH_EVENT_LIST {

key "severity";

leaf severity {
type enumeration {
enum fatal;
enum warning;
enum notice;
}
description "Severity of the ASIC/SDK health event to suppress";
}

leaf max_events {
type uint32;
description "Maximum of events that can be stored in the database";
}

leaf-list categories {
type enumeration {
enum software;
enum firmware;
enum cpu_hw;
enum asic_hw;
}
description "Category of the ASIC/SDK health event to suppress";
}
}
}
}
}

0 comments on commit bbf4b86

Please sign in to comment.