From 737c5adcfd998db0afb5f72428268d1133474143 Mon Sep 17 00:00:00 2001 From: Neetha John Date: Wed, 7 Oct 2020 10:05:52 -0700 Subject: [PATCH] [pfcstat] Create new copies of Rx and Tx dictionaries (#1150) * Fix the issue where Rx counts were overwritten by the Tx counts Signed-off-by: Neetha John --- scripts/pfcstat | 5 +- tests/mock_tables/asic0/counters_db.json | 128 +++++++++++------------ tests/mock_tables/asic1/counters_db.json | 64 ++++++------ tests/mock_tables/counters_db.json | 96 ++++++++--------- tests/pfcstat_test.py | 52 ++++----- 5 files changed, 173 insertions(+), 172 deletions(-) diff --git a/scripts/pfcstat b/scripts/pfcstat index eff3f09cfe..4f63ac8f50 100755 --- a/scripts/pfcstat +++ b/scripts/pfcstat @@ -13,6 +13,7 @@ import datetime import os.path from collections import namedtuple, OrderedDict +from copy import deepcopy from natsort import natsorted from tabulate import tabulate @@ -253,12 +254,12 @@ Examples: """ Get the counters of pfc rx counter """ - cnstat_dict_rx = pfcstat.get_cnstat(True) + cnstat_dict_rx = deepcopy(pfcstat.get_cnstat(True)) """ Get the counters of pfc tx counter """ - cnstat_dict_tx = pfcstat.get_cnstat(False) + cnstat_dict_tx = deepcopy(pfcstat.get_cnstat(False)) # At this point, either we'll create a file or open an existing one. if not os.path.exists(cnstat_dir): diff --git a/tests/mock_tables/asic0/counters_db.json b/tests/mock_tables/asic0/counters_db.json index 3472ef9ebd..3286a0a752 100644 --- a/tests/mock_tables/asic0/counters_db.json +++ b/tests/mock_tables/asic0/counters_db.json @@ -1474,22 +1474,22 @@ "SAI_PORT_STAT_IF_IN_DISCARDS": "100", "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE": "80", "SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS": "20", - "SAI_PORT_STAT_PFC_0_RX_PKTS": "20", - "SAI_PORT_STAT_PFC_1_RX_PKTS": "21", - "SAI_PORT_STAT_PFC_2_RX_PKTS": "22", - "SAI_PORT_STAT_PFC_3_RX_PKTS": "23", - "SAI_PORT_STAT_PFC_4_RX_PKTS": "24", - "SAI_PORT_STAT_PFC_5_RX_PKTS": "25", - "SAI_PORT_STAT_PFC_6_RX_PKTS": "26", - "SAI_PORT_STAT_PFC_7_RX_PKTS": "27", - "SAI_PORT_STAT_PFC_0_TX_PKTS": "400", - "SAI_PORT_STAT_PFC_1_TX_PKTS": "201", - "SAI_PORT_STAT_PFC_2_TX_PKTS": "202", - "SAI_PORT_STAT_PFC_3_TX_PKTS": "203", - "SAI_PORT_STAT_PFC_4_TX_PKTS": "204", - "SAI_PORT_STAT_PFC_5_TX_PKTS": "205", - "SAI_PORT_STAT_PFC_6_TX_PKTS": "206", - "SAI_PORT_STAT_PFC_7_TX_PKTS": "207" + "SAI_PORT_STAT_PFC_0_RX_PKTS": "200", + "SAI_PORT_STAT_PFC_1_RX_PKTS": "201", + "SAI_PORT_STAT_PFC_2_RX_PKTS": "202", + "SAI_PORT_STAT_PFC_3_RX_PKTS": "203", + "SAI_PORT_STAT_PFC_4_RX_PKTS": "204", + "SAI_PORT_STAT_PFC_5_RX_PKTS": "205", + "SAI_PORT_STAT_PFC_6_RX_PKTS": "206", + "SAI_PORT_STAT_PFC_7_RX_PKTS": "207", + "SAI_PORT_STAT_PFC_0_TX_PKTS": "210", + "SAI_PORT_STAT_PFC_1_TX_PKTS": "211", + "SAI_PORT_STAT_PFC_2_TX_PKTS": "212", + "SAI_PORT_STAT_PFC_3_TX_PKTS": "213", + "SAI_PORT_STAT_PFC_4_TX_PKTS": "214", + "SAI_PORT_STAT_PFC_5_TX_PKTS": "215", + "SAI_PORT_STAT_PFC_6_TX_PKTS": "216", + "SAI_PORT_STAT_PFC_7_TX_PKTS": "217" }, "COUNTERS:oid:0x1000000000004": { "SAI_PORT_STAT_IF_IN_UCAST_PKTS": "4", @@ -1502,22 +1502,22 @@ "SAI_PORT_STAT_IF_IN_DISCARDS": "1000", "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE": "800", "SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS": "100", - "SAI_PORT_STAT_PFC_0_RX_PKTS": "40", - "SAI_PORT_STAT_PFC_1_RX_PKTS": "41", - "SAI_PORT_STAT_PFC_2_RX_PKTS": "42", - "SAI_PORT_STAT_PFC_3_RX_PKTS": "43", - "SAI_PORT_STAT_PFC_4_RX_PKTS": "44", - "SAI_PORT_STAT_PFC_5_RX_PKTS": "45", - "SAI_PORT_STAT_PFC_6_RX_PKTS": "46", - "SAI_PORT_STAT_PFC_7_RX_PKTS": "47", - "SAI_PORT_STAT_PFC_0_TX_PKTS": "400", - "SAI_PORT_STAT_PFC_1_TX_PKTS": "401", - "SAI_PORT_STAT_PFC_2_TX_PKTS": "402", - "SAI_PORT_STAT_PFC_3_TX_PKTS": "403", - "SAI_PORT_STAT_PFC_4_TX_PKTS": "404", - "SAI_PORT_STAT_PFC_5_TX_PKTS": "405", - "SAI_PORT_STAT_PFC_6_TX_PKTS": "406", - "SAI_PORT_STAT_PFC_7_TX_PKTS": "407" + "SAI_PORT_STAT_PFC_0_RX_PKTS": "400", + "SAI_PORT_STAT_PFC_1_RX_PKTS": "401", + "SAI_PORT_STAT_PFC_2_RX_PKTS": "402", + "SAI_PORT_STAT_PFC_3_RX_PKTS": "403", + "SAI_PORT_STAT_PFC_4_RX_PKTS": "404", + "SAI_PORT_STAT_PFC_5_RX_PKTS": "405", + "SAI_PORT_STAT_PFC_6_RX_PKTS": "406", + "SAI_PORT_STAT_PFC_7_RX_PKTS": "407", + "SAI_PORT_STAT_PFC_0_TX_PKTS": "410", + "SAI_PORT_STAT_PFC_1_TX_PKTS": "411", + "SAI_PORT_STAT_PFC_2_TX_PKTS": "412", + "SAI_PORT_STAT_PFC_3_TX_PKTS": "413", + "SAI_PORT_STAT_PFC_4_TX_PKTS": "414", + "SAI_PORT_STAT_PFC_5_TX_PKTS": "415", + "SAI_PORT_STAT_PFC_6_TX_PKTS": "416", + "SAI_PORT_STAT_PFC_7_TX_PKTS": "417" }, "COUNTERS:oid:0x1000000000006": { "SAI_PORT_STAT_IF_IN_UCAST_PKTS": "6", @@ -1530,22 +1530,22 @@ "SAI_PORT_STAT_IF_IN_DISCARDS": "1000", "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE": "800", "SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS": "100", - "SAI_PORT_STAT_PFC_0_RX_PKTS": "60", - "SAI_PORT_STAT_PFC_1_RX_PKTS": "61", - "SAI_PORT_STAT_PFC_2_RX_PKTS": "62", - "SAI_PORT_STAT_PFC_3_RX_PKTS": "63", - "SAI_PORT_STAT_PFC_4_RX_PKTS": "64", - "SAI_PORT_STAT_PFC_5_RX_PKTS": "65", - "SAI_PORT_STAT_PFC_6_RX_PKTS": "66", - "SAI_PORT_STAT_PFC_7_RX_PKTS": "67", - "SAI_PORT_STAT_PFC_0_TX_PKTS": "600", - "SAI_PORT_STAT_PFC_1_TX_PKTS": "601", - "SAI_PORT_STAT_PFC_2_TX_PKTS": "602", - "SAI_PORT_STAT_PFC_3_TX_PKTS": "603", - "SAI_PORT_STAT_PFC_4_TX_PKTS": "604", - "SAI_PORT_STAT_PFC_5_TX_PKTS": "605", - "SAI_PORT_STAT_PFC_6_TX_PKTS": "606", - "SAI_PORT_STAT_PFC_7_TX_PKTS": "607" + "SAI_PORT_STAT_PFC_0_RX_PKTS": "600", + "SAI_PORT_STAT_PFC_1_RX_PKTS": "601", + "SAI_PORT_STAT_PFC_2_RX_PKTS": "602", + "SAI_PORT_STAT_PFC_3_RX_PKTS": "603", + "SAI_PORT_STAT_PFC_4_RX_PKTS": "604", + "SAI_PORT_STAT_PFC_5_RX_PKTS": "605", + "SAI_PORT_STAT_PFC_6_RX_PKTS": "606", + "SAI_PORT_STAT_PFC_7_RX_PKTS": "607", + "SAI_PORT_STAT_PFC_0_TX_PKTS": "610", + "SAI_PORT_STAT_PFC_1_TX_PKTS": "611", + "SAI_PORT_STAT_PFC_2_TX_PKTS": "612", + "SAI_PORT_STAT_PFC_3_TX_PKTS": "613", + "SAI_PORT_STAT_PFC_4_TX_PKTS": "614", + "SAI_PORT_STAT_PFC_5_TX_PKTS": "615", + "SAI_PORT_STAT_PFC_6_TX_PKTS": "616", + "SAI_PORT_STAT_PFC_7_TX_PKTS": "617" }, "COUNTERS:oid:0x1000000000008": { "SAI_PORT_STAT_IF_IN_UCAST_PKTS": "8", @@ -1558,22 +1558,22 @@ "SAI_PORT_STAT_IF_IN_DISCARDS": "1000", "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE": "800", "SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS": "100", - "SAI_PORT_STAT_PFC_0_RX_PKTS": "80", - "SAI_PORT_STAT_PFC_1_RX_PKTS": "81", - "SAI_PORT_STAT_PFC_2_RX_PKTS": "82", - "SAI_PORT_STAT_PFC_3_RX_PKTS": "83", - "SAI_PORT_STAT_PFC_4_RX_PKTS": "84", - "SAI_PORT_STAT_PFC_5_RX_PKTS": "85", - "SAI_PORT_STAT_PFC_6_RX_PKTS": "86", - "SAI_PORT_STAT_PFC_7_RX_PKTS": "87", - "SAI_PORT_STAT_PFC_0_TX_PKTS": "800", - "SAI_PORT_STAT_PFC_1_TX_PKTS": "801", - "SAI_PORT_STAT_PFC_2_TX_PKTS": "802", - "SAI_PORT_STAT_PFC_3_TX_PKTS": "803", - "SAI_PORT_STAT_PFC_4_TX_PKTS": "804", - "SAI_PORT_STAT_PFC_5_TX_PKTS": "805", - "SAI_PORT_STAT_PFC_6_TX_PKTS": "806", - "SAI_PORT_STAT_PFC_7_TX_PKTS": "807" + "SAI_PORT_STAT_PFC_0_RX_PKTS": "800", + "SAI_PORT_STAT_PFC_1_RX_PKTS": "801", + "SAI_PORT_STAT_PFC_2_RX_PKTS": "802", + "SAI_PORT_STAT_PFC_3_RX_PKTS": "803", + "SAI_PORT_STAT_PFC_4_RX_PKTS": "804", + "SAI_PORT_STAT_PFC_5_RX_PKTS": "805", + "SAI_PORT_STAT_PFC_6_RX_PKTS": "806", + "SAI_PORT_STAT_PFC_7_RX_PKTS": "807", + "SAI_PORT_STAT_PFC_0_TX_PKTS": "810", + "SAI_PORT_STAT_PFC_1_TX_PKTS": "811", + "SAI_PORT_STAT_PFC_2_TX_PKTS": "812", + "SAI_PORT_STAT_PFC_3_TX_PKTS": "813", + "SAI_PORT_STAT_PFC_4_TX_PKTS": "814", + "SAI_PORT_STAT_PFC_5_TX_PKTS": "815", + "SAI_PORT_STAT_PFC_6_TX_PKTS": "816", + "SAI_PORT_STAT_PFC_7_TX_PKTS": "817" }, "COUNTERS:oid:0x21000000000000": { "SAI_SWITCH_STAT_IN_DROP_REASON_RANGE_BASE": "1000" diff --git a/tests/mock_tables/asic1/counters_db.json b/tests/mock_tables/asic1/counters_db.json index 588651560f..111912867f 100644 --- a/tests/mock_tables/asic1/counters_db.json +++ b/tests/mock_tables/asic1/counters_db.json @@ -130,22 +130,22 @@ "SAI_PORT_STAT_IF_IN_DISCARDS": "100", "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE": "80", "SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS": "20", - "SAI_PORT_STAT_PFC_0_RX_PKTS": "20", - "SAI_PORT_STAT_PFC_1_RX_PKTS": "21", - "SAI_PORT_STAT_PFC_2_RX_PKTS": "22", - "SAI_PORT_STAT_PFC_3_RX_PKTS": "23", - "SAI_PORT_STAT_PFC_4_RX_PKTS": "24", - "SAI_PORT_STAT_PFC_5_RX_PKTS": "25", - "SAI_PORT_STAT_PFC_6_RX_PKTS": "26", - "SAI_PORT_STAT_PFC_7_RX_PKTS": "27", - "SAI_PORT_STAT_PFC_0_TX_PKTS": "400", - "SAI_PORT_STAT_PFC_1_TX_PKTS": "201", - "SAI_PORT_STAT_PFC_2_TX_PKTS": "202", - "SAI_PORT_STAT_PFC_3_TX_PKTS": "203", - "SAI_PORT_STAT_PFC_4_TX_PKTS": "204", - "SAI_PORT_STAT_PFC_5_TX_PKTS": "205", - "SAI_PORT_STAT_PFC_6_TX_PKTS": "206", - "SAI_PORT_STAT_PFC_7_TX_PKTS": "207" + "SAI_PORT_STAT_PFC_0_RX_PKTS": "900", + "SAI_PORT_STAT_PFC_1_RX_PKTS": "901", + "SAI_PORT_STAT_PFC_2_RX_PKTS": "902", + "SAI_PORT_STAT_PFC_3_RX_PKTS": "903", + "SAI_PORT_STAT_PFC_4_RX_PKTS": "904", + "SAI_PORT_STAT_PFC_5_RX_PKTS": "905", + "SAI_PORT_STAT_PFC_6_RX_PKTS": "906", + "SAI_PORT_STAT_PFC_7_RX_PKTS": "907", + "SAI_PORT_STAT_PFC_0_TX_PKTS": "910", + "SAI_PORT_STAT_PFC_1_TX_PKTS": "911", + "SAI_PORT_STAT_PFC_2_TX_PKTS": "912", + "SAI_PORT_STAT_PFC_3_TX_PKTS": "913", + "SAI_PORT_STAT_PFC_4_TX_PKTS": "914", + "SAI_PORT_STAT_PFC_5_TX_PKTS": "915", + "SAI_PORT_STAT_PFC_6_TX_PKTS": "916", + "SAI_PORT_STAT_PFC_7_TX_PKTS": "917" }, "COUNTERS:oid:0x1000000000b08": { "SAI_PORT_STAT_IF_IN_UCAST_PKTS": "4", @@ -158,22 +158,22 @@ "SAI_PORT_STAT_IF_IN_DISCARDS": "1000", "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE": "800", "SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS": "100", - "SAI_PORT_STAT_PFC_0_RX_PKTS": "40", - "SAI_PORT_STAT_PFC_1_RX_PKTS": "41", - "SAI_PORT_STAT_PFC_2_RX_PKTS": "42", - "SAI_PORT_STAT_PFC_3_RX_PKTS": "43", - "SAI_PORT_STAT_PFC_4_RX_PKTS": "44", - "SAI_PORT_STAT_PFC_5_RX_PKTS": "45", - "SAI_PORT_STAT_PFC_6_RX_PKTS": "46", - "SAI_PORT_STAT_PFC_7_RX_PKTS": "47", - "SAI_PORT_STAT_PFC_0_TX_PKTS": "400", - "SAI_PORT_STAT_PFC_1_TX_PKTS": "401", - "SAI_PORT_STAT_PFC_2_TX_PKTS": "402", - "SAI_PORT_STAT_PFC_3_TX_PKTS": "403", - "SAI_PORT_STAT_PFC_4_TX_PKTS": "404", - "SAI_PORT_STAT_PFC_5_TX_PKTS": "405", - "SAI_PORT_STAT_PFC_6_TX_PKTS": "406", - "SAI_PORT_STAT_PFC_7_TX_PKTS": "407" + "SAI_PORT_STAT_PFC_0_RX_PKTS": "100", + "SAI_PORT_STAT_PFC_1_RX_PKTS": "101", + "SAI_PORT_STAT_PFC_2_RX_PKTS": "102", + "SAI_PORT_STAT_PFC_3_RX_PKTS": "103", + "SAI_PORT_STAT_PFC_4_RX_PKTS": "104", + "SAI_PORT_STAT_PFC_5_RX_PKTS": "105", + "SAI_PORT_STAT_PFC_6_RX_PKTS": "106", + "SAI_PORT_STAT_PFC_7_RX_PKTS": "107", + "SAI_PORT_STAT_PFC_0_TX_PKTS": "110", + "SAI_PORT_STAT_PFC_1_TX_PKTS": "111", + "SAI_PORT_STAT_PFC_2_TX_PKTS": "112", + "SAI_PORT_STAT_PFC_3_TX_PKTS": "113", + "SAI_PORT_STAT_PFC_4_TX_PKTS": "114", + "SAI_PORT_STAT_PFC_5_TX_PKTS": "115", + "SAI_PORT_STAT_PFC_6_TX_PKTS": "116", + "SAI_PORT_STAT_PFC_7_TX_PKTS": "117" }, "COUNTERS:oid:0x21000000000000": { "SAI_SWITCH_STAT_IN_DROP_REASON_RANGE_BASE": "1000" diff --git a/tests/mock_tables/counters_db.json b/tests/mock_tables/counters_db.json index 7c616ca500..1411e667e3 100644 --- a/tests/mock_tables/counters_db.json +++ b/tests/mock_tables/counters_db.json @@ -130,22 +130,22 @@ "SAI_PORT_STAT_IF_IN_DISCARDS": "100", "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE": "80", "SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS": "20", - "SAI_PORT_STAT_PFC_0_RX_PKTS": "0", - "SAI_PORT_STAT_PFC_1_RX_PKTS": "0", - "SAI_PORT_STAT_PFC_2_RX_PKTS": "0", - "SAI_PORT_STAT_PFC_3_RX_PKTS": "0", - "SAI_PORT_STAT_PFC_4_RX_PKTS": "0", - "SAI_PORT_STAT_PFC_5_RX_PKTS": "0", - "SAI_PORT_STAT_PFC_6_RX_PKTS": "0", - "SAI_PORT_STAT_PFC_7_RX_PKTS": "0", - "SAI_PORT_STAT_PFC_0_TX_PKTS": "0", - "SAI_PORT_STAT_PFC_1_TX_PKTS": "0", - "SAI_PORT_STAT_PFC_2_TX_PKTS": "0", - "SAI_PORT_STAT_PFC_3_TX_PKTS": "0", - "SAI_PORT_STAT_PFC_4_TX_PKTS": "0", - "SAI_PORT_STAT_PFC_5_TX_PKTS": "0", - "SAI_PORT_STAT_PFC_6_TX_PKTS": "0", - "SAI_PORT_STAT_PFC_7_TX_PKTS": "0" + "SAI_PORT_STAT_PFC_0_RX_PKTS": "200", + "SAI_PORT_STAT_PFC_1_RX_PKTS": "201", + "SAI_PORT_STAT_PFC_2_RX_PKTS": "202", + "SAI_PORT_STAT_PFC_3_RX_PKTS": "203", + "SAI_PORT_STAT_PFC_4_RX_PKTS": "204", + "SAI_PORT_STAT_PFC_5_RX_PKTS": "205", + "SAI_PORT_STAT_PFC_6_RX_PKTS": "206", + "SAI_PORT_STAT_PFC_7_RX_PKTS": "207", + "SAI_PORT_STAT_PFC_0_TX_PKTS": "210", + "SAI_PORT_STAT_PFC_1_TX_PKTS": "211", + "SAI_PORT_STAT_PFC_2_TX_PKTS": "212", + "SAI_PORT_STAT_PFC_3_TX_PKTS": "213", + "SAI_PORT_STAT_PFC_4_TX_PKTS": "214", + "SAI_PORT_STAT_PFC_5_TX_PKTS": "215", + "SAI_PORT_STAT_PFC_6_TX_PKTS": "216", + "SAI_PORT_STAT_PFC_7_TX_PKTS": "217" }, "COUNTERS:oid:0x1000000000004": { "SAI_PORT_STAT_IF_IN_UCAST_PKTS": "4", @@ -158,22 +158,22 @@ "SAI_PORT_STAT_IF_IN_DISCARDS": "1000", "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE": "800", "SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS": "100", - "SAI_PORT_STAT_PFC_0_RX_PKTS": "40", - "SAI_PORT_STAT_PFC_1_RX_PKTS": "41", - "SAI_PORT_STAT_PFC_2_RX_PKTS": "42", - "SAI_PORT_STAT_PFC_3_RX_PKTS": "43", - "SAI_PORT_STAT_PFC_4_RX_PKTS": "44", - "SAI_PORT_STAT_PFC_5_RX_PKTS": "45", - "SAI_PORT_STAT_PFC_6_RX_PKTS": "46", - "SAI_PORT_STAT_PFC_7_RX_PKTS": "47", - "SAI_PORT_STAT_PFC_0_TX_PKTS": "400", - "SAI_PORT_STAT_PFC_1_TX_PKTS": "401", - "SAI_PORT_STAT_PFC_2_TX_PKTS": "402", - "SAI_PORT_STAT_PFC_3_TX_PKTS": "403", - "SAI_PORT_STAT_PFC_4_TX_PKTS": "404", - "SAI_PORT_STAT_PFC_5_TX_PKTS": "405", - "SAI_PORT_STAT_PFC_6_TX_PKTS": "406", - "SAI_PORT_STAT_PFC_7_TX_PKTS": "407" + "SAI_PORT_STAT_PFC_0_RX_PKTS": "400", + "SAI_PORT_STAT_PFC_1_RX_PKTS": "401", + "SAI_PORT_STAT_PFC_2_RX_PKTS": "402", + "SAI_PORT_STAT_PFC_3_RX_PKTS": "403", + "SAI_PORT_STAT_PFC_4_RX_PKTS": "404", + "SAI_PORT_STAT_PFC_5_RX_PKTS": "405", + "SAI_PORT_STAT_PFC_6_RX_PKTS": "406", + "SAI_PORT_STAT_PFC_7_RX_PKTS": "407", + "SAI_PORT_STAT_PFC_0_TX_PKTS": "410", + "SAI_PORT_STAT_PFC_1_TX_PKTS": "411", + "SAI_PORT_STAT_PFC_2_TX_PKTS": "412", + "SAI_PORT_STAT_PFC_3_TX_PKTS": "413", + "SAI_PORT_STAT_PFC_4_TX_PKTS": "414", + "SAI_PORT_STAT_PFC_5_TX_PKTS": "415", + "SAI_PORT_STAT_PFC_6_TX_PKTS": "416", + "SAI_PORT_STAT_PFC_7_TX_PKTS": "417" }, "COUNTERS:oid:0x1000000000006": { "SAI_PORT_STAT_IF_IN_UCAST_PKTS": "6", @@ -186,22 +186,22 @@ "SAI_PORT_STAT_IF_IN_DISCARDS": "10", "SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE": "10", "SAI_PORT_STAT_OUT_CONFIGURED_DROP_REASONS_1_DROPPED_PKTS": "0", - "SAI_PORT_STAT_PFC_0_RX_PKTS": "80", - "SAI_PORT_STAT_PFC_1_RX_PKTS": "81", - "SAI_PORT_STAT_PFC_2_RX_PKTS": "82", - "SAI_PORT_STAT_PFC_3_RX_PKTS": "83", - "SAI_PORT_STAT_PFC_4_RX_PKTS": "84", - "SAI_PORT_STAT_PFC_5_RX_PKTS": "85", - "SAI_PORT_STAT_PFC_6_RX_PKTS": "86", - "SAI_PORT_STAT_PFC_7_RX_PKTS": "87", - "SAI_PORT_STAT_PFC_0_TX_PKTS": "800", - "SAI_PORT_STAT_PFC_1_TX_PKTS": "801", - "SAI_PORT_STAT_PFC_2_TX_PKTS": "802", - "SAI_PORT_STAT_PFC_3_TX_PKTS": "803", - "SAI_PORT_STAT_PFC_4_TX_PKTS": "804", - "SAI_PORT_STAT_PFC_5_TX_PKTS": "805", - "SAI_PORT_STAT_PFC_6_TX_PKTS": "806", - "SAI_PORT_STAT_PFC_7_TX_PKTS": "807" + "SAI_PORT_STAT_PFC_0_RX_PKTS": "800", + "SAI_PORT_STAT_PFC_1_RX_PKTS": "801", + "SAI_PORT_STAT_PFC_2_RX_PKTS": "802", + "SAI_PORT_STAT_PFC_3_RX_PKTS": "803", + "SAI_PORT_STAT_PFC_4_RX_PKTS": "804", + "SAI_PORT_STAT_PFC_5_RX_PKTS": "805", + "SAI_PORT_STAT_PFC_6_RX_PKTS": "806", + "SAI_PORT_STAT_PFC_7_RX_PKTS": "807", + "SAI_PORT_STAT_PFC_0_TX_PKTS": "810", + "SAI_PORT_STAT_PFC_1_TX_PKTS": "811", + "SAI_PORT_STAT_PFC_2_TX_PKTS": "812", + "SAI_PORT_STAT_PFC_3_TX_PKTS": "813", + "SAI_PORT_STAT_PFC_4_TX_PKTS": "814", + "SAI_PORT_STAT_PFC_5_TX_PKTS": "815", + "SAI_PORT_STAT_PFC_6_TX_PKTS": "816", + "SAI_PORT_STAT_PFC_7_TX_PKTS": "817" }, "COUNTERS:oid:0x21000000000000": { "SAI_SWITCH_STAT_OUT_DROP_REASON_RANGE_BASE": "1000", diff --git a/tests/pfcstat_test.py b/tests/pfcstat_test.py index 470d87f990..6b0e556e06 100644 --- a/tests/pfcstat_test.py +++ b/tests/pfcstat_test.py @@ -16,15 +16,15 @@ show_pfc_counters_output = """\ Port Rx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 --------- ------ ------ ------ ------ ------ ------ ------ ------ -Ethernet0 0 0 0 0 0 0 0 0 +Ethernet0 200 201 202 203 204 205 206 207 Ethernet4 400 401 402 403 404 405 406 407 Ethernet8 800 801 802 803 804 805 806 807 Port Tx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 --------- ------ ------ ------ ------ ------ ------ ------ ------ -Ethernet0 0 0 0 0 0 0 0 0 -Ethernet4 400 401 402 403 404 405 406 407 -Ethernet8 800 801 802 803 804 805 806 807 +Ethernet0 210 211 212 213 214 215 216 217 +Ethernet4 410 411 412 413 414 415 416 417 +Ethernet8 810 811 812 813 814 815 816 817 """ show_pfc_counters_output_diff = """\ @@ -44,7 +44,7 @@ show_pfc_counters_all = """\ Port Rx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 -------------- ------ ------ ------ ------ ------ ------ ------ ------ - Ethernet0 400 201 202 203 204 205 206 207 + Ethernet0 200 201 202 203 204 205 206 207 Ethernet4 400 401 402 403 404 405 406 407 Ethernet-BP0 600 601 602 603 604 605 606 607 Ethernet-BP4 800 801 802 803 804 805 806 807 @@ -53,10 +53,10 @@ Port Tx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 -------------- ------ ------ ------ ------ ------ ------ ------ ------ - Ethernet0 400 201 202 203 204 205 206 207 - Ethernet4 400 401 402 403 404 405 406 407 - Ethernet-BP0 600 601 602 603 604 605 606 607 - Ethernet-BP4 800 801 802 803 804 805 806 807 + Ethernet0 210 211 212 213 214 215 216 217 + Ethernet4 410 411 412 413 414 415 416 417 + Ethernet-BP0 610 611 612 613 614 615 616 617 + Ethernet-BP4 810 811 812 813 814 815 816 817 Ethernet-BP256 N/A N/A N/A N/A N/A N/A N/A N/A Ethernet-BP260 N/A N/A N/A N/A N/A N/A N/A N/A """ @@ -64,48 +64,48 @@ show_pfc_counters_all_asic = """\ Port Rx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 ------------ ------ ------ ------ ------ ------ ------ ------ ------ - Ethernet0 400 201 202 203 204 205 206 207 + Ethernet0 200 201 202 203 204 205 206 207 Ethernet4 400 401 402 403 404 405 406 407 Ethernet-BP0 600 601 602 603 604 605 606 607 Ethernet-BP4 800 801 802 803 804 805 806 807 Port Tx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 ------------ ------ ------ ------ ------ ------ ------ ------ ------ - Ethernet0 400 201 202 203 204 205 206 207 - Ethernet4 400 401 402 403 404 405 406 407 -Ethernet-BP0 600 601 602 603 604 605 606 607 -Ethernet-BP4 800 801 802 803 804 805 806 807 + Ethernet0 210 211 212 213 214 215 216 217 + Ethernet4 410 411 412 413 414 415 416 417 +Ethernet-BP0 610 611 612 613 614 615 616 617 +Ethernet-BP4 810 811 812 813 814 815 816 817 """ show_pfc_counters_all = """\ Port Rx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 -------------- ------ ------ ------ ------ ------ ------ ------ ------ - Ethernet0 400 201 202 203 204 205 206 207 + Ethernet0 200 201 202 203 204 205 206 207 Ethernet4 400 401 402 403 404 405 406 407 Ethernet-BP0 600 601 602 603 604 605 606 607 Ethernet-BP4 800 801 802 803 804 805 806 807 -Ethernet-BP256 400 201 202 203 204 205 206 207 -Ethernet-BP260 400 401 402 403 404 405 406 407 +Ethernet-BP256 900 901 902 903 904 905 906 907 +Ethernet-BP260 100 101 102 103 104 105 106 107 Port Tx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 -------------- ------ ------ ------ ------ ------ ------ ------ ------ - Ethernet0 400 201 202 203 204 205 206 207 - Ethernet4 400 401 402 403 404 405 406 407 - Ethernet-BP0 600 601 602 603 604 605 606 607 - Ethernet-BP4 800 801 802 803 804 805 806 807 -Ethernet-BP256 400 201 202 203 204 205 206 207 -Ethernet-BP260 400 401 402 403 404 405 406 407 + Ethernet0 210 211 212 213 214 215 216 217 + Ethernet4 410 411 412 413 414 415 416 417 + Ethernet-BP0 610 611 612 613 614 615 616 617 + Ethernet-BP4 810 811 812 813 814 815 816 817 +Ethernet-BP256 910 911 912 913 914 915 916 917 +Ethernet-BP260 110 111 112 113 114 115 116 117 """ show_pfc_counters_asic0_frontend = """\ Port Rx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 --------- ------ ------ ------ ------ ------ ------ ------ ------ -Ethernet0 400 201 202 203 204 205 206 207 +Ethernet0 200 201 202 203 204 205 206 207 Ethernet4 400 401 402 403 404 405 406 407 Port Tx PFC0 PFC1 PFC2 PFC3 PFC4 PFC5 PFC6 PFC7 --------- ------ ------ ------ ------ ------ ------ ------ ------ -Ethernet0 400 201 202 203 204 205 206 207 -Ethernet4 400 401 402 403 404 405 406 407 +Ethernet0 210 211 212 213 214 215 216 217 +Ethernet4 410 411 412 413 414 415 416 417 """ show_pfc_counters_msaic_output_diff = """\