From 6084f23479474b0e1ca012ae8aae53761c5f199f Mon Sep 17 00:00:00 2001 From: rpmarvell Date: Wed, 19 Apr 2023 05:49:11 -0700 Subject: [PATCH] sonic-utilities: WRED stats feature changes on sonic-utilities * New script for wredstat CLI commands * portstat script updated to accomodate WRED port stats * counterpoll script updated to support wredport and wredqueue counters * CLi to script mapping changes * UT for the new script changes Signed-off-by: rpmarvell --- clear/main.py | 6 + counterpoll/main.py | 72 ++ doc/Command-Reference.md | 78 ++ scripts/portstat | 65 +- scripts/wredstat | 414 ++++++++ setup.py | 3 +- show/main.py | 30 + tests/counterpoll_input/config_db.json | 6 + tests/counterpoll_test.py | 62 ++ tests/mock_tables/config_db.json | 8 + tests/mock_tables/counters_db.json | 345 ++++++- tests/mock_tables/state_db.json | 24 + tests/portstat_test.py | 6 + tests/wred_queue_counter_test.py | 1268 ++++++++++++++++++++++++ 14 files changed, 2382 insertions(+), 5 deletions(-) create mode 100755 scripts/wredstat create mode 100644 tests/wred_queue_counter_test.py diff --git a/clear/main.py b/clear/main.py index 19c1b6073a4..3d0c078effa 100755 --- a/clear/main.py +++ b/clear/main.py @@ -288,6 +288,12 @@ def clear_wm_q_all(): command = ['watermarkstat', '-c', '-t', 'q_shared_all'] run_command(command) +@queue.group(name='wredcounters') +def wredcounters(): + """Clear queue wredcounters""" + command = "wredstat -c" + run_command(command) + @queue.group(name='persistent-watermark') def persistent_watermark(): """Clear queue persistent WM. One does not simply clear WM, root is required""" diff --git a/counterpoll/main.py b/counterpoll/main.py index ad15c8c2485..cbceaeccc37 100644 --- a/counterpoll/main.py +++ b/counterpoll/main.py @@ -382,6 +382,72 @@ def disable(ctx): fc_info['FLEX_COUNTER_STATUS'] = 'disable' ctx.obj.mod_entry("FLEX_COUNTER_TABLE", "FLOW_CNT_ROUTE", fc_info) +# WRED queue counter commands +@cli.group() +@click.pass_context +def wredqueue(ctx): + """ WRED queue counter commands """ + ctx.obj = ConfigDBConnector() + ctx.obj.connect() + +@wredqueue.command() +@click.argument('poll_interval', type=click.IntRange(100, 30000)) +@click.pass_context +def interval(ctx, poll_interval): + """ Set wred queue counter query interval """ + wred_queue_info = {} + wred_queue_info['POLL_INTERVAL'] = poll_interval + ctx.obj.mod_entry("FLEX_COUNTER_TABLE", "WRED_ECN_QUEUE", wred_queue_info) + +@wredqueue.command() +@click.pass_context +def enable(ctx): + """ Enable wred queue counter query """ + wred_queue_info = {} + wred_queue_info['FLEX_COUNTER_STATUS'] = 'enable' + ctx.obj.mod_entry("FLEX_COUNTER_TABLE", "WRED_ECN_QUEUE", wred_queue_info) + +@wredqueue.command() +@click.pass_context +def disable(ctx): + """ Disable wred queue counter query """ + wred_queue_info = {} + wred_queue_info['FLEX_COUNTER_STATUS'] = 'disable' + ctx.obj.mod_entry("FLEX_COUNTER_TABLE", "WRED_ECN_QUEUE", wred_queue_info) + +# WRED port counter commands +@cli.group() +@click.pass_context +def wredport(ctx): + """ WRED port counter commands """ + ctx.obj = ConfigDBConnector() + ctx.obj.connect() + +@wredport.command() +@click.argument('poll_interval', type=click.IntRange(100, 30000)) +@click.pass_context +def interval(ctx, poll_interval): + """ Set wred port counter query interval """ + wred_port_info = {} + wred_port_info['POLL_INTERVAL'] = poll_interval + ctx.obj.mod_entry("FLEX_COUNTER_TABLE", "WRED_ECN_PORT", wred_port_info) + +@wredport.command() +@click.pass_context +def enable(ctx): + """ Enable wred port counter query """ + wred_port_info = {} + wred_port_info['FLEX_COUNTER_STATUS'] = 'enable' + ctx.obj.mod_entry("FLEX_COUNTER_TABLE", "WRED_ECN_PORT", wred_port_info) + +@wredport.command() +@click.pass_context +def disable(ctx): + """ Disable wred port counter query """ + wred_port_info = {} + wred_port_info['FLEX_COUNTER_STATUS'] = 'disable' + ctx.obj.mod_entry("FLEX_COUNTER_TABLE", "WRED_ECN_PORT", wred_port_info) + @cli.command() def show(): """ Show the counter configuration """ @@ -399,6 +465,8 @@ def show(): tunnel_info = configdb.get_entry('FLEX_COUNTER_TABLE', 'TUNNEL') trap_info = configdb.get_entry('FLEX_COUNTER_TABLE', 'FLOW_CNT_TRAP') route_info = configdb.get_entry('FLEX_COUNTER_TABLE', 'FLOW_CNT_ROUTE') + wred_queue_info = configdb.get_entry('FLEX_COUNTER_TABLE', 'WRED_ECN_QUEUE') + wred_port_info = configdb.get_entry('FLEX_COUNTER_TABLE', 'WRED_ECN_PORT') header = ("Type", "Interval (in ms)", "Status") data = [] @@ -427,6 +495,10 @@ def show(): if route_info: data.append(["FLOW_CNT_ROUTE_STAT", route_info.get("POLL_INTERVAL", DEFLT_10_SEC), route_info.get("FLEX_COUNTER_STATUS", DISABLE)]) + if wred_queue_info: + data.append(["WRED_ECN_QUEUE_STAT", wred_queue_info.get("POLL_INTERVAL", DEFLT_10_SEC), wred_queue_info.get("FLEX_COUNTER_STATUS", DISABLE)]) + if wred_port_info: + data.append(["WRED_ECN_PORT_STAT", wred_port_info.get("POLL_INTERVAL", DEFLT_1_SEC), wred_port_info.get("FLEX_COUNTER_STATUS", DISABLE)]) click.echo(tabulate(data, headers=header, tablefmt="simple", missingval="")) diff --git a/doc/Command-Reference.md b/doc/Command-Reference.md index 86902cd7e76..af0983edb05 100644 --- a/doc/Command-Reference.md +++ b/doc/Command-Reference.md @@ -7984,6 +7984,7 @@ This sub-section explains the following queue parameters that can be displayed u 2) queue watermark 3) priority-group watermark 4) queue persistent-watermark +5) queue wredcounters **show queue counters** @@ -8177,6 +8178,83 @@ This command displays the user persistet-watermark for the queues (Egress shared admin@sonic:~$ sonic-clear priority-group drop counters ``` +**show queue wredcounters** + +This command displays wred-drop packet/byte and ecn-marked packet/byte counters for all queues of all ports or one specific-port given as arguement. +This command can be used to clear the counters for all queues of all ports. Note that port specific clear is not supported. + +- Usage: + ``` + show queue wredcounters [] + ``` + +- Example: + ``` + admin@sonic:~$ show queue wredcounters + Port TxQ WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes + --------- ----- -------------- --------------- --------------- ---------------- + + Ethernet0 UC0 0 0 0 0 + Ethernet0 UC1 0 0 0 0 + Ethernet0 UC2 0 0 0 0 + Ethernet0 UC3 0 0 0 0 + Ethernet0 UC4 0 0 0 0 + Ethernet0 UC5 0 0 0 0 + Ethernet0 UC6 0 0 0 0 + Ethernet0 UC7 0 0 0 0 + Ethernet0 UC8 0 0 0 0 + Ethernet0 UC9 0 0 0 0 + Ethernet0 MC0 0 0 0 0 + Ethernet0 MC1 0 0 0 0 + Ethernet0 MC2 0 0 0 0 + Ethernet0 MC3 0 0 0 0 + Ethernet0 MC4 0 0 0 0 + Ethernet0 MC5 0 0 0 0 + Ethernet0 MC6 0 0 0 0 + Ethernet0 MC7 0 0 0 0 + Ethernet0 MC8 0 0 0 0 + Ethernet0 MC9 0 0 0 0 + + Port TxQ WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes + --------- ----- -------------- --------------- --------------- ---------------- + + Ethernet4 UC0 0 0 0 0 + Ethernet4 UC1 0 0 0 0 + Ethernet4 UC2 0 0 0 0 + Ethernet4 UC3 0 0 0 0 + Ethernet4 UC4 0 0 0 0 + Ethernet4 UC5 0 0 0 0 + Ethernet4 UC6 0 0 0 0 + Ethernet4 UC7 0 0 0 0 + Ethernet4 UC8 0 0 0 0 + Ethernet4 UC9 0 0 0 0 + Ethernet4 MC0 0 0 0 0 + Ethernet4 MC1 0 0 0 0 + Ethernet4 MC2 0 0 0 0 + Ethernet4 MC3 0 0 0 0 + Ethernet4 MC4 0 0 0 0 + Ethernet4 MC5 0 0 0 0 + Ethernet4 MC6 0 0 0 0 + Ethernet4 MC7 0 0 0 0 + Ethernet4 MC8 0 0 0 0 + Ethernet4 MC9 0 0 0 0 + + ... + ``` + +Optionally, you can specify an interface name in order to display only that particular interface + +- Example: + ``` + admin@sonic:~$ show queue wredcounters Ethernet72 + ``` + +- NOTE: Queue counters can be cleared by the user with the following command: + ``` + admin@sonic:~$ sonic-clear queue wredcounters + ``` + + #### Buffer Pool This sub-section explains the following buffer pool parameters that can be displayed using "show buffer_pool" command. diff --git a/scripts/portstat b/scripts/portstat index 399733f69c4..3bf3c238797 100755 --- a/scripts/portstat +++ b/scripts/portstat @@ -53,7 +53,8 @@ NStats = namedtuple("NStats", "rx_ok, rx_err, rx_drop, rx_ovr, tx_ok,\ tx_64, tx_65_127, tx_128_255, tx_256_511, tx_512_1023, tx_1024_1518, tx_1519_2047, tx_2048_4095, tx_4096_9216, tx_9217_16383,\ tx_uca, tx_mca, tx_bca, tx_all,\ rx_jbr, rx_frag, rx_usize, rx_ovrrun,\ - fec_corr, fec_uncorr, fec_symbol_err") + fec_corr, fec_uncorr, fec_symbol_err,\ + wred_grn_drp_pkt, wred_ylw_drp_pkt, wred_red_drp_pkt, wred_tot_drp_pkt") header_all = ['IFACE', 'STATE', 'RX_OK', 'RX_BPS', 'RX_PPS', 'RX_UTIL', 'RX_ERR', 'RX_DRP', 'RX_OVR', 'TX_OK', 'TX_BPS', 'TX_PPS', 'TX_UTIL', 'TX_ERR', 'TX_DRP', 'TX_OVR'] header_std = ['IFACE', 'STATE', 'RX_OK', 'RX_BPS', 'RX_UTIL', 'RX_ERR', 'RX_DRP', 'RX_OVR', @@ -70,7 +71,14 @@ RateStats = namedtuple("RateStats", ratestat_fields) The order and count of statistics mentioned below needs to be in sync with the values in portstat script So, any fields added/deleted in here should be reflected in portstat script also """ -BUCKET_NUM = 45 +BUCKET_NUM = 49 + +wred_green_pkt_stat_capable = False +wred_yellow_pkt_stat_capable = False +wred_red_pkt_stat_capable = False +wred_total_pkt_stat_capable = False +is_wred_stats_reqd = True + counter_bucket_dict = { 0:['SAI_PORT_STAT_IF_IN_UCAST_PKTS', 'SAI_PORT_STAT_IF_IN_NON_UCAST_PKTS'], 1:['SAI_PORT_STAT_IF_IN_ERRORS'], @@ -116,7 +124,11 @@ counter_bucket_dict = { 41:['SAI_PORT_STAT_IP_IN_RECEIVES'], 42:['SAI_PORT_STAT_IF_IN_FEC_CORRECTABLE_FRAMES'], 43:['SAI_PORT_STAT_IF_IN_FEC_NOT_CORRECTABLE_FRAMES'], - 44:['SAI_PORT_STAT_IF_IN_FEC_SYMBOL_ERRORS'] + 44:['SAI_PORT_STAT_IF_IN_FEC_SYMBOL_ERRORS'], + 45:['SAI_PORT_STAT_GREEN_WRED_DROPPED_PACKETS'], + 46:['SAI_PORT_STAT_YELLOW_WRED_DROPPED_PACKETS'], + 47:['SAI_PORT_STAT_RED_WRED_DROPPED_PACKETS'], + 48:['SAI_PORT_STAT_WRED_DROPPED_PACKETS'] } STATUS_NA = 'N/A' @@ -157,6 +169,32 @@ class Portstat(object): Collect the statisitics from all the asics present on the device and store in a dict """ + global BUCKET_NUM + + global wred_green_pkt_stat_capable + global wred_yellow_pkt_stat_capable + global wred_red_pkt_stat_capable + global wred_total_pkt_stat_capable + global is_wred_stats_reqd + + wred_green_pkt_stat_capable = self.db.get(self.db.STATE_DB, "PORT_COUNTER_CAPABILITIES|WRED_ECN_PORT_WRED_GREEN_DROP_COUNTER","isSupported") + wred_yellow_pkt_stat_capable = self.db.get(self.db.STATE_DB, "PORT_COUNTER_CAPABILITIES|WRED_ECN_PORT_WRED_YELLOW_DROP_COUNTER","isSupported") + wred_red_pkt_stat_capable = self.db.get(self.db.STATE_DB, "PORT_COUNTER_CAPABILITIES|WRED_ECN_PORT_WRED_RED_DROP_COUNTER","isSupported") + wred_total_pkt_stat_capable = self.db.get(self.db.STATE_DB, "PORT_COUNTER_CAPABILITIES|WRED_ECN_PORT_WRED_TOTAL_DROP_COUNTER","isSupported") + + # Remove the unsupported stats from the counter dict + if ((is_wred_stats_reqd == False) or (wred_green_pkt_stat_capable != "true")) and ('SAI_PORT_STAT_GREEN_WRED_DROPPED_PACKETS' in counter_bucket_dict.keys()): + del counter_bucket_dict['SAI_PORT_STAT_GREEN_WRED_DROPPED_PACKETS'] + BUCKET_NUM = (BUCKET_NUM - 1) + if ((is_wred_stats_reqd == False) or (wred_yellow_pkt_stat_capable != "true")) and ('SAI_PORT_STAT_YELLOW_WRED_DROPPED_PACKETS' in counter_bucket_dict.keys()): + del counter_bucket_dict['SAI_PORT_STAT_YELLOW_WRED_DROPPED_PACKETS'] + BUCKET_NUM = (BUCKET_NUM - 1) + if ((is_wred_stats_reqd == False) or (wred_red_pkt_stat_capable != "true")) and ('SAI_PORT_STAT_RED_WRED_DROPPED_PACKETS' in counter_bucket_dict.keys()): + del counter_bucket_dict['SAI_PORT_STAT_RED_WRED_DROPPED_PACKETS'] + BUCKET_NUM = (BUCKET_NUM - 1) + if ((is_wred_stats_reqd == False) or (wred_total_pkt_stat_capable != "true")) and ('SAI_PORT_STAT_WRED_DROPPED_PACKETS' in counter_bucket_dict.keys()): + del counter_bucket_dict['SAI_PORT_STAT_WRED_DROPPED_PACKETS'] + BUCKET_NUM = (BUCKET_NUM - 1) cnstat_dict, ratestat_dict = self.get_cnstat() self.cnstat_dict.update(cnstat_dict) @@ -170,6 +208,8 @@ class Portstat(object): """ Get the counters from specific table. """ + + fields = ["0"]*BUCKET_NUM _, fvs = counter_table.get(PortCounter(), port) @@ -400,9 +440,22 @@ class Portstat(object): print("Multicast Packets Transmitted.................. {}".format(ns_diff(cntr.tx_mca, old_cntr.tx_mca))) print("Broadcast Packets Transmitted.................. {}".format(ns_diff(cntr.tx_bca, old_cntr.tx_bca))) + if wred_green_pkt_stat_capable == "true" or wred_yellow_pkt_stat_capable == "true" or wred_red_pkt_stat_capable == "true" or wred_total_pkt_stat_capable == "true": + print("") + if wred_green_pkt_stat_capable == "true": + print("WRED Green Dropped Packets..................... {}".format(ns_diff(cntr.wred_grn_drp_pkt, old_cntr.wred_grn_drp_pkt))) + if wred_yellow_pkt_stat_capable == "true": + print("WRED Yellow Dropped Packets.................... {}".format(ns_diff(cntr.wred_ylw_drp_pkt, old_cntr.wred_ylw_drp_pkt))) + if wred_red_pkt_stat_capable == "true": + print("WRED Red Dropped Packets....................... {}".format(ns_diff(cntr.wred_red_drp_pkt, old_cntr.wred_red_drp_pkt))) + if wred_total_pkt_stat_capable == "true": + print("WRED Total Dropped Packets..................... {}".format(ns_diff(cntr.wred_tot_drp_pkt, old_cntr.wred_tot_drp_pkt))) + if wred_green_pkt_stat_capable == "true" or wred_yellow_pkt_stat_capable == "true" or wred_red_pkt_stat_capable == "true" or wred_total_pkt_stat_capable == "true": + print("") print("Time Since Counters Last Cleared............... " + str(cnstat_old_dict.get('time'))) + def cnstat_diff_print(self, cnstat_new_dict, cnstat_old_dict, ratestat_dict, intf_list, use_json, print_all, errors_only, fec_stats_only, @@ -632,6 +685,12 @@ Examples: namespace = None display_option = constants.DISPLAY_ALL + global is_wred_stats_reqd + + if errors_only or rates_only or fec_stats_only: + is_wred_stats_reqd = False + + portstat = Portstat(namespace, display_option) cnstat_dict, ratestat_dict = portstat.get_cnstat_dict() diff --git a/scripts/wredstat b/scripts/wredstat new file mode 100755 index 00000000000..567d521f6da --- /dev/null +++ b/scripts/wredstat @@ -0,0 +1,414 @@ +#!/usr/bin/env python3 + +##################################################################### +# +# wredstat is a tool for summarizing wred queue statistics of all ports. +# +##################################################################### + +import json +import argparse +import datetime +import os.path +import sys + +from collections import namedtuple, OrderedDict +from natsort import natsorted +from tabulate import tabulate +from sonic_py_common import multi_asic + +# mock the redis for unit test purposes # +try: + if os.environ["UTILITIES_UNIT_TESTING"] == "2": + modules_path = os.path.join(os.path.dirname(__file__), "..") + tests_path = os.path.join(modules_path, "tests") + sys.path.insert(0, modules_path) + sys.path.insert(0, tests_path) + import mock_tables.dbconnector # lgtm [py/unused-import] + if os.environ["UTILITIES_UNIT_TESTING_TOPOLOGY"] == "multi_asic": + import mock_tables.mock_multi_asic + mock_tables.dbconnector.load_namespace_config() + +except KeyError: + pass + +from swsscommon.swsscommon import SonicV2Connector +from utilities_common.cli import json_serial, UserCache +from utilities_common import constants +import utilities_common.multi_asic as multi_asic_util + +QueueStats = namedtuple("QueueStats", "queueindex, queuetype, wredDrppacket, wredDrpbytes, ecnpacket, ecnbytes") +header = ['Port', 'TxQ', 'WredDrp/pkts', 'WredDrp/bytes', 'EcnMarked/pkts', 'EcnMarked/bytes'] +voq_header = ['Port', 'Voq', 'WredDrp/pkts', 'WredDrp/bytes', 'EcnMarked/pkts', 'EcnMarked/bytes'] + +counter_bucket_dict = { + 'SAI_QUEUE_STAT_WRED_DROPPED_PACKETS': 2, + 'SAI_QUEUE_STAT_WRED_DROPPED_BYTES': 3, + 'SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS': 4, + 'SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES': 5, +} +wred_drop_pkts_capable = False +wred_drop_bytes_capable = False +ecn_marked_pkts_capable = False +ecn_marked_bytes_capable = False + +from utilities_common.cli import json_dump +from utilities_common.netstat import ns_diff, STATUS_NA + +QUEUE_TYPE_MC = 'MC' +QUEUE_TYPE_UC = 'UC' +QUEUE_TYPE_ALL = 'ALL' +QUEUE_TYPE_VOQ = 'VOQ' +SAI_QUEUE_TYPE_MULTICAST = "SAI_QUEUE_TYPE_MULTICAST" +SAI_QUEUE_TYPE_UNICAST = "SAI_QUEUE_TYPE_UNICAST" +SAI_QUEUE_TYPE_UNICAST_VOQ = "SAI_QUEUE_TYPE_UNICAST_VOQ" +SAI_QUEUE_TYPE_ALL = "SAI_QUEUE_TYPE_ALL" + +COUNTER_TABLE_PREFIX = "COUNTERS:" +COUNTERS_PORT_NAME_MAP = "COUNTERS_PORT_NAME_MAP" +COUNTERS_SYSTEM_PORT_NAME_MAP = "COUNTERS_SYSTEM_PORT_NAME_MAP" +COUNTERS_QUEUE_NAME_MAP = "COUNTERS_QUEUE_NAME_MAP" +COUNTERS_VOQ_NAME_MAP= "COUNTERS_VOQ_NAME_MAP" +COUNTERS_QUEUE_TYPE_MAP = "COUNTERS_QUEUE_TYPE_MAP" +COUNTERS_QUEUE_INDEX_MAP = "COUNTERS_QUEUE_INDEX_MAP" +COUNTERS_QUEUE_PORT_MAP = "COUNTERS_QUEUE_PORT_MAP" + +cnstat_dir = 'N/A' +cnstat_fqn_file = 'N/A' + + +def build_json(port, cnstat): + def ports_stats(k): + p = {} + p[k[1]] = { + "wreddroppacket": k[2], + "wreddropbytes": k[3], + "ecnmarkedpacket": k[4], + "ecnmarkedbytes": k[5] + } + return p + + out = {} + for k in cnstat: + out.update(ports_stats(k)) + return out + + +class Wredstat(object): + def __init__(self, namespace, voq=False): + self.db = None + self.multi_asic = multi_asic_util.MultiAsic(constants.DISPLAY_ALL, namespace) + if namespace is not None: + for ns in self.multi_asic.get_ns_list_based_on_options(): + self.db = multi_asic.connect_to_all_dbs_for_ns(ns) + else: + self.db = SonicV2Connector(use_unix_socket_path=False) + self.db.connect(self.db.COUNTERS_DB) + self.voq = voq + + def get_queue_port(table_id): + port_table_id = self.db.get(self.db.COUNTERS_DB, COUNTERS_QUEUE_PORT_MAP, table_id) + if port_table_id is None: + print("Port is not available!", table_id) + sys.exit(1) + + return port_table_id + + # Get all ports + if voq: + self.counter_port_name_map = self.db.get_all(self.db.COUNTERS_DB, COUNTERS_SYSTEM_PORT_NAME_MAP) + else: + self.counter_port_name_map = self.db.get_all(self.db.COUNTERS_DB, COUNTERS_PORT_NAME_MAP) + + if self.counter_port_name_map is None: + print("COUNTERS_PORT_NAME_MAP is empty!") + sys.exit(1) + + self.port_queues_map = {} + self.port_name_map = {} + + for port in self.counter_port_name_map: + self.port_queues_map[port] = {} + self.port_name_map[self.counter_port_name_map[port]] = port + + counter_queue_name_map = None + # Get Queues for each port + if voq: + counter_queue_name_map = self.db.get_all(self.db.COUNTERS_DB, COUNTERS_VOQ_NAME_MAP) + else: + counter_queue_name_map = self.db.get_all(self.db.COUNTERS_DB, COUNTERS_QUEUE_NAME_MAP) + + if counter_queue_name_map is None: + print("COUNTERS_QUEUE_NAME_MAP is empty!") + sys.exit(1) + + for queue in counter_queue_name_map: + port = self.port_name_map[get_queue_port(counter_queue_name_map[queue])] + self.port_queues_map[port][queue] = counter_queue_name_map[queue] + + def get_cnstat(self, queue_map): + """ + Get the counters info from database. + """ + def get_counters(table_id): + """ + Get the counters from specific table. + """ + def get_queue_index(table_id): + queue_index = self.db.get(self.db.COUNTERS_DB, COUNTERS_QUEUE_INDEX_MAP, table_id) + if queue_index is None: + print("Queue index is not available!", table_id) + sys.exit(1) + + return queue_index + + def get_queue_type(table_id): + queue_type = self.db.get(self.db.COUNTERS_DB, COUNTERS_QUEUE_TYPE_MAP, table_id) + if queue_type is None: + print("Queue Type is not available!", table_id) + sys.exit(1) + elif queue_type == SAI_QUEUE_TYPE_MULTICAST: + return QUEUE_TYPE_MC + elif queue_type == SAI_QUEUE_TYPE_UNICAST: + return QUEUE_TYPE_UC + elif queue_type == SAI_QUEUE_TYPE_UNICAST_VOQ: + return QUEUE_TYPE_VOQ + elif queue_type == SAI_QUEUE_TYPE_ALL: + return QUEUE_TYPE_ALL + else: + print("Queue Type is invalid:", table_id, queue_type) + sys.exit(1) + + fields = ["0","0","0","0","0","0"] + fields[0] = get_queue_index(table_id) + fields[1] = get_queue_type(table_id) + self.state_db = SonicV2Connector(use_unix_socket_path=False) + self.state_db.connect(self.state_db.STATE_DB) + wred_drop_pkts_capable = self.state_db.get(self.state_db.STATE_DB, "QUEUE_COUNTER_CAPABILITIES|WRED_ECN_QUEUE_WRED_DROPPED_PKT_COUNTER","isSupported") + wred_drop_bytes_capable = self.state_db.get(self.state_db.STATE_DB, "QUEUE_COUNTER_CAPABILITIES|WRED_ECN_QUEUE_WRED_DROPPED_BYTE_COUNTER","isSupported") + ecn_marked_pkts_capable = self.state_db.get(self.state_db.STATE_DB, "QUEUE_COUNTER_CAPABILITIES|WRED_ECN_QUEUE_ECN_MARKED_PKT_COUNTER","isSupported") + ecn_marked_bytes_capable = self.state_db.get(self.state_db.STATE_DB, "QUEUE_COUNTER_CAPABILITIES|WRED_ECN_QUEUE_ECN_MARKED_BYTE_COUNTER","isSupported") + + # TODO : Capability specific statistics display to be implemented in incremental releases + #if wred_drop_pkts_capable != True and ('SAI_QUEUE_STAT_WRED_DROPPED_PACKETS' in counter_bucket_dict.keys()): + # del counter_bucket_dict['SAI_QUEUE_STAT_WRED_DROPPED_PACKETS'] + #if wred_drop_bytes_capable != True and ('SAI_QUEUE_STAT_WRED_DROPPED_BYTES' in counter_bucket_dict.keys()): + # del counter_bucket_dict['SAI_QUEUE_STAT_WRED_DROPPED_BYTES'] + #if ecn_marked_pkts_capable != True and ('SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS' in counter_bucket_dict.keys()): + # del counter_bucket_dict['SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS'] + #if ecn_marked_bytes_capable != True and ('SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES' in counter_bucket_dict.keys()): + # del counter_bucket_dict['SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES'] + + for counter_name, pos in counter_bucket_dict.items(): + full_table_id = COUNTER_TABLE_PREFIX + table_id + counter_data = self.db.get(self.db.COUNTERS_DB, full_table_id, counter_name) + if counter_data is None: + fields[pos] = STATUS_NA + elif fields[pos] != STATUS_NA: + fields[pos] = str(int(counter_data)) + cntr = QueueStats._make(fields)._asdict() + return cntr + + # Build a dictionary of the stats + cnstat_dict = OrderedDict() + cnstat_dict['time'] = datetime.datetime.now() + if queue_map is None: + return cnstat_dict + for queue in natsorted(queue_map): + cnstat_dict[queue] = get_counters(queue_map[queue]) + return cnstat_dict + + def cnstat_print(self, port, cnstat_dict, json_opt): + """ + Print the cnstat. If JSON option is True, return data in + JSON format. + """ + table = [] + json_output = {port: {}} + + for key, data in cnstat_dict.items(): + if key == 'time': + if json_opt: + json_output[port][key] = data + continue + table.append((port, data['queuetype'] + str(data['queueindex']), + data['wredDrppacket'], data['wredDrpbytes'], + data['ecnpacket'], data['ecnbytes'])) + + if json_opt: + json_output[port].update(build_json(port, table)) + return json_output + else: + hdr = voq_header if self.voq else header + print(tabulate(table, hdr, tablefmt='simple', stralign='right')) + print() + + def cnstat_diff_print(self, port, cnstat_new_dict, cnstat_old_dict, json_opt): + """ + Print the difference between two cnstat results. If JSON + option is True, return data in JSON format. + """ + table = [] + json_output = {port: {}} + + for key, cntr in cnstat_new_dict.items(): + if key == 'time': + if json_opt: + json_output[port][key] = cntr + continue + old_cntr = None + if key in cnstat_old_dict: + old_cntr = cnstat_old_dict.get(key) + + if old_cntr is not None: + table.append((port, cntr['queuetype'] + str(cntr['queueindex']), + ns_diff(cntr['wredDrppacket'], old_cntr['wredDrppacket']), + ns_diff(cntr['wredDrpbytes'], old_cntr['wredDrpbytes']), + ns_diff(cntr['ecnpacket'], old_cntr['ecnpacket']), + ns_diff(cntr['ecnbytes'], old_cntr['ecnbytes']))) + else: + table.append((port, cntr['queuetype'] + str(cntr['queueindex']), + cntr['wredDrppacket'], cntr['wredDrpbytes'], + cntr['ecnpacket'], cntr['ecnbytes'])) + + if json_opt: + json_output[port].update(build_json(port, table)) + return json_output + else: + hdr = voq_header if self.voq else header + print(tabulate(table, hdr, tablefmt='simple', stralign='right')) + print() + + def get_print_all_stat(self, json_opt): + """ + Get stat for each port + If JSON option is True, collect data for each port and + print data in JSON format for all ports + """ + json_output = {} + for port in natsorted(self.counter_port_name_map): + json_output[port] = {} + cnstat_dict = self.get_cnstat(self.port_queues_map[port]) + + cnstat_fqn_file_name = cnstat_fqn_file + port + if os.path.isfile(cnstat_fqn_file_name): + try: + cnstat_cached_dict = json.load(open(cnstat_fqn_file_name, 'r')) + if json_opt: + json_output[port].update({"cached_time":cnstat_cached_dict.get('time')}) + json_output.update(self.cnstat_diff_print(port, cnstat_dict, cnstat_cached_dict, json_opt)) + else: + print(port + " Last cached time was " + str(cnstat_cached_dict.get('time'))) + self.cnstat_diff_print(port, cnstat_dict, cnstat_cached_dict, json_opt) + except IOError as e: + print(e.errno, e) + else: + if json_opt: + json_output.update(self.cnstat_print(port, cnstat_dict, json_opt)) + else: + self.cnstat_print(port, cnstat_dict, json_opt) + + if json_opt: + print(json_dump(json_output)) + + def get_print_port_stat(self, port, json_opt): + """ + Get stat for the port + If JSON option is True print data in JSON format + """ + if not port in self.port_queues_map: + print("Port doesn't exist!", port) + sys.exit(1) + + # Get stat for the port queried + cnstat_dict = self.get_cnstat(self.port_queues_map[port]) + cnstat_fqn_file_name = cnstat_fqn_file + port + json_output = {} + json_output[port] = {} + if os.path.isfile(cnstat_fqn_file_name): + try: + cnstat_cached_dict = json.load(open(cnstat_fqn_file_name, 'r')) + if json_opt: + json_output[port].update({"cached_time":cnstat_cached_dict.get('time')}) + json_output.update(self.cnstat_diff_print(port, cnstat_dict, cnstat_cached_dict, json_opt)) + else: + print("Last cached time was " + str(cnstat_cached_dict.get('time'))) + self.cnstat_diff_print(port, cnstat_dict, cnstat_cached_dict, json_opt) + except IOError as e: + print(e.errno, e) + else: + if json_opt: + json_output.update(self.cnstat_print(port, cnstat_dict, json_opt)) + else: + self.cnstat_print(port, cnstat_dict, json_opt) + + if json_opt: + print(json_dump(json_output)) + + def save_fresh_stats(self): + # Get stat for each port and save + for port in natsorted(self.counter_port_name_map): + cnstat_dict = self.get_cnstat(self.port_queues_map[port]) + try: + json.dump(cnstat_dict, open(cnstat_fqn_file + port, 'w'), default=json_serial) + except IOError as e: + print(e.errno, e) + sys.exit(e.errno) + else: + print("Clear and update saved counters for " + port) + +def main(): + global cnstat_dir + global cnstat_fqn_file + + parser = argparse.ArgumentParser(description='Display the wred queue counters', + formatter_class=argparse.RawTextHelpFormatter, + epilog=""" +Examples: + wredstat + wredstat -p Ethernet0 + wredstat -c + wredstat -d +""") + + parser.add_argument('-p', '--port', type=str, help='Show the wred queue counters for just one port', default=None) + parser.add_argument('-c', '--clear', action='store_true', help='Clear previous stats and save new ones') + parser.add_argument('-d', '--delete', action='store_true', help='Delete saved stats') + parser.add_argument('-v', '--version', action='version', version='%(prog)s 1.0') + parser.add_argument('-j', '--json_opt', action='store_true', help='Print in JSON format') + parser.add_argument('-V', '--voq', action='store_true', help='display voq stats') + parser.add_argument('-n','--namespace', default=None, help='Display queue counters for specific namespace') + args = parser.parse_args() + + save_fresh_stats = args.clear + delete_stats = args.delete + voq = args.voq + json_opt = args.json_opt + namespace = args.namespace + + port_to_show_stats = args.port + + cache = UserCache() + + cnstat_dir = cache.get_directory() + cnstat_fqn_file = os.path.join(cnstat_dir, 'wredstat') + + if delete_stats: + cache.remove() + + wredstat = Wredstat( namespace, voq ) + + if save_fresh_stats: + wredstat.save_fresh_stats() + sys.exit(0) + + + if port_to_show_stats!=None: + wredstat.get_print_port_stat(port_to_show_stats, json_opt) + else: + wredstat.get_print_all_stat(json_opt) + + sys.exit(0) + +if __name__ == "__main__": + main() diff --git a/setup.py b/setup.py index ea0e949ab99..430dfec84ee 100644 --- a/setup.py +++ b/setup.py @@ -182,7 +182,8 @@ 'scripts/techsupport_cleanup.py', 'scripts/storm_control.py', 'scripts/check_db_integrity.py', - 'scripts/sysreadyshow' + 'scripts/sysreadyshow', + 'scripts/wredstat' ], entry_points={ 'console_scripts': [ diff --git a/show/main.py b/show/main.py index 7f79cd47797..ace5c713b69 100755 --- a/show/main.py +++ b/show/main.py @@ -731,6 +731,36 @@ def counters(interfacename, namespace, display, verbose, json, voq): run_command(cmd, display_cmd=verbose) +# 'wredcounters' subcommand ("show queue wredcounters") +@queue.command() +@click.argument('interfacename', required=False) +@multi_asic_util.multi_asic_click_options +@click.option('--verbose', is_flag=True, help="Enable verbose output") +@click.option('--json', is_flag=True, help="JSON output") +@click.option('--voq', is_flag=True, help="VOQ counters") +def wredcounters(interfacename, namespace, display, verbose, json, voq): + """Show queue wredcounters""" + + cmd = "wredstat" + + if interfacename is not None: + if clicommon.get_interface_naming_mode() == "alias": + interfacename = iface_alias_converter.alias_to_name(interfacename) + + if interfacename is not None: + cmd += " -p {}".format(interfacename) + + if namespace is not None: + cmd += " -n {}".format(namespace) + + if json: + cmd += " -j" + + if voq: + cmd += " -V" + + run_command(cmd, display_cmd=verbose) + # # 'watermarks' subgroup ("show queue watermarks ...") # diff --git a/tests/counterpoll_input/config_db.json b/tests/counterpoll_input/config_db.json index 38cde7c15e9..6e43a66a0a1 100644 --- a/tests/counterpoll_input/config_db.json +++ b/tests/counterpoll_input/config_db.json @@ -790,6 +790,12 @@ }, "FLOW_CNT_ROUTE": { "FLEX_COUNTER_STATUS": "enable" + }, + "WRED_ECN_QUEUE": { + "FLEX_COUNTER_STATUS": "enable" + }, + "WRED_ECN_PORT": { + "FLEX_COUNTER_STATUS": "enable" } }, "PORT": { diff --git a/tests/counterpoll_test.py b/tests/counterpoll_test.py index 4a4da07ee9f..319b12d5037 100644 --- a/tests/counterpoll_test.py +++ b/tests/counterpoll_test.py @@ -29,6 +29,8 @@ TUNNEL_STAT 3000 enable FLOW_CNT_TRAP_STAT 10000 enable FLOW_CNT_ROUTE_STAT 10000 enable +WRED_ECN_QUEUE_STAT 10000 enable +WRED_ECN_PORT_STAT 1000 enable """ class TestCounterpoll(object): @@ -221,6 +223,66 @@ def test_update_route_counter_interval(self): assert result.exit_code == 2 assert expected in result.output + @pytest.mark.parametrize("status", ["disable", "enable"]) + def test_update_wred_port_counter_status(self, status): + runner = CliRunner() + db = Db() + + result = runner.invoke(counterpoll.cli.commands["wredport"].commands[status], [], obj=db.cfgdb) + print(result.exit_code, result.output) + assert result.exit_code == 0 + + table = db.cfgdb.get_table('FLEX_COUNTER_TABLE') + assert status == table["WRED_ECN_PORT"]["FLEX_COUNTER_STATUS"] + + if status == "enable": + result = runner.invoke(counterpoll.cli.commands["show"], []) + print(result.output) + assert "WRED_ECN_PORT_STAT" in result.output + + @pytest.mark.parametrize("status", ["disable", "enable"]) + def test_update_wred_queue_counter_status(self, status): + runner = CliRunner() + db = Db() + + result = runner.invoke(counterpoll.cli.commands["wredqueue"].commands[status], [], obj=db.cfgdb) + print(result.exit_code, result.output) + assert result.exit_code == 0 + + table = db.cfgdb.get_table('FLEX_COUNTER_TABLE') + print(table) + assert status == table["WRED_ECN_QUEUE"]["FLEX_COUNTER_STATUS"] + + if status == "enable": + result = runner.invoke(counterpoll.cli.commands["show"], []) + print(result.output) + assert "WRED_ECN_QUEUE_STAT" in result.output + + def test_update_wred_port_counter_interval(self): + runner = CliRunner() + db = Db() + test_interval = "15000" + + result = runner.invoke(counterpoll.cli.commands["wredport"].commands["interval"], [test_interval], obj=db.cfgdb) + print(result.exit_code, result.output) + assert result.exit_code == 0 + + table = db.cfgdb.get_table("FLEX_COUNTER_TABLE") + print(table) + assert test_interval == table["WRED_ECN_PORT"]["POLL_INTERVAL"] + + def test_update_wred_queue_counter_interval(self): + runner = CliRunner() + db = Db() + test_interval = "18000" + + result = runner.invoke(counterpoll.cli.commands["wredqueue"].commands["interval"], [test_interval], obj=db.cfgdb) + print(result.exit_code, result.output) + assert result.exit_code == 0 + + table = db.cfgdb.get_table("FLEX_COUNTER_TABLE") + print(table) + assert test_interval == table["WRED_ECN_QUEUE"]["POLL_INTERVAL"] @classmethod def teardown_class(cls): diff --git a/tests/mock_tables/config_db.json b/tests/mock_tables/config_db.json index 2b406688834..aee1ed7e6ea 100644 --- a/tests/mock_tables/config_db.json +++ b/tests/mock_tables/config_db.json @@ -1720,6 +1720,14 @@ "POLL_INTERVAL": "10000", "FLEX_COUNTER_STATUS": "enable" }, + "FLEX_COUNTER_TABLE|WRED_ECN_QUEUE": { + "POLL_INTERVAL": "10000", + "FLEX_COUNTER_STATUS": "enable" + }, + "FLEX_COUNTER_TABLE|WRED_ECN_PORT": { + "POLL_INTERVAL": "1000", + "FLEX_COUNTER_STATUS": "enable" + }, "PFC_WD|Ethernet0": { "action": "drop", "detection_time": "600", diff --git a/tests/mock_tables/counters_db.json b/tests/mock_tables/counters_db.json index f2caba2449b..b772aad264b 100644 --- a/tests/mock_tables/counters_db.json +++ b/tests/mock_tables/counters_db.json @@ -1,5 +1,9 @@ { "COUNTERS:oid:0x15000000000357": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "30", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "74", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "56", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "68", "SAI_QUEUE_STAT_BYTES": "30", "SAI_QUEUE_STAT_DROPPED_BYTES": "74", "SAI_QUEUE_STAT_DROPPED_PACKETS": "56", @@ -7,6 +11,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "61" }, "COUNTERS:oid:0x15000000000358": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "43", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "1", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "39", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "60", "SAI_QUEUE_STAT_BYTES": "43", "SAI_QUEUE_STAT_DROPPED_BYTES": "1", "SAI_QUEUE_STAT_DROPPED_PACKETS": "39", @@ -14,6 +22,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "88" }, "COUNTERS:oid:0x15000000000359": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "7", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "21", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "39", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "82", "SAI_QUEUE_STAT_BYTES": "7", "SAI_QUEUE_STAT_DROPPED_BYTES": "21", "SAI_QUEUE_STAT_DROPPED_PACKETS": "39", @@ -21,6 +33,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "4" }, "COUNTERS:oid:0x1500000000035b": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "59", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "94", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "12", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "11", "SAI_QUEUE_STAT_BYTES": "59", "SAI_QUEUE_STAT_DROPPED_BYTES": "94", "SAI_QUEUE_STAT_DROPPED_PACKETS": "12", @@ -28,6 +44,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "15" }, "COUNTERS:oid:0x1500000000035c": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "62", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "40", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "35", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "36", "SAI_QUEUE_STAT_BYTES": "62", "SAI_QUEUE_STAT_DROPPED_BYTES": "40", "SAI_QUEUE_STAT_DROPPED_PACKETS": "35", @@ -35,6 +55,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "18" }, "COUNTERS:oid:0x1500000000035d": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "91", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "88", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "2", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "49", "SAI_QUEUE_STAT_BYTES": "91", "SAI_QUEUE_STAT_DROPPED_BYTES": "88", "SAI_QUEUE_STAT_DROPPED_PACKETS": "2", @@ -42,6 +66,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "73" }, "COUNTERS:oid:0x1500000000035e": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "17", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "74", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "94", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "33", "SAI_QUEUE_STAT_BYTES": "17", "SAI_QUEUE_STAT_DROPPED_BYTES": "74", "SAI_QUEUE_STAT_DROPPED_PACKETS": "94", @@ -49,6 +77,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "98" }, "COUNTERS:oid:0x1500000000035f": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "71", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "33", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "95", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "40", "SAI_QUEUE_STAT_BYTES": "71", "SAI_QUEUE_STAT_DROPPED_BYTES": "33", "SAI_QUEUE_STAT_DROPPED_PACKETS": "95", @@ -56,6 +88,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "81" }, "COUNTERS:oid:0x15000000000360": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "8", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "78", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "93", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "54", "SAI_QUEUE_STAT_BYTES": "8", "SAI_QUEUE_STAT_DROPPED_BYTES": "78", "SAI_QUEUE_STAT_DROPPED_PACKETS": "93", @@ -63,6 +99,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "59" }, "COUNTERS:oid:0x15000000000363": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "96", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "9", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "74", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "83", "SAI_QUEUE_STAT_BYTES": "96", "SAI_QUEUE_STAT_DROPPED_BYTES": "9", "SAI_QUEUE_STAT_DROPPED_PACKETS": "74", @@ -70,6 +110,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "12" }, "COUNTERS:oid:0x15000000000364": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "60", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "31", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "61", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "15", "SAI_QUEUE_STAT_BYTES": "60", "SAI_QUEUE_STAT_DROPPED_BYTES": "31", "SAI_QUEUE_STAT_DROPPED_PACKETS": "61", @@ -77,6 +121,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" }, "COUNTERS:oid:0x15000000000365": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "52", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "94", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "82", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "45", "SAI_QUEUE_STAT_BYTES": "52", "SAI_QUEUE_STAT_DROPPED_BYTES": "94", "SAI_QUEUE_STAT_DROPPED_PACKETS": "82", @@ -84,6 +132,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "68" }, "COUNTERS:oid:0x15000000000366": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "88", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "52", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "89", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "55", "SAI_QUEUE_STAT_BYTES": "88", "SAI_QUEUE_STAT_DROPPED_BYTES": "52", "SAI_QUEUE_STAT_DROPPED_PACKETS": "89", @@ -91,6 +143,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "18" }, "COUNTERS:oid:0x15000000000367": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "70", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "79", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "95", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "14", "SAI_QUEUE_STAT_BYTES": "70", "SAI_QUEUE_STAT_DROPPED_BYTES": "79", "SAI_QUEUE_STAT_DROPPED_PACKETS": "95", @@ -98,6 +154,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "21" }, "COUNTERS:oid:0x15000000000368": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "60", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "81", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "66", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "68", "SAI_QUEUE_STAT_BYTES": "60", "SAI_QUEUE_STAT_DROPPED_BYTES": "81", "SAI_QUEUE_STAT_DROPPED_PACKETS": "66", @@ -105,6 +165,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "98" }, "COUNTERS:oid:0x15000000000369": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "4", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "76", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "48", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "63", "SAI_QUEUE_STAT_BYTES": "4", "SAI_QUEUE_STAT_DROPPED_BYTES": "76", "SAI_QUEUE_STAT_DROPPED_PACKETS": "48", @@ -112,6 +176,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "93" }, "COUNTERS:oid:0x1500000000036a": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "73", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "74", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "77", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "41", "SAI_QUEUE_STAT_BYTES": "73", "SAI_QUEUE_STAT_DROPPED_BYTES": "74", "SAI_QUEUE_STAT_DROPPED_PACKETS": "77", @@ -119,6 +187,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "50" }, "COUNTERS:oid:0x1500000000036b": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "21", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "54", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "56", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "60", "SAI_QUEUE_STAT_BYTES": "21", "SAI_QUEUE_STAT_DROPPED_BYTES": "54", "SAI_QUEUE_STAT_DROPPED_PACKETS": "56", @@ -126,6 +198,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "30" }, "COUNTERS:oid:0x1500000000036c": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "31", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "39", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "12", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "57", "SAI_QUEUE_STAT_BYTES": "31", "SAI_QUEUE_STAT_DROPPED_BYTES": "39", "SAI_QUEUE_STAT_DROPPED_PACKETS": "12", @@ -133,6 +209,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "20" }, "COUNTERS:oid:0x1500000000037f": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "96", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "98", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "70", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "41", "SAI_QUEUE_STAT_BYTES": "96", "SAI_QUEUE_STAT_DROPPED_BYTES": "98", "SAI_QUEUE_STAT_DROPPED_PACKETS": "70", @@ -140,6 +220,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "46" }, "COUNTERS:oid:0x15000000000380": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "49", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "36", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "63", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "18", "SAI_QUEUE_STAT_BYTES": "49", "SAI_QUEUE_STAT_DROPPED_BYTES": "36", "SAI_QUEUE_STAT_DROPPED_PACKETS": "63", @@ -147,6 +231,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "18" }, "COUNTERS:oid:0x15000000000381": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "90", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "15", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "3", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "99", "SAI_QUEUE_STAT_BYTES": "90", "SAI_QUEUE_STAT_DROPPED_BYTES": "15", "SAI_QUEUE_STAT_DROPPED_PACKETS": "3", @@ -154,6 +242,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "15" }, "COUNTERS:oid:0x15000000000383": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "84", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "94", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "82", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "8", "SAI_QUEUE_STAT_BYTES": "84", "SAI_QUEUE_STAT_DROPPED_BYTES": "94", "SAI_QUEUE_STAT_DROPPED_PACKETS": "82", @@ -161,6 +253,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "17" }, "COUNTERS:oid:0x15000000000384": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "15", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "92", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "75", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "83", "SAI_QUEUE_STAT_BYTES": "15", "SAI_QUEUE_STAT_DROPPED_BYTES": "92", "SAI_QUEUE_STAT_DROPPED_PACKETS": "75", @@ -168,6 +264,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "42" }, "COUNTERS:oid:0x15000000000385": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "26", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "71", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "50", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "84", "SAI_QUEUE_STAT_BYTES": "26", "SAI_QUEUE_STAT_DROPPED_BYTES": "71", "SAI_QUEUE_STAT_DROPPED_PACKETS": "50", @@ -175,6 +275,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "31" }, "COUNTERS:oid:0x15000000000386": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "19", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "80", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "49", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "27", "SAI_QUEUE_STAT_BYTES": "19", "SAI_QUEUE_STAT_DROPPED_BYTES": "80", "SAI_QUEUE_STAT_DROPPED_PACKETS": "49", @@ -182,6 +286,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "4" }, "COUNTERS:oid:0x15000000000387": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "89", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "33", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "13", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "13", "SAI_QUEUE_STAT_BYTES": "89", "SAI_QUEUE_STAT_DROPPED_BYTES": "33", "SAI_QUEUE_STAT_DROPPED_PACKETS": "13", @@ -189,6 +297,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "45" }, "COUNTERS:oid:0x15000000000388": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "48", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "31", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "86", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "43", "SAI_QUEUE_STAT_BYTES": "48", "SAI_QUEUE_STAT_DROPPED_BYTES": "31", "SAI_QUEUE_STAT_DROPPED_PACKETS": "86", @@ -196,6 +308,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "6" }, "COUNTERS:oid:0x1500000000038b": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "1", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "82", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "57", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "50", "SAI_QUEUE_STAT_BYTES": "1", "SAI_QUEUE_STAT_DROPPED_BYTES": "82", "SAI_QUEUE_STAT_DROPPED_PACKETS": "57", @@ -203,6 +319,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "5" }, "COUNTERS:oid:0x1500000000038c": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "99", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "59", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "84", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "67", "SAI_QUEUE_STAT_BYTES": "99", "SAI_QUEUE_STAT_DROPPED_BYTES": "59", "SAI_QUEUE_STAT_DROPPED_PACKETS": "84", @@ -210,6 +330,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "32" }, "COUNTERS:oid:0x1500000000038d": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "58", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "5", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "27", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "4", "SAI_QUEUE_STAT_BYTES": "58", "SAI_QUEUE_STAT_DROPPED_BYTES": "5", "SAI_QUEUE_STAT_DROPPED_PACKETS": "27", @@ -217,6 +341,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "17" }, "COUNTERS:oid:0x1500000000038e": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "5", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "39", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "57", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "74", "SAI_QUEUE_STAT_BYTES": "5", "SAI_QUEUE_STAT_DROPPED_BYTES": "39", "SAI_QUEUE_STAT_DROPPED_PACKETS": "57", @@ -224,6 +352,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "99" }, "COUNTERS:oid:0x1500000000038f": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "59", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "14", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "4", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "21", "SAI_QUEUE_STAT_BYTES": "59", "SAI_QUEUE_STAT_DROPPED_BYTES": "14", "SAI_QUEUE_STAT_DROPPED_PACKETS": "4", @@ -231,6 +363,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "71" }, "COUNTERS:oid:0x15000000000390": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "61", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "53", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "19", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "24", "SAI_QUEUE_STAT_BYTES": "61", "SAI_QUEUE_STAT_DROPPED_BYTES": "53", "SAI_QUEUE_STAT_DROPPED_PACKETS": "19", @@ -238,6 +374,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "56" }, "COUNTERS:oid:0x15000000000391": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "15", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "32", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "15", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "51", "SAI_QUEUE_STAT_BYTES": "15", "SAI_QUEUE_STAT_DROPPED_BYTES": "32", "SAI_QUEUE_STAT_DROPPED_PACKETS": "15", @@ -245,6 +385,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "50" }, "COUNTERS:oid:0x15000000000392": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "18", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "15", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "23", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "98", "SAI_QUEUE_STAT_BYTES": "18", "SAI_QUEUE_STAT_DROPPED_BYTES": "15", "SAI_QUEUE_STAT_DROPPED_PACKETS": "23", @@ -252,6 +396,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "4" }, "COUNTERS:oid:0x15000000000393": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "34", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "57", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "9", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "41", "SAI_QUEUE_STAT_BYTES": "34", "SAI_QUEUE_STAT_DROPPED_BYTES": "57", "SAI_QUEUE_STAT_DROPPED_PACKETS": "9", @@ -259,6 +407,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "61" }, "COUNTERS:oid:0x15000000000394": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "7", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "99", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "18", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "57", "SAI_QUEUE_STAT_BYTES": "7", "SAI_QUEUE_STAT_DROPPED_BYTES": "99", "SAI_QUEUE_STAT_DROPPED_PACKETS": "18", @@ -266,6 +418,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "49" }, "COUNTERS:oid:0x150000000003a7": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "5", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "56", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "36", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "19", "SAI_QUEUE_STAT_BYTES": "5", "SAI_QUEUE_STAT_DROPPED_BYTES": "56", "SAI_QUEUE_STAT_DROPPED_PACKETS": "36", @@ -273,6 +429,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "65" }, "COUNTERS:oid:0x150000000003a8": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "17", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "91", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "68", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "38", "SAI_QUEUE_STAT_BYTES": "17", "SAI_QUEUE_STAT_DROPPED_BYTES": "91", "SAI_QUEUE_STAT_DROPPED_PACKETS": "68", @@ -280,6 +440,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "94" }, "COUNTERS:oid:0x150000000003a9": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "65", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "51", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "79", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "16", "SAI_QUEUE_STAT_BYTES": "65", "SAI_QUEUE_STAT_DROPPED_BYTES": "51", "SAI_QUEUE_STAT_DROPPED_PACKETS": "79", @@ -287,6 +451,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "71" }, "COUNTERS:oid:0x150000000003aa": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "97", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "72", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "63", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "11", "SAI_QUEUE_STAT_BYTES": "97", "SAI_QUEUE_STAT_DROPPED_BYTES": "72", "SAI_QUEUE_STAT_DROPPED_PACKETS": "63", @@ -294,6 +462,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "51" }, "COUNTERS:oid:0x150000000003ac": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "84", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "59", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "30", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "13", "SAI_QUEUE_STAT_BYTES": "84", "SAI_QUEUE_STAT_DROPPED_BYTES": "59", "SAI_QUEUE_STAT_DROPPED_PACKETS": "30", @@ -301,6 +473,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "47" }, "COUNTERS:oid:0x150000000003ad": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "67", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "85", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "99", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "49", "SAI_QUEUE_STAT_BYTES": "67", "SAI_QUEUE_STAT_DROPPED_BYTES": "85", "SAI_QUEUE_STAT_DROPPED_PACKETS": "99", @@ -308,6 +484,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "86" }, "COUNTERS:oid:0x150000000003ae": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "63", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "88", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "38", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "2", "SAI_QUEUE_STAT_BYTES": "63", "SAI_QUEUE_STAT_DROPPED_BYTES": "88", "SAI_QUEUE_STAT_DROPPED_PACKETS": "38", @@ -315,6 +495,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "98" }, "COUNTERS:oid:0x150000000003af": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "82", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "43", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "93", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "0", "SAI_QUEUE_STAT_BYTES": "82", "SAI_QUEUE_STAT_DROPPED_BYTES": "43", "SAI_QUEUE_STAT_DROPPED_PACKETS": "93", @@ -322,6 +506,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "50" }, "COUNTERS:oid:0x150000000003b0": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "17", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "61", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "91", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "80", "SAI_QUEUE_STAT_BYTES": "17", "SAI_QUEUE_STAT_DROPPED_BYTES": "61", "SAI_QUEUE_STAT_DROPPED_PACKETS": "91", @@ -329,6 +517,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "91" }, "COUNTERS:oid:0x150000000003b3": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "63", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "73", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "76", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "81", "SAI_QUEUE_STAT_BYTES": "63", "SAI_QUEUE_STAT_DROPPED_BYTES": "73", "SAI_QUEUE_STAT_DROPPED_PACKETS": "76", @@ -336,6 +528,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "12" }, "COUNTERS:oid:0x150000000003b4": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "16", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "66", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "29", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "29", "SAI_QUEUE_STAT_BYTES": "16", "SAI_QUEUE_STAT_DROPPED_BYTES": "66", "SAI_QUEUE_STAT_DROPPED_PACKETS": "29", @@ -343,6 +539,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "32" }, "COUNTERS:oid:0x150000000003b5": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "12", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "35", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "61", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "32", "SAI_QUEUE_STAT_BYTES": "12", "SAI_QUEUE_STAT_DROPPED_BYTES": "35", "SAI_QUEUE_STAT_DROPPED_PACKETS": "61", @@ -350,6 +550,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "89" }, "COUNTERS:oid:0x150000000003b6": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "17", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "93", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "72", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "79", "SAI_QUEUE_STAT_BYTES": "17", "SAI_QUEUE_STAT_DROPPED_BYTES": "93", "SAI_QUEUE_STAT_DROPPED_PACKETS": "72", @@ -357,6 +561,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "49" }, "COUNTERS:oid:0x150000000003b7": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "21", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "50", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "67", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "23", "SAI_QUEUE_STAT_BYTES": "21", "SAI_QUEUE_STAT_DROPPED_BYTES": "50", "SAI_QUEUE_STAT_DROPPED_PACKETS": "67", @@ -364,6 +572,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "4" }, "COUNTERS:oid:0x150000000003b8": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "10", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "14", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "97", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "37", "SAI_QUEUE_STAT_BYTES": "10", "SAI_QUEUE_STAT_DROPPED_BYTES": "14", "SAI_QUEUE_STAT_DROPPED_PACKETS": "97", @@ -371,6 +583,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "32" }, "COUNTERS:oid:0x150000000003b9": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "17", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "43", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "74", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "30", "SAI_QUEUE_STAT_BYTES": "17", "SAI_QUEUE_STAT_DROPPED_BYTES": "43", "SAI_QUEUE_STAT_DROPPED_PACKETS": "74", @@ -378,6 +594,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "42" }, "COUNTERS:oid:0x150000000003ba": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "63", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "84", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "54", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "0", "SAI_QUEUE_STAT_BYTES": "63", "SAI_QUEUE_STAT_DROPPED_BYTES": "84", "SAI_QUEUE_STAT_DROPPED_PACKETS": "54", @@ -385,6 +605,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "43" }, "COUNTERS:oid:0x150000000003bb": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "88", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "79", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "24", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "69", "SAI_QUEUE_STAT_BYTES": "88", "SAI_QUEUE_STAT_DROPPED_BYTES": "79", "SAI_QUEUE_STAT_DROPPED_PACKETS": "24", @@ -392,6 +616,10 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "62" }, "COUNTERS:oid:0x150000000003bc": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "12", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "3", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "84", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "20", "SAI_QUEUE_STAT_BYTES": "12", "SAI_QUEUE_STAT_DROPPED_BYTES": "3", "SAI_QUEUE_STAT_DROPPED_PACKETS": "84", @@ -399,144 +627,240 @@ "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "81" }, "COUNTERS:oid:0x15000000000657": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "30", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "74", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "56", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "68", "SAI_QUEUE_STAT_BYTES": "30", "SAI_QUEUE_STAT_DROPPED_BYTES": "74", "SAI_QUEUE_STAT_DROPPED_PACKETS": "56", "SAI_QUEUE_STAT_PACKETS": "68" }, "COUNTERS:oid:0x15000000000658": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "43", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "1", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "39", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "60", "SAI_QUEUE_STAT_BYTES": "43", "SAI_QUEUE_STAT_DROPPED_BYTES": "1", "SAI_QUEUE_STAT_DROPPED_PACKETS": "39", "SAI_QUEUE_STAT_PACKETS": "60" }, "COUNTERS:oid:0x15000000000659": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "7", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "21", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "39", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "82", "SAI_QUEUE_STAT_BYTES": "7", "SAI_QUEUE_STAT_DROPPED_BYTES": "21", "SAI_QUEUE_STAT_DROPPED_PACKETS": "39", "SAI_QUEUE_STAT_PACKETS": "82" }, "COUNTERS:oid:0x1500000000065a": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "59", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "94", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "12", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "11", "SAI_QUEUE_STAT_BYTES": "59", "SAI_QUEUE_STAT_DROPPED_BYTES": "94", "SAI_QUEUE_STAT_DROPPED_PACKETS": "12", "SAI_QUEUE_STAT_PACKETS": "11" }, "COUNTERS:oid:0x1500000000065b": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "62", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "40", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "35", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "36", "SAI_QUEUE_STAT_BYTES": "62", "SAI_QUEUE_STAT_DROPPED_BYTES": "40", "SAI_QUEUE_STAT_DROPPED_PACKETS": "35", "SAI_QUEUE_STAT_PACKETS": "36" }, "COUNTERS:oid:0x1500000000065c": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "91", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "88", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "2", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "49", "SAI_QUEUE_STAT_BYTES": "91", "SAI_QUEUE_STAT_DROPPED_BYTES": "88", "SAI_QUEUE_STAT_DROPPED_PACKETS": "2", "SAI_QUEUE_STAT_PACKETS": "49" }, "COUNTERS:oid:0x1500000000065d": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "17", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "74", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "94", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "33", "SAI_QUEUE_STAT_BYTES": "17", "SAI_QUEUE_STAT_DROPPED_BYTES": "74", "SAI_QUEUE_STAT_DROPPED_PACKETS": "94", "SAI_QUEUE_STAT_PACKETS": "33" }, "COUNTERS:oid:0x1500000000065e": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "71", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "33", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "95", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "40", "SAI_QUEUE_STAT_BYTES": "71", "SAI_QUEUE_STAT_DROPPED_BYTES": "33", "SAI_QUEUE_STAT_DROPPED_PACKETS": "95", "SAI_QUEUE_STAT_PACKETS": "40" }, "COUNTERS:oid:0x15000000000667": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "8", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "78", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "93", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "54", "SAI_QUEUE_STAT_BYTES": "8", "SAI_QUEUE_STAT_DROPPED_BYTES": "78", "SAI_QUEUE_STAT_DROPPED_PACKETS": "93", "SAI_QUEUE_STAT_PACKETS": "54" }, "COUNTERS:oid:0x15000000000668": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "96", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "9", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "74", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "83", "SAI_QUEUE_STAT_BYTES": "96", "SAI_QUEUE_STAT_DROPPED_BYTES": "9", "SAI_QUEUE_STAT_DROPPED_PACKETS": "74", "SAI_QUEUE_STAT_PACKETS": "83" }, "COUNTERS:oid:0x15000000000669": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "60", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "31", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "61", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "15", "SAI_QUEUE_STAT_BYTES": "60", "SAI_QUEUE_STAT_DROPPED_BYTES": "31", "SAI_QUEUE_STAT_DROPPED_PACKETS": "61", "SAI_QUEUE_STAT_PACKETS": "15" }, "COUNTERS:oid:0x1500000000066a": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "52", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "94", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "82", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "45", "SAI_QUEUE_STAT_BYTES": "52", "SAI_QUEUE_STAT_DROPPED_BYTES": "94", "SAI_QUEUE_STAT_DROPPED_PACKETS": "82", "SAI_QUEUE_STAT_PACKETS": "45" }, "COUNTERS:oid:0x1500000000066b": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "88", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "52", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "89", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "55", "SAI_QUEUE_STAT_BYTES": "88", "SAI_QUEUE_STAT_DROPPED_BYTES": "52", "SAI_QUEUE_STAT_DROPPED_PACKETS": "89", "SAI_QUEUE_STAT_PACKETS": "55" }, "COUNTERS:oid:0x1500000000066c": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "70", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "79", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "95", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "14", "SAI_QUEUE_STAT_BYTES": "70", "SAI_QUEUE_STAT_DROPPED_BYTES": "79", "SAI_QUEUE_STAT_DROPPED_PACKETS": "95", "SAI_QUEUE_STAT_PACKETS": "14" }, "COUNTERS:oid:0x1500000000066d": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "60", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "81", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "66", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "68", "SAI_QUEUE_STAT_BYTES": "60", "SAI_QUEUE_STAT_DROPPED_BYTES": "81", "SAI_QUEUE_STAT_DROPPED_PACKETS": "66", "SAI_QUEUE_STAT_PACKETS": "68" }, "COUNTERS:oid:0x1500000000066e": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "4", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "76", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "48", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "63", "SAI_QUEUE_STAT_BYTES": "4", "SAI_QUEUE_STAT_DROPPED_BYTES": "76", "SAI_QUEUE_STAT_DROPPED_PACKETS": "48", "SAI_QUEUE_STAT_PACKETS": "63" }, "COUNTERS:oid:0x15000000000677": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "73", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "74", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "77", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "41", "SAI_QUEUE_STAT_BYTES": "73", "SAI_QUEUE_STAT_DROPPED_BYTES": "74", "SAI_QUEUE_STAT_DROPPED_PACKETS": "77", "SAI_QUEUE_STAT_PACKETS": "41" }, "COUNTERS:oid:0x15000000000678": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "21", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "54", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "56", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "60", "SAI_QUEUE_STAT_BYTES": "21", "SAI_QUEUE_STAT_DROPPED_BYTES": "54", "SAI_QUEUE_STAT_DROPPED_PACKETS": "56", "SAI_QUEUE_STAT_PACKETS": "60" }, "COUNTERS:oid:0x15000000000679": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "31", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "39", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "12", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "57", "SAI_QUEUE_STAT_BYTES": "31", "SAI_QUEUE_STAT_DROPPED_BYTES": "39", "SAI_QUEUE_STAT_DROPPED_PACKETS": "12", "SAI_QUEUE_STAT_PACKETS": "57" }, "COUNTERS:oid:0x1500000000067a": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "96", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "98", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "70", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "41", "SAI_QUEUE_STAT_BYTES": "96", "SAI_QUEUE_STAT_DROPPED_BYTES": "98", "SAI_QUEUE_STAT_DROPPED_PACKETS": "70", "SAI_QUEUE_STAT_PACKETS": "41" }, "COUNTERS:oid:0x1500000000067b": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "49", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "36", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "63", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "18", "SAI_QUEUE_STAT_BYTES": "49", "SAI_QUEUE_STAT_DROPPED_BYTES": "36", "SAI_QUEUE_STAT_DROPPED_PACKETS": "63", "SAI_QUEUE_STAT_PACKETS": "18" }, "COUNTERS:oid:0x1500000000067c": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "90", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "15", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "3", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "99", "SAI_QUEUE_STAT_BYTES": "90", "SAI_QUEUE_STAT_DROPPED_BYTES": "15", "SAI_QUEUE_STAT_DROPPED_PACKETS": "3", "SAI_QUEUE_STAT_PACKETS": "99" }, "COUNTERS:oid:0x1500000000067d": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "84", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "94", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "82", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "8", "SAI_QUEUE_STAT_BYTES": "84", "SAI_QUEUE_STAT_DROPPED_BYTES": "94", "SAI_QUEUE_STAT_DROPPED_PACKETS": "82", "SAI_QUEUE_STAT_PACKETS": "8" }, "COUNTERS:oid:0x1500000000067e": { + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "15", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "92", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "75", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "83", "SAI_QUEUE_STAT_BYTES": "15", "SAI_QUEUE_STAT_DROPPED_BYTES": "92", "SAI_QUEUE_STAT_DROPPED_PACKETS": "75", @@ -554,6 +878,9 @@ "SAI_QUEUE_STAT_DROPPED_BYTES": "0", "SAI_QUEUE_STAT_DROPPED_PACKETS": "0", "SAI_QUEUE_STAT_BYTES": "0", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "0", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "0", + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "0", "SAI_QUEUE_STAT_SHARED_WATERMARK_BYTES": "0" }, "COUNTERS:oid:0x60000000005a1": { @@ -918,7 +1245,11 @@ "SAI_PORT_STAT_ETHER_STATS_JABBERS": "0", "SAI_PORT_STAT_IF_IN_FEC_CORRECTABLE_FRAMES": "110412", "SAI_PORT_STAT_IF_IN_FEC_NOT_CORRECTABLE_FRAMES": "1", - "SAI_PORT_STAT_IF_IN_FEC_SYMBOL_ERRORS": "0" + "SAI_PORT_STAT_IF_IN_FEC_SYMBOL_ERRORS": "0", + "SAI_PORT_STAT_GREEN_WRED_DROPPED_PACKETS":"17", + "SAI_PORT_STAT_YELLOW_WRED_DROPPED_PACKETS":"33", + "SAI_PORT_STAT_RED_WRED_DROPPED_PACKETS":"51", + "SAI_PORT_STAT_WRED_DROPPED_PACKETS":"101" }, "COUNTERS:oid:0x1000000000014": { "SAI_PORT_STAT_IF_IN_UCAST_PKTS": "6", @@ -1791,6 +2122,10 @@ "PFC_WD_RESTORATION_TIME": "600000", "PFC_WD_RESTORATION_TIME_LEFT": "600000", "PFC_WD_STATUS": "stormed", + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "70", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "76", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "19", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "52", "SAI_QUEUE_STAT_BYTES": "70", "SAI_QUEUE_STAT_DROPPED_BYTES": "76", "SAI_QUEUE_STAT_DROPPED_PACKETS": "19", @@ -1814,6 +2149,10 @@ "PFC_WD_RESTORATION_TIME": "600000", "PFC_WD_RESTORATION_TIME_LEFT": "600000", "PFC_WD_STATUS": "operational", + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "89", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "41", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "48", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "60", "SAI_QUEUE_STAT_BYTES": "89", "SAI_QUEUE_STAT_DROPPED_BYTES": "41", "SAI_QUEUE_STAT_DROPPED_PACKETS": "48", @@ -1837,6 +2176,10 @@ "PFC_WD_RESTORATION_TIME": "600000", "PFC_WD_RESTORATION_TIME_LEFT": "600000", "PFC_WD_STATUS": "stormed", + "SAI_QUEUE_STAT_WRED_DROPPED_BYTES": "89", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_BYTES": "62", + "SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS": "62", + "SAI_QUEUE_STAT_WRED_DROPPED_PACKETS": "54", "SAI_QUEUE_STAT_BYTES": "89", "SAI_QUEUE_STAT_DROPPED_BYTES": "62", "SAI_QUEUE_STAT_DROPPED_PACKETS": "62", diff --git a/tests/mock_tables/state_db.json b/tests/mock_tables/state_db.json index cd1a194ba8e..921e94cd34b 100644 --- a/tests/mock_tables/state_db.json +++ b/tests/mock_tables/state_db.json @@ -639,6 +639,30 @@ "reasons": "[ACL_ANY,L2_ANY,L3_ANY]", "count": "2" }, + "QUEUE_COUNTER_CAPABILITIES|WRED_ECN_QUEUE_WRED_DROPPED_PKT_COUNTER": { + "isSupported": "true" + }, + "QUEUE_COUNTER_CAPABILITIES|WRED_ECN_QUEUE_WRED_DROPPED_BYTE_COUNTER": { + "isSupported": "true" + }, + "QUEUE_COUNTER_CAPABILITIES|WRED_ECN_QUEUE_ECN_MARKED_PKT_COUNTER": { + "isSupported": "true" + }, + "QUEUE_COUNTER_CAPABILITIES|WRED_ECN_QUEUE_ECN_MARKED_BYTE_COUNTER": { + "isSupported": "true" + }, + "PORT_COUNTER_CAPABILITIES|WRED_ECN_PORT_WRED_GREEN_DROP_COUNTER": { + "isSupported": "true" + }, + "PORT_COUNTER_CAPABILITIES|WRED_ECN_PORT_WRED_YELLOW_DROP_COUNTER": { + "isSupported": "true" + }, + "PORT_COUNTER_CAPABILITIES|WRED_ECN_PORT_WRED_RED_DROP_COUNTER": { + "isSupported": "true" + }, + "PORT_COUNTER_CAPABILITIES|WRED_ECN_PORT_WRED_TOTAL_DROP_COUNTER": { + "isSupported": "true" + }, "LAG_MEMBER_TABLE|PortChannel0001|Ethernet112": { "runner.actor_lacpdu_info.state": "5", "runner.state": "disabled", diff --git a/tests/portstat_test.py b/tests/portstat_test.py index d418a16feb6..291ab5ed79d 100644 --- a/tests/portstat_test.py +++ b/tests/portstat_test.py @@ -232,6 +232,12 @@ Unicast Packets Transmitted.................... 40 Multicast Packets Transmitted.................. 0 Broadcast Packets Transmitted.................. 0 + +WRED Green Dropped Packets..................... 17 +WRED Yellow Dropped Packets.................... 33 +WRED Red Dropped Packets....................... 51 +WRED Total Dropped Packets..................... 101 + Time Since Counters Last Cleared............... None """ diff --git a/tests/wred_queue_counter_test.py b/tests/wred_queue_counter_test.py new file mode 100644 index 00000000000..1438baacff1 --- /dev/null +++ b/tests/wred_queue_counter_test.py @@ -0,0 +1,1268 @@ +import imp +import json +import os +import sys + +from click.testing import CliRunner +from unittest import TestCase +from swsscommon.swsscommon import ConfigDBConnector + +from .mock_tables import dbconnector + +import show.main as show +from utilities_common.cli import json_dump +from utilities_common.db import Db + +test_path = os.path.dirname(os.path.abspath(__file__)) +modules_path = os.path.dirname(test_path) +scripts_path = os.path.join(modules_path, "scripts") +sys.path.insert(0, test_path) +sys.path.insert(0, modules_path) + +show_wred_queue_counters = """\ + Port TxQ WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes +--------- ----- -------------- --------------- ---------------- ----------------- +Ethernet0 UC0 68 30 56 74 +Ethernet0 UC1 60 43 39 1 +Ethernet0 UC2 82 7 39 21 +Ethernet0 UC3 52 70 19 76 +Ethernet0 UC4 11 59 12 94 +Ethernet0 UC5 36 62 35 40 +Ethernet0 UC6 49 91 2 88 +Ethernet0 UC7 33 17 94 74 +Ethernet0 UC8 40 71 95 33 +Ethernet0 UC9 54 8 93 78 +Ethernet0 MC10 83 96 74 9 +Ethernet0 MC11 15 60 61 31 +Ethernet0 MC12 45 52 82 94 +Ethernet0 MC13 55 88 89 52 +Ethernet0 MC14 14 70 95 79 +Ethernet0 MC15 68 60 66 81 +Ethernet0 MC16 63 4 48 76 +Ethernet0 MC17 41 73 77 74 +Ethernet0 MC18 60 21 56 54 +Ethernet0 MC19 57 31 12 39 +Ethernet0 ALL20 N/A N/A N/A N/A +Ethernet0 ALL21 N/A N/A N/A N/A +Ethernet0 ALL22 N/A N/A N/A N/A +Ethernet0 ALL23 N/A N/A N/A N/A +Ethernet0 ALL24 N/A N/A N/A N/A +Ethernet0 ALL25 N/A N/A N/A N/A +Ethernet0 ALL26 N/A N/A N/A N/A +Ethernet0 ALL27 N/A N/A N/A N/A +Ethernet0 ALL28 N/A N/A N/A N/A +Ethernet0 ALL29 N/A N/A N/A N/A + + Port TxQ WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes +--------- ----- -------------- --------------- ---------------- ----------------- +Ethernet4 UC0 41 96 70 98 +Ethernet4 UC1 18 49 63 36 +Ethernet4 UC2 99 90 3 15 +Ethernet4 UC3 60 89 48 41 +Ethernet4 UC4 8 84 82 94 +Ethernet4 UC5 83 15 75 92 +Ethernet4 UC6 84 26 50 71 +Ethernet4 UC7 27 19 49 80 +Ethernet4 UC8 13 89 13 33 +Ethernet4 UC9 43 48 86 31 +Ethernet4 MC10 50 1 57 82 +Ethernet4 MC11 67 99 84 59 +Ethernet4 MC12 4 58 27 5 +Ethernet4 MC13 74 5 57 39 +Ethernet4 MC14 21 59 4 14 +Ethernet4 MC15 24 61 19 53 +Ethernet4 MC16 51 15 15 32 +Ethernet4 MC17 98 18 23 15 +Ethernet4 MC18 41 34 9 57 +Ethernet4 MC19 57 7 18 99 +Ethernet4 ALL20 N/A N/A N/A N/A +Ethernet4 ALL21 N/A N/A N/A N/A +Ethernet4 ALL22 N/A N/A N/A N/A +Ethernet4 ALL23 N/A N/A N/A N/A +Ethernet4 ALL24 N/A N/A N/A N/A +Ethernet4 ALL25 N/A N/A N/A N/A +Ethernet4 ALL26 N/A N/A N/A N/A +Ethernet4 ALL27 N/A N/A N/A N/A +Ethernet4 ALL28 N/A N/A N/A N/A +Ethernet4 ALL29 N/A N/A N/A N/A + + Port TxQ WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes +--------- ----- -------------- --------------- ---------------- ----------------- +Ethernet8 UC0 19 5 36 56 +Ethernet8 UC1 38 17 68 91 +Ethernet8 UC2 16 65 79 51 +Ethernet8 UC3 11 97 63 72 +Ethernet8 UC4 54 89 62 62 +Ethernet8 UC5 13 84 30 59 +Ethernet8 UC6 49 67 99 85 +Ethernet8 UC7 2 63 38 88 +Ethernet8 UC8 0 82 93 43 +Ethernet8 UC9 80 17 91 61 +Ethernet8 MC10 81 63 76 73 +Ethernet8 MC11 29 16 29 66 +Ethernet8 MC12 32 12 61 35 +Ethernet8 MC13 79 17 72 93 +Ethernet8 MC14 23 21 67 50 +Ethernet8 MC15 37 10 97 14 +Ethernet8 MC16 30 17 74 43 +Ethernet8 MC17 0 63 54 84 +Ethernet8 MC18 69 88 24 79 +Ethernet8 MC19 20 12 84 3 +Ethernet8 ALL20 N/A N/A N/A N/A +Ethernet8 ALL21 N/A N/A N/A N/A +Ethernet8 ALL22 N/A N/A N/A N/A +Ethernet8 ALL23 N/A N/A N/A N/A +Ethernet8 ALL24 N/A N/A N/A N/A +Ethernet8 ALL25 N/A N/A N/A N/A +Ethernet8 ALL26 N/A N/A N/A N/A +Ethernet8 ALL27 N/A N/A N/A N/A +Ethernet8 ALL28 N/A N/A N/A N/A +Ethernet8 ALL29 N/A N/A N/A N/A + +""" + + +show_wred_queue_counters_port = """\ + Port TxQ WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes +--------- ----- -------------- --------------- ---------------- ----------------- +Ethernet8 UC0 19 5 36 56 +Ethernet8 UC1 38 17 68 91 +Ethernet8 UC2 16 65 79 51 +Ethernet8 UC3 11 97 63 72 +Ethernet8 UC4 54 89 62 62 +Ethernet8 UC5 13 84 30 59 +Ethernet8 UC6 49 67 99 85 +Ethernet8 UC7 2 63 38 88 +Ethernet8 UC8 0 82 93 43 +Ethernet8 UC9 80 17 91 61 +Ethernet8 MC10 81 63 76 73 +Ethernet8 MC11 29 16 29 66 +Ethernet8 MC12 32 12 61 35 +Ethernet8 MC13 79 17 72 93 +Ethernet8 MC14 23 21 67 50 +Ethernet8 MC15 37 10 97 14 +Ethernet8 MC16 30 17 74 43 +Ethernet8 MC17 0 63 54 84 +Ethernet8 MC18 69 88 24 79 +Ethernet8 MC19 20 12 84 3 +Ethernet8 ALL20 N/A N/A N/A N/A +Ethernet8 ALL21 N/A N/A N/A N/A +Ethernet8 ALL22 N/A N/A N/A N/A +Ethernet8 ALL23 N/A N/A N/A N/A +Ethernet8 ALL24 N/A N/A N/A N/A +Ethernet8 ALL25 N/A N/A N/A N/A +Ethernet8 ALL26 N/A N/A N/A N/A +Ethernet8 ALL27 N/A N/A N/A N/A +Ethernet8 ALL28 N/A N/A N/A N/A +Ethernet8 ALL29 N/A N/A N/A N/A + +""" + +show_queue_counters_json = """\ +{ + "Ethernet0": { + "ALL20": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL21": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL22": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL23": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL24": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL25": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL26": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL27": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL28": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL29": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "MC10": { + "ecnmarkedbytes": "9", + "ecnmarkedpacket": "74", + "wreddropbytes": "96", + "wreddroppacket": "83" + }, + "MC11": { + "ecnmarkedbytes": "31", + "ecnmarkedpacket": "61", + "wreddropbytes": "60", + "wreddroppacket": "15" + }, + "MC12": { + "ecnmarkedbytes": "94", + "ecnmarkedpacket": "82", + "wreddropbytes": "52", + "wreddroppacket": "45" + }, + "MC13": { + "ecnmarkedbytes": "52", + "ecnmarkedpacket": "89", + "wreddropbytes": "88", + "wreddroppacket": "55" + }, + "MC14": { + "ecnmarkedbytes": "79", + "ecnmarkedpacket": "95", + "wreddropbytes": "70", + "wreddroppacket": "14" + }, + "MC15": { + "ecnmarkedbytes": "81", + "ecnmarkedpacket": "66", + "wreddropbytes": "60", + "wreddroppacket": "68" + }, + "MC16": { + "ecnmarkedbytes": "76", + "ecnmarkedpacket": "48", + "wreddropbytes": "4", + "wreddroppacket": "63" + }, + "MC17": { + "ecnmarkedbytes": "74", + "ecnmarkedpacket": "77", + "wreddropbytes": "73", + "wreddroppacket": "41" + }, + "MC18": { + "ecnmarkedbytes": "54", + "ecnmarkedpacket": "56", + "wreddropbytes": "21", + "wreddroppacket": "60" + }, + "MC19": { + "ecnmarkedbytes": "39", + "ecnmarkedpacket": "12", + "wreddropbytes": "31", + "wreddroppacket": "57" + }, + "UC0": { + "ecnmarkedbytes": "74", + "ecnmarkedpacket": "56", + "wreddropbytes": "30", + "wreddroppacket": "68" + }, + "UC1": { + "ecnmarkedbytes": "1", + "ecnmarkedpacket": "39", + "wreddropbytes": "43", + "wreddroppacket": "60" + }, + "UC2": { + "ecnmarkedbytes": "21", + "ecnmarkedpacket": "39", + "wreddropbytes": "7", + "wreddroppacket": "82" + }, + "UC3": { + "ecnmarkedbytes": "76", + "ecnmarkedpacket": "19", + "wreddropbytes": "70", + "wreddroppacket": "52" + }, + "UC4": { + "ecnmarkedbytes": "94", + "ecnmarkedpacket": "12", + "wreddropbytes": "59", + "wreddroppacket": "11" + }, + "UC5": { + "ecnmarkedbytes": "40", + "ecnmarkedpacket": "35", + "wreddropbytes": "62", + "wreddroppacket": "36" + }, + "UC6": { + "ecnmarkedbytes": "88", + "ecnmarkedpacket": "2", + "wreddropbytes": "91", + "wreddroppacket": "49" + }, + "UC7": { + "ecnmarkedbytes": "74", + "ecnmarkedpacket": "94", + "wreddropbytes": "17", + "wreddroppacket": "33" + }, + "UC8": { + "ecnmarkedbytes": "33", + "ecnmarkedpacket": "95", + "wreddropbytes": "71", + "wreddroppacket": "40" + }, + "UC9": { + "ecnmarkedbytes": "78", + "ecnmarkedpacket": "93", + "wreddropbytes": "8", + "wreddroppacket": "54" + } + }, + "Ethernet4": { + "ALL20": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL21": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL22": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL23": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL24": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL25": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL26": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL27": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL28": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL29": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "MC10": { + "ecnmarkedbytes": "82", + "ecnmarkedpacket": "57", + "wreddropbytes": "1", + "wreddroppacket": "50" + }, + "MC11": { + "ecnmarkedbytes": "59", + "ecnmarkedpacket": "84", + "wreddropbytes": "99", + "wreddroppacket": "67" + }, + "MC12": { + "ecnmarkedbytes": "5", + "ecnmarkedpacket": "27", + "wreddropbytes": "58", + "wreddroppacket": "4" + }, + "MC13": { + "ecnmarkedbytes": "39", + "ecnmarkedpacket": "57", + "wreddropbytes": "5", + "wreddroppacket": "74" + }, + "MC14": { + "ecnmarkedbytes": "14", + "ecnmarkedpacket": "4", + "wreddropbytes": "59", + "wreddroppacket": "21" + }, + "MC15": { + "ecnmarkedbytes": "53", + "ecnmarkedpacket": "19", + "wreddropbytes": "61", + "wreddroppacket": "24" + }, + "MC16": { + "ecnmarkedbytes": "32", + "ecnmarkedpacket": "15", + "wreddropbytes": "15", + "wreddroppacket": "51" + }, + "MC17": { + "ecnmarkedbytes": "15", + "ecnmarkedpacket": "23", + "wreddropbytes": "18", + "wreddroppacket": "98" + }, + "MC18": { + "ecnmarkedbytes": "57", + "ecnmarkedpacket": "9", + "wreddropbytes": "34", + "wreddroppacket": "41" + }, + "MC19": { + "ecnmarkedbytes": "99", + "ecnmarkedpacket": "18", + "wreddropbytes": "7", + "wreddroppacket": "57" + }, + "UC0": { + "ecnmarkedbytes": "98", + "ecnmarkedpacket": "70", + "wreddropbytes": "96", + "wreddroppacket": "41" + }, + "UC1": { + "ecnmarkedbytes": "36", + "ecnmarkedpacket": "63", + "wreddropbytes": "49", + "wreddroppacket": "18" + }, + "UC2": { + "ecnmarkedbytes": "15", + "ecnmarkedpacket": "3", + "wreddropbytes": "90", + "wreddroppacket": "99" + }, + "UC3": { + "ecnmarkedbytes": "41", + "ecnmarkedpacket": "48", + "wreddropbytes": "89", + "wreddroppacket": "60" + }, + "UC4": { + "ecnmarkedbytes": "94", + "ecnmarkedpacket": "82", + "wreddropbytes": "84", + "wreddroppacket": "8" + }, + "UC5": { + "ecnmarkedbytes": "92", + "ecnmarkedpacket": "75", + "wreddropbytes": "15", + "wreddroppacket": "83" + }, + "UC6": { + "ecnmarkedbytes": "71", + "ecnmarkedpacket": "50", + "wreddropbytes": "26", + "wreddroppacket": "84" + }, + "UC7": { + "ecnmarkedbytes": "80", + "ecnmarkedpacket": "49", + "wreddropbytes": "19", + "wreddroppacket": "27" + }, + "UC8": { + "ecnmarkedbytes": "33", + "ecnmarkedpacket": "13", + "wreddropbytes": "89", + "wreddroppacket": "13" + }, + "UC9": { + "ecnmarkedbytes": "31", + "ecnmarkedpacket": "86", + "wreddropbytes": "48", + "wreddroppacket": "43" + } + }, + "Ethernet8": { + "ALL20": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL21": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL22": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL23": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL24": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL25": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL26": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL27": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL28": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL29": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "MC10": { + "ecnmarkedbytes": "73", + "ecnmarkedpacket": "76", + "wreddropbytes": "63", + "wreddroppacket": "81" + }, + "MC11": { + "ecnmarkedbytes": "66", + "ecnmarkedpacket": "29", + "wreddropbytes": "16", + "wreddroppacket": "29" + }, + "MC12": { + "ecnmarkedbytes": "35", + "ecnmarkedpacket": "61", + "wreddropbytes": "12", + "wreddroppacket": "32" + }, + "MC13": { + "ecnmarkedbytes": "93", + "ecnmarkedpacket": "72", + "wreddropbytes": "17", + "wreddroppacket": "79" + }, + "MC14": { + "ecnmarkedbytes": "50", + "ecnmarkedpacket": "67", + "wreddropbytes": "21", + "wreddroppacket": "23" + }, + "MC15": { + "ecnmarkedbytes": "14", + "ecnmarkedpacket": "97", + "wreddropbytes": "10", + "wreddroppacket": "37" + }, + "MC16": { + "ecnmarkedbytes": "43", + "ecnmarkedpacket": "74", + "wreddropbytes": "17", + "wreddroppacket": "30" + }, + "MC17": { + "ecnmarkedbytes": "84", + "ecnmarkedpacket": "54", + "wreddropbytes": "63", + "wreddroppacket": "0" + }, + "MC18": { + "ecnmarkedbytes": "79", + "ecnmarkedpacket": "24", + "wreddropbytes": "88", + "wreddroppacket": "69" + }, + "MC19": { + "ecnmarkedbytes": "3", + "ecnmarkedpacket": "84", + "wreddropbytes": "12", + "wreddroppacket": "20" + }, + "UC0": { + "ecnmarkedbytes": "56", + "ecnmarkedpacket": "36", + "wreddropbytes": "5", + "wreddroppacket": "19" + }, + "UC1": { + "ecnmarkedbytes": "91", + "ecnmarkedpacket": "68", + "wreddropbytes": "17", + "wreddroppacket": "38" + }, + "UC2": { + "ecnmarkedbytes": "51", + "ecnmarkedpacket": "79", + "wreddropbytes": "65", + "wreddroppacket": "16" + }, + "UC3": { + "ecnmarkedbytes": "72", + "ecnmarkedpacket": "63", + "wreddropbytes": "97", + "wreddroppacket": "11" + }, + "UC4": { + "ecnmarkedbytes": "62", + "ecnmarkedpacket": "62", + "wreddropbytes": "89", + "wreddroppacket": "54" + }, + "UC5": { + "ecnmarkedbytes": "59", + "ecnmarkedpacket": "30", + "wreddropbytes": "84", + "wreddroppacket": "13" + }, + "UC6": { + "ecnmarkedbytes": "85", + "ecnmarkedpacket": "99", + "wreddropbytes": "67", + "wreddroppacket": "49" + }, + "UC7": { + "ecnmarkedbytes": "88", + "ecnmarkedpacket": "38", + "wreddropbytes": "63", + "wreddroppacket": "2" + }, + "UC8": { + "ecnmarkedbytes": "43", + "ecnmarkedpacket": "93", + "wreddropbytes": "82", + "wreddroppacket": "0" + }, + "UC9": { + "ecnmarkedbytes": "61", + "ecnmarkedpacket": "91", + "wreddropbytes": "17", + "wreddroppacket": "80" + } + } +}""" + +show_queue_counters_port_json = """\ +{ + "Ethernet8": { + "ALL20": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL21": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL22": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL23": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL24": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL25": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL26": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL27": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL28": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "ALL29": { + "ecnmarkedbytes": "N/A", + "ecnmarkedpacket": "N/A", + "wreddropbytes": "N/A", + "wreddroppacket": "N/A" + }, + "MC10": { + "ecnmarkedbytes": "73", + "ecnmarkedpacket": "76", + "wreddropbytes": "63", + "wreddroppacket": "81" + }, + "MC11": { + "ecnmarkedbytes": "66", + "ecnmarkedpacket": "29", + "wreddropbytes": "16", + "wreddroppacket": "29" + }, + "MC12": { + "ecnmarkedbytes": "35", + "ecnmarkedpacket": "61", + "wreddropbytes": "12", + "wreddroppacket": "32" + }, + "MC13": { + "ecnmarkedbytes": "93", + "ecnmarkedpacket": "72", + "wreddropbytes": "17", + "wreddroppacket": "79" + }, + "MC14": { + "ecnmarkedbytes": "50", + "ecnmarkedpacket": "67", + "wreddropbytes": "21", + "wreddroppacket": "23" + }, + "MC15": { + "ecnmarkedbytes": "14", + "ecnmarkedpacket": "97", + "wreddropbytes": "10", + "wreddroppacket": "37" + }, + "MC16": { + "ecnmarkedbytes": "43", + "ecnmarkedpacket": "74", + "wreddropbytes": "17", + "wreddroppacket": "30" + }, + "MC17": { + "ecnmarkedbytes": "84", + "ecnmarkedpacket": "54", + "wreddropbytes": "63", + "wreddroppacket": "0" + }, + "MC18": { + "ecnmarkedbytes": "79", + "ecnmarkedpacket": "24", + "wreddropbytes": "88", + "wreddroppacket": "69" + }, + "MC19": { + "ecnmarkedbytes": "3", + "ecnmarkedpacket": "84", + "wreddropbytes": "12", + "wreddroppacket": "20" + }, + "UC0": { + "ecnmarkedbytes": "56", + "ecnmarkedpacket": "36", + "wreddropbytes": "5", + "wreddroppacket": "19" + }, + "UC1": { + "ecnmarkedbytes": "91", + "ecnmarkedpacket": "68", + "wreddropbytes": "17", + "wreddroppacket": "38" + }, + "UC2": { + "ecnmarkedbytes": "51", + "ecnmarkedpacket": "79", + "wreddropbytes": "65", + "wreddroppacket": "16" + }, + "UC3": { + "ecnmarkedbytes": "72", + "ecnmarkedpacket": "63", + "wreddropbytes": "97", + "wreddroppacket": "11" + }, + "UC4": { + "ecnmarkedbytes": "62", + "ecnmarkedpacket": "62", + "wreddropbytes": "89", + "wreddroppacket": "54" + }, + "UC5": { + "ecnmarkedbytes": "59", + "ecnmarkedpacket": "30", + "wreddropbytes": "84", + "wreddroppacket": "13" + }, + "UC6": { + "ecnmarkedbytes": "85", + "ecnmarkedpacket": "99", + "wreddropbytes": "67", + "wreddroppacket": "49" + }, + "UC7": { + "ecnmarkedbytes": "88", + "ecnmarkedpacket": "38", + "wreddropbytes": "63", + "wreddroppacket": "2" + }, + "UC8": { + "ecnmarkedbytes": "43", + "ecnmarkedpacket": "93", + "wreddropbytes": "82", + "wreddroppacket": "0" + }, + "UC9": { + "ecnmarkedbytes": "61", + "ecnmarkedpacket": "91", + "wreddropbytes": "17", + "wreddroppacket": "80" + } + } +}""" + +show_queue_voq_counters = """\ + Port Voq WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes +--------- ----- -------------- --------------- ---------------- ----------------- +Ethernet0 VOQ0 68 30 56 74 +Ethernet0 VOQ1 60 43 39 1 +Ethernet0 VOQ2 82 7 39 21 +Ethernet0 VOQ3 11 59 12 94 +Ethernet0 VOQ4 36 62 35 40 +Ethernet0 VOQ5 49 91 2 88 +Ethernet0 VOQ6 33 17 94 74 +Ethernet0 VOQ7 40 71 95 33 + + Port Voq WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes +--------- ----- -------------- --------------- ---------------- ----------------- +Ethernet4 VOQ0 54 8 93 78 +Ethernet4 VOQ1 83 96 74 9 +Ethernet4 VOQ2 15 60 61 31 +Ethernet4 VOQ3 45 52 82 94 +Ethernet4 VOQ4 55 88 89 52 +Ethernet4 VOQ5 14 70 95 79 +Ethernet4 VOQ6 68 60 66 81 +Ethernet4 VOQ7 63 4 48 76 + + Port Voq WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes +--------- ----- -------------- --------------- ---------------- ----------------- +Ethernet8 VOQ0 41 73 77 74 +Ethernet8 VOQ1 60 21 56 54 +Ethernet8 VOQ2 57 31 12 39 +Ethernet8 VOQ3 41 96 70 98 +Ethernet8 VOQ4 18 49 63 36 +Ethernet8 VOQ5 99 90 3 15 +Ethernet8 VOQ6 8 84 82 94 +Ethernet8 VOQ7 83 15 75 92 + +""" + +show_queue_port_voq_counters = """\ + Port Voq WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes +--------- ----- -------------- --------------- ---------------- ----------------- +Ethernet0 VOQ0 68 30 56 74 +Ethernet0 VOQ1 60 43 39 1 +Ethernet0 VOQ2 82 7 39 21 +Ethernet0 VOQ3 11 59 12 94 +Ethernet0 VOQ4 36 62 35 40 +Ethernet0 VOQ5 49 91 2 88 +Ethernet0 VOQ6 33 17 94 74 +Ethernet0 VOQ7 40 71 95 33 + +""" + +show_queue_voq_counters_json = """\ +{ + "Ethernet0": { + "VOQ0": { + "ecnmarkedbytes": "74", + "ecnmarkedpacket": "56", + "wreddropbytes": "30", + "wreddroppacket": "68" + }, + "VOQ1": { + "ecnmarkedbytes": "1", + "ecnmarkedpacket": "39", + "wreddropbytes": "43", + "wreddroppacket": "60" + }, + "VOQ2": { + "ecnmarkedbytes": "21", + "ecnmarkedpacket": "39", + "wreddropbytes": "7", + "wreddroppacket": "82" + }, + "VOQ3": { + "ecnmarkedbytes": "94", + "ecnmarkedpacket": "12", + "wreddropbytes": "59", + "wreddroppacket": "11" + }, + "VOQ4": { + "ecnmarkedbytes": "40", + "ecnmarkedpacket": "35", + "wreddropbytes": "62", + "wreddroppacket": "36" + }, + "VOQ5": { + "ecnmarkedbytes": "88", + "ecnmarkedpacket": "2", + "wreddropbytes": "91", + "wreddroppacket": "49" + }, + "VOQ6": { + "ecnmarkedbytes": "74", + "ecnmarkedpacket": "94", + "wreddropbytes": "17", + "wreddroppacket": "33" + }, + "VOQ7": { + "ecnmarkedbytes": "33", + "ecnmarkedpacket": "95", + "wreddropbytes": "71", + "wreddroppacket": "40" + } + }, + "Ethernet4": { + "VOQ0": { + "ecnmarkedbytes": "78", + "ecnmarkedpacket": "93", + "wreddropbytes": "8", + "wreddroppacket": "54" + }, + "VOQ1": { + "ecnmarkedbytes": "9", + "ecnmarkedpacket": "74", + "wreddropbytes": "96", + "wreddroppacket": "83" + }, + "VOQ2": { + "ecnmarkedbytes": "31", + "ecnmarkedpacket": "61", + "wreddropbytes": "60", + "wreddroppacket": "15" + }, + "VOQ3": { + "ecnmarkedbytes": "94", + "ecnmarkedpacket": "82", + "wreddropbytes": "52", + "wreddroppacket": "45" + }, + "VOQ4": { + "ecnmarkedbytes": "52", + "ecnmarkedpacket": "89", + "wreddropbytes": "88", + "wreddroppacket": "55" + }, + "VOQ5": { + "ecnmarkedbytes": "79", + "ecnmarkedpacket": "95", + "wreddropbytes": "70", + "wreddroppacket": "14" + }, + "VOQ6": { + "ecnmarkedbytes": "81", + "ecnmarkedpacket": "66", + "wreddropbytes": "60", + "wreddroppacket": "68" + }, + "VOQ7": { + "ecnmarkedbytes": "76", + "ecnmarkedpacket": "48", + "wreddropbytes": "4", + "wreddroppacket": "63" + } + }, + "Ethernet8": { + "VOQ0": { + "ecnmarkedbytes": "74", + "ecnmarkedpacket": "77", + "wreddropbytes": "73", + "wreddroppacket": "41" + }, + "VOQ1": { + "ecnmarkedbytes": "54", + "ecnmarkedpacket": "56", + "wreddropbytes": "21", + "wreddroppacket": "60" + }, + "VOQ2": { + "ecnmarkedbytes": "39", + "ecnmarkedpacket": "12", + "wreddropbytes": "31", + "wreddroppacket": "57" + }, + "VOQ3": { + "ecnmarkedbytes": "98", + "ecnmarkedpacket": "70", + "wreddropbytes": "96", + "wreddroppacket": "41" + }, + "VOQ4": { + "ecnmarkedbytes": "36", + "ecnmarkedpacket": "63", + "wreddropbytes": "49", + "wreddroppacket": "18" + }, + "VOQ5": { + "ecnmarkedbytes": "15", + "ecnmarkedpacket": "3", + "wreddropbytes": "90", + "wreddroppacket": "99" + }, + "VOQ6": { + "ecnmarkedbytes": "94", + "ecnmarkedpacket": "82", + "wreddropbytes": "84", + "wreddroppacket": "8" + }, + "VOQ7": { + "ecnmarkedbytes": "92", + "ecnmarkedpacket": "75", + "wreddropbytes": "15", + "wreddroppacket": "83" + } + } +}""" + +show_queue_port_voq_counters_json = """\ +{ + "Ethernet0": { + "VOQ0": { + "ecnmarkedbytes": "74", + "ecnmarkedpacket": "56", + "wreddropbytes": "30", + "wreddroppacket": "68" + }, + "VOQ1": { + "ecnmarkedbytes": "1", + "ecnmarkedpacket": "39", + "wreddropbytes": "43", + "wreddroppacket": "60" + }, + "VOQ2": { + "ecnmarkedbytes": "21", + "ecnmarkedpacket": "39", + "wreddropbytes": "7", + "wreddroppacket": "82" + }, + "VOQ3": { + "ecnmarkedbytes": "94", + "ecnmarkedpacket": "12", + "wreddropbytes": "59", + "wreddroppacket": "11" + }, + "VOQ4": { + "ecnmarkedbytes": "40", + "ecnmarkedpacket": "35", + "wreddropbytes": "62", + "wreddroppacket": "36" + }, + "VOQ5": { + "ecnmarkedbytes": "88", + "ecnmarkedpacket": "2", + "wreddropbytes": "91", + "wreddroppacket": "49" + }, + "VOQ6": { + "ecnmarkedbytes": "74", + "ecnmarkedpacket": "94", + "wreddropbytes": "17", + "wreddroppacket": "33" + }, + "VOQ7": { + "ecnmarkedbytes": "33", + "ecnmarkedpacket": "95", + "wreddropbytes": "71", + "wreddroppacket": "40" + } + } +}""" + +class TestWredQueue(object): + @classmethod + def setup_class(cls): + os.environ["PATH"] += os.pathsep + scripts_path + os.environ['UTILITIES_UNIT_TESTING'] = "2" + print("SETUP") + + def test_queue_counters(self): + runner = CliRunner() + result = runner.invoke( + show.cli.commands["queue"].commands["wredcounters"], + [] + ) + print(result.output) + assert result.exit_code == 0 + assert result.output == show_wred_queue_counters + + def test_queue_counters_port(self): + runner = CliRunner() + result = runner.invoke( + show.cli.commands["queue"].commands["wredcounters"], + ["Ethernet8"] + ) + print(result.output) + assert result.exit_code == 0 + assert result.output == show_wred_queue_counters_port + + def test_queue_counters_json(self): + runner = CliRunner() + result = runner.invoke( + show.cli.commands["queue"].commands["wredcounters"], + ["--json"] + ) + assert result.exit_code == 0 + print(result.output) + json_output = json.loads(result.output) + + # remove "time" from the output + for _, v in json_output.items(): + del v["time"] + assert json_dump(json_output) == show_queue_counters_json + + def test_queue_counters_port_json(self): + runner = CliRunner() + result = runner.invoke( + show.cli.commands["queue"].commands["wredcounters"], + ["Ethernet8 --json"] + ) + assert result.exit_code == 0 + print(result.output) + json_output = json.loads(result.output) + + # remove "time" from the output + for _, v in json_output.items(): + del v["time"] + assert json_dump(json_output) == show_queue_counters_port_json + + def test_queue_voq_counters(self): + runner = CliRunner() + result = runner.invoke( + show.cli.commands["queue"].commands["wredcounters"], + ["--voq"] + ) + print(result.output) + assert result.exit_code == 0 + assert result.output == show_queue_voq_counters + + def test_queue_port_voq_counters(self): + runner = CliRunner() + result = runner.invoke( + show.cli.commands["queue"].commands["wredcounters"], + ["Ethernet0 --voq"] + ) + print(result.output) + assert result.exit_code == 0 + assert result.output == show_queue_port_voq_counters + + def test_queue_voq_counters_json(self): + runner = CliRunner() + result = runner.invoke( + show.cli.commands["queue"].commands["wredcounters"], + ["--voq", "--json"] + ) + assert result.exit_code == 0 + print(result.output) + json_output = json.loads(result.output) + + # remove "time" from the output + for _, v in json_output.items(): + del v["time"] + print(json_dump(json_output)) + print(show_queue_voq_counters_json) + assert json_dump(json_output) == show_queue_voq_counters_json + + def test_queue_voq_counters_port_json(self): + runner = CliRunner() + result = runner.invoke( + show.cli.commands["queue"].commands["wredcounters"], + ["Ethernet0", "--voq", "--json"] + ) + assert result.exit_code == 0 + print(result.output) + json_output = json.loads(result.output) + + # remove "time" from the output + for _, v in json_output.items(): + del v["time"] + assert json_dump(json_output) == show_queue_port_voq_counters_json + + @classmethod + def teardown_class(cls): + os.environ["PATH"] = os.pathsep.join(os.environ["PATH"].split(os.pathsep)[:-1]) + os.environ['UTILITIES_UNIT_TESTING'] = "0" + print("TEARDOWN")