From: Simei Su <simei.su@intel.com>
To: yuying.zhang@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com
Cc: dev@dpdk.org, jingjing.wu@intel.com,
Simei Su <simei.su@intel.com>,
stable@dpdk.org
Subject: [PATCH] net/cpfl: fix incorrect status calculation
Date: Mon, 16 Oct 2023 16:42:00 +0800 [thread overview]
Message-ID: <20231016084200.288546-1-simei.su@intel.com> (raw)
Fix the incorrect ingress and egress packet number calculation.
Fixes: e3289d8fb63f ("net/cpfl: support basic statistics")
Cc: stable@dpdk.org
Signed-off-by: Simei Su <simei.su@intel.com>
---
drivers/net/cpfl/cpfl_ethdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c
index 189072a..75d2d22 100644
--- a/drivers/net/cpfl/cpfl_ethdev.c
+++ b/drivers/net/cpfl/cpfl_ethdev.c
@@ -313,9 +313,11 @@ cpfl_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->imissed = pstats->rx_discards;
stats->ierrors = pstats->rx_errors;
stats->oerrors = pstats->tx_errors + pstats->tx_discards;
--
2.9.5
reply other threads:[~2023-10-16 8:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231016084200.288546-1-simei.su@intel.com \
--to=simei.su@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=stable@dpdk.org \
--cc=yuying.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).