[PATCH v4 04/16] net/cnxk: fix Tx drops added to Rx queue errors

Stephen Hemminger <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>
q_errors counts received packets dropped, and is reported as the
rx_qN_errors xstat. The Tx branch assigns the Tx drop count and the Rx
branch adds to it, so rx_qN_errors reports both. Stat indexes with only
a Tx mapping hold Tx drops alone.

Tx drops are already counted in oerrors, so drop the assignment and
store the Rx drop count directly.

Fixes: 58ae74244c90 ("ethdev: remove queue stats from basic stats structure")
Cc: [email protected]

Signed-off-by: Stephen Hemminger <[email protected]>
---
 drivers/net/cnxk/cnxk_stats.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/cnxk/cnxk_stats.c b/drivers/net/cnxk/cnxk_stats.c
index d57659ef51..6c812bd732 100644
--- a/drivers/net/cnxk/cnxk_stats.c
+++ b/drivers/net/cnxk/cnxk_stats.c
@@ -45,7 +45,6 @@ cnxk_nix_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats,
 					goto exit;
 				qstats->q_opackets[i] = qstats_data.tx_pkts;
 				qstats->q_obytes[i] = qstats_data.tx_octs;
-				qstats->q_errors[i] = qstats_data.tx_drop_pkts;
 			}
 
 			if (dev->rxq_stat_map[i] & (1U << 31)) {
@@ -55,7 +54,7 @@ cnxk_nix_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats,
 					goto exit;
 				qstats->q_ipackets[i] = qstats_data.rx_pkts;
 				qstats->q_ibytes[i] = qstats_data.rx_octs;
-				qstats->q_errors[i] += qstats_data.rx_drop_pkts;
+				qstats->q_errors[i] = qstats_data.rx_drop_pkts;
 			}
 		}
 	}
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.