Skip to content

Commit

Permalink
Fix PFC counters TX/RX (sonic-net#89)
Browse files Browse the repository at this point in the history
Signed-off-by: Qi Luo <[email protected]>
  • Loading branch information
qiluo-msft authored and lguohan committed Sep 27, 2018
1 parent 7383cd5 commit 8a628a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/sonic_ax_impl/mibs/vendor/cisco/ciscoPfcExtMIB.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def cpfc_if_requests(self, sub_id):
if oid is None:
return None

counter_name = 'SAI_PORT_STAT_PFC_3_RX_PKTS'
# BUG: need the sum of all the priorities
counter_name = 'SAI_PORT_STAT_PFC_3_TX_PKTS'

if oid in self.oid_lag_name_map:
counter_value = 0
Expand All @@ -131,7 +132,8 @@ def cpfc_if_indications(self, sub_id):
if oid is None:
return None

counter_name = 'SAI_PORT_STAT_PFC_3_TX_PKTS'
# BUG: need the sum of all the priorities
counter_name = 'SAI_PORT_STAT_PFC_3_RX_PKTS'

if oid in self.oid_lag_name_map:
counter_value = 0
Expand Down Expand Up @@ -203,7 +205,7 @@ def requests_per_priority(self, sub_id):
mibs.logger.warning("requestsPerPriority: incorrect sub_id = {} error: {}".format(str(sub_id), e))
return None

counter_name = 'SAI_PORT_STAT_PFC_' + str(queue_index) + '_RX_PKTS'
counter_name = 'SAI_PORT_STAT_PFC_' + str(queue_index) + '_TX_PKTS'

if port_oid in self.oid_lag_name_map:
counter_value = 0
Expand Down Expand Up @@ -233,7 +235,7 @@ def indications_per_priority(self, sub_id):
mibs.logger.warning("indicationsPerPriority: incorrect sub_id = {}".format(str(sub_id)))
return None

counter_name = 'SAI_PORT_STAT_PFC_' + str(queue_index) + '_TX_PKTS'
counter_name = 'SAI_PORT_STAT_PFC_' + str(queue_index) + '_RX_PKTS'

if port_oid in self.oid_lag_name_map:
counter_value = 0
Expand Down
4 changes: 2 additions & 2 deletions tests/mock_tables/counters_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1104,8 +1104,8 @@
"SAI_PORT_STAT_IF_IN_MULTICAST_PKTS": "0",
"SAI_PORT_STAT_PAUSE_RX_PKTS": "0",
"SAI_PORT_STAT_PAUSE_TX_PKTS": "0",
"SAI_PORT_STAT_PFC_0_RX_PKTS": "209347219842134092490",
"SAI_PORT_STAT_PFC_0_TX_PKTS": "1",
"SAI_PORT_STAT_PFC_0_RX_PKTS": "1",
"SAI_PORT_STAT_PFC_0_TX_PKTS": "209347219842134092490",
"SAI_PORT_STAT_PFC_1_RX_PKTS": "2",
"SAI_PORT_STAT_PFC_1_TX_PKTS": "2",
"SAI_PORT_STAT_PFC_2_RX_PKTS": "3",
Expand Down

0 comments on commit 8a628a5

Please sign in to comment.