DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: dev@dpdk.org
Cc: surendra@chelsio.com, shaguna@chelsio.com, indranil@chelsio.com,
	nirranjan@chelsio.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 5/5] net/cxgbevf: add missing Tx byte counters
Date: Sat, 30 Jun 2018 00:53:55 +0530	[thread overview]
Message-ID: <05272b8b170521d01ec63c1e7d97deb5fb987dc4.1530300158.git.rahul.lakkireddy@chelsio.com> (raw)
In-Reply-To: <cover.1530300158.git.rahul.lakkireddy@chelsio.com>
In-Reply-To: <cover.1530300158.git.rahul.lakkireddy@chelsio.com>

Fixes: a0a344a8f728 ("net/cxgbe: add VF port statistics")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
---
 drivers/net/cxgbe/base/t4_regs.h   | 3 +++
 drivers/net/cxgbe/base/t4vf_hw.c   | 6 ++++++
 drivers/net/cxgbe/cxgbevf_ethdev.c | 1 +
 3 files changed, 10 insertions(+)

diff --git a/drivers/net/cxgbe/base/t4_regs.h b/drivers/net/cxgbe/base/t4_regs.h
index fd8f9cf27..0c3a76860 100644
--- a/drivers/net/cxgbe/base/t4_regs.h
+++ b/drivers/net/cxgbe/base/t4_regs.h
@@ -799,8 +799,11 @@
 #define A_MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_L 0x96b8
 #define A_MPS_STAT_RX_BG_3_LB_TRUNC_FRAME_H 0x96bc
 
+#define A_MPS_VF_STAT_TX_VF_BCAST_BYTES_L 0x80
 #define A_MPS_VF_STAT_TX_VF_BCAST_FRAMES_L 0x88
+#define A_MPS_VF_STAT_TX_VF_MCAST_BYTES_L 0x90
 #define A_MPS_VF_STAT_TX_VF_MCAST_FRAMES_L 0x98
+#define A_MPS_VF_STAT_TX_VF_UCAST_BYTES_L 0xa0
 #define A_MPS_VF_STAT_TX_VF_UCAST_FRAMES_L 0xa8
 #define A_MPS_VF_STAT_TX_VF_DROP_FRAMES_L 0xb0
 #define A_MPS_VF_STAT_RX_VF_BCAST_FRAMES_L 0xd0
diff --git a/drivers/net/cxgbe/base/t4vf_hw.c b/drivers/net/cxgbe/base/t4vf_hw.c
index 9fd0b8791..d96456bbe 100644
--- a/drivers/net/cxgbe/base/t4vf_hw.c
+++ b/drivers/net/cxgbe/base/t4vf_hw.c
@@ -683,6 +683,9 @@ static int t4vf_get_port_stats_fw(struct adapter *adapter, int pidx,
 	/*
 	 * Translate firmware statistics into host native statistics.
 	 */
+	p->tx_octets = be64_to_cpu(fwstats.tx_bcast_bytes) +
+		       be64_to_cpu(fwstats.tx_mcast_bytes) +
+		       be64_to_cpu(fwstats.tx_ucast_bytes);
 	p->tx_bcast_frames = be64_to_cpu(fwstats.tx_bcast_frames);
 	p->tx_mcast_frames = be64_to_cpu(fwstats.tx_mcast_frames);
 	p->tx_ucast_frames = be64_to_cpu(fwstats.tx_ucast_frames);
@@ -722,6 +725,9 @@ void t4vf_get_port_stats(struct adapter *adapter, int pidx,
 #define GET_STAT(name) \
 	t4_read_reg64(adapter, \
 			T4VF_MPS_BASE_ADDR + A_MPS_VF_STAT_##name##_L)
+	p->tx_octets = GET_STAT(TX_VF_BCAST_BYTES) +
+		       GET_STAT(TX_VF_MCAST_BYTES) +
+		       GET_STAT(TX_VF_UCAST_BYTES);
 	p->tx_bcast_frames = GET_STAT(TX_VF_BCAST_FRAMES);
 	p->tx_mcast_frames = GET_STAT(TX_VF_MCAST_FRAMES);
 	p->tx_ucast_frames = GET_STAT(TX_VF_UCAST_FRAMES);
diff --git a/drivers/net/cxgbe/cxgbevf_ethdev.c b/drivers/net/cxgbe/cxgbevf_ethdev.c
index b4770e0c5..3b32ca9d4 100644
--- a/drivers/net/cxgbe/cxgbevf_ethdev.c
+++ b/drivers/net/cxgbe/cxgbevf_ethdev.c
@@ -50,6 +50,7 @@ static int cxgbevf_dev_stats_get(struct rte_eth_dev *eth_dev,
 	/* TX Stats */
 	eth_stats->opackets = ps.tx_bcast_frames + ps.tx_mcast_frames +
 			      ps.tx_ucast_frames;
+	eth_stats->obytes = ps.tx_octets;
 	eth_stats->oerrors  = ps.tx_drop;
 
 	for (i = 0; i < pi->n_rx_qsets; i++) {
-- 
2.14.1

  parent reply	other threads:[~2018-06-29 19:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 19:23 [dpdk-dev] [PATCH 0/5] net/cxgbe: feature updates and bug fixes Rahul Lakkireddy
2018-06-29 19:23 ` [dpdk-dev] [PATCH 1/5] net/cxgbe: add link up and down ops Rahul Lakkireddy
2018-06-29 19:23 ` [dpdk-dev] [PATCH 2/5] net/cxgbe: enable more RSS hash functions Rahul Lakkireddy
2018-06-29 19:23 ` [dpdk-dev] [PATCH 3/5] net/cxgbe: query firmware for max queues available Rahul Lakkireddy
2018-06-29 19:23 ` [dpdk-dev] [PATCH 4/5] net/cxgbe: fix Rx channel map and queue type Rahul Lakkireddy
2018-06-29 19:23 ` Rahul Lakkireddy [this message]
2018-07-04 20:02 ` [dpdk-dev] [PATCH 0/5] net/cxgbe: feature updates and bug fixes Ferruh Yigit

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=05272b8b170521d01ec63c1e7d97deb5fb987dc4.1530300158.git.rahul.lakkireddy@chelsio.com \
    --to=rahul.lakkireddy@chelsio.com \
    --cc=dev@dpdk.org \
    --cc=indranil@chelsio.com \
    --cc=nirranjan@chelsio.com \
    --cc=shaguna@chelsio.com \
    --cc=stable@dpdk.org \
    --cc=surendra@chelsio.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).