patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] net/idpf: fix incorrect status calculation
@ 2023-10-16  8:41 Simei Su
  0 siblings, 0 replies; only message in thread
From: Simei Su @ 2023-10-16  8:41 UTC (permalink / raw)
  To: jingjing.wu, beilei.xing, qi.z.zhang; +Cc: dev, yuying.zhang, Simei Su, stable

Fix the incorrect ingress and egress packet number calculation.

Fixes: 7514d76d407b ("net/idpf: add basic statistics")
Cc: stable@dpdk.org

Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/net/idpf/idpf_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index 3af7cf0..d716e57 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -281,9 +281,11 @@ idpf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 		idpf_vport_stats_update(&vport->eth_stats_offset, pstats);
 		stats->ipackets = pstats->rx_unicast + pstats->rx_multicast +
-				pstats->rx_broadcast - pstats->rx_discards;
+				pstats->rx_broadcast + pstats->rx_discards +
+				pstats->rx_errors + pstats->rx_unknown_protocol;
 		stats->opackets = pstats->tx_broadcast + pstats->tx_multicast +
-						pstats->tx_unicast;
+				pstats->tx_unicast + pstats->tx_discards +
+				pstats->tx_errors;
 		stats->ierrors = pstats->rx_errors;
 		stats->imissed = pstats->rx_discards;
 		stats->oerrors = pstats->tx_errors + pstats->tx_discards;
-- 
2.9.5


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-16  8:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16  8:41 [PATCH] net/idpf: fix incorrect status calculation Simei Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).