diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 8e9d43c529b..edab599baf7 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1612,7 +1612,8 @@ "Ethernet9": { "action": "drop", "detection_time": "100", - "restoration_time": "400" + "restoration_time": "400", + "pfc_stat_history": "enable" } }, "PFC_WD": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/pfc.json b/src/sonic-yang-models/tests/yang_model_tests/tests/pfc.json index 0f8b4d0289c..106f803f5fe 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/pfc.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/pfc.json @@ -46,5 +46,12 @@ "PFC_WDOG_WITH_INVALID_RESTORATION_TIME": { "desc": "PFC_WDOG_WITH_INVALID_RESTORATION_TIME", "eStr": ["restoration_time must be greater than or equal to POLL_INTERVAL"] + }, + "PFC_WDOG_WITH_VALID_PFC_STAT_HISTORY": { + "desc": "PFC_WDOG_WITH_VALID_PFC_STAT_HISTORY" + }, + "PFC_WDOG_WITH_INVALID_PFC_STAT_HISTORY": { + "desc": "PFC_WDOG_WITH_INVALID_PFC_STAT_HISTORY", + "eStr": ["pfc_stat_history must be either enable or disable"] } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/pfc.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/pfc.json index f493701384e..aaed8066132 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/pfc.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/pfc.json @@ -329,5 +329,51 @@ ] } } + }, + "PFC_WDOG_WITH_VALID_PFC_STAT_HISTORY": { + "sonic-port:sonic-port": { + "sonic-port:PORT": { + "PORT_LIST": [ + { + "admin_status": "up", + "alias": "eth0", + "description": "Ethernet4", + "lanes": "65", + "mtu": "9000", + "name": "Ethernet4", + "tpid": "0x8100", + "speed": "25000" + } + ] + } + }, + "sonic-pfcwd:sonic-pfcwd": { + "sonic-pfcwd:PFC_WD": { + "PFC_WD_LIST": [ + { + "ifname": "Ethernet4", + "action": "drop", + "detection_time": 400, + "restoration_time": 800, + "pfc_stat_history": "enable" + } + ] + } + } + }, + "PFC_WDOG_WITH_INVALID_PFC_STAT_HISTORY": { + "sonic-pfcwd:sonic-pfcwd": { + "sonic-pfcwd:PFC_WD": { + "PFC_WD_LIST": [ + { + "ifname": "Ethernet4", + "action": "drop", + "detection_time": 400, + "restoration_time": 800, + "pfc_stat_history": "down" + } + ] + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-pfcwd.yang b/src/sonic-yang-models/yang-models/sonic-pfcwd.yang index 27c2a49f2ed..ae07cf9a0f9 100644 --- a/src/sonic-yang-models/yang-models/sonic-pfcwd.yang +++ b/src/sonic-yang-models/yang-models/sonic-pfcwd.yang @@ -71,6 +71,17 @@ module sonic-pfcwd { description "Time delay before resuming normal PFC operation in msec."; } + leaf pfc_stat_history { + must "../ifname != 'GLOBAL'"; + type string { + pattern "enable|disable" { + error-message "pfc_stat_history must be either enable or disable"; + error-app-tag pfc-stat-history-invalid-status; + } + } + description + "Toggle for PFC Historical Statistics estimation."; + } leaf POLL_INTERVAL { must "../ifname = 'GLOBAL'"; type uint32 {