diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json b/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json index 2997410384d..68ec71ba3f5 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/qosmaps.json @@ -111,6 +111,14 @@ "eStrKey": "Pattern" }, + "PORT_QOS_MAP_APPLY_EMPTY_PFC": { + "desc": "Configure port pfc enable with empty string to disable PFC on all queues." + }, + + "PORT_QOS_MAP_APPLY_EMPTY_PFCWD": { + "desc": "Configure port pfcwd_sw_enable with empty string to disable watchdog on all queues." + }, + "TC_TO_DSCP_MAP_CRETAE": { "desc": "Configure a Traffic class to DSCP map." }, diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json index ee0ba3fe472..3d45fe02b79 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/qosmaps.json @@ -881,6 +881,64 @@ } }, + "PORT_QOS_MAP_APPLY_EMPTY_PFC": { + "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-port-qos-map:sonic-port-qos-map": { + "sonic-port-qos-map:PORT_QOS_MAP": { + "PORT_QOS_MAP_LIST": [ + { + "ifname": "Ethernet4", + "pfc_enable": "" + } + ] + } + } + }, + + "PORT_QOS_MAP_APPLY_EMPTY_PFCWD": { + "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-port-qos-map:sonic-port-qos-map": { + "sonic-port-qos-map:PORT_QOS_MAP": { + "PORT_QOS_MAP_LIST": [ + { + "ifname": "Ethernet4", + "pfcwd_sw_enable": "" + } + ] + } + } + }, + "TC_TO_DSCP_MAP_CRETAE": { "sonic-tc-dscp-map:sonic-tc-dscp-map": { "sonic-tc-dscp-map:TC_TO_DSCP_MAP": { diff --git a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang index f1b725ca889..4040ae1fbac 100644 --- a/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang +++ b/src/sonic-yang-models/yang-models/sonic-port-qos-map.yang @@ -91,16 +91,18 @@ module sonic-port-qos-map { leaf pfc_enable { type string { - pattern "[0-7](,[0-7])*"; + pattern "([0-7](,[0-7])*)?"; } + description + "Specify the queue(s) on which PFC is enabled. Empty string is allowed to disable PFC on all queues."; } leaf pfcwd_sw_enable { type string { - pattern "[0-7](,[0-7])*"; + pattern "([0-7](,[0-7])*)?"; } description - "Specify the queue(s) on which software pfc watchdog are enabled."; + "Specify the queue(s) on which software pfc watchdog are enabled. Empty string is allowed to disable watchdog on all queues."; } leaf pfc_to_queue_map {