From: Rasesh Mody <rasesh.mody@qlogic.com>
To: <dev@dpdk.org>
Cc: <ameen.rahman@qlogic.com>, Rasesh Mody <rasesh.mody@qlogic.com>,
Harish Patil <harish.patil@qlogic.com>
Subject: [dpdk-dev] [PATCH v2 3/4] bnx2x: Enhance stats get routine
Date: Thu, 31 Mar 2016 17:15:24 -0700 [thread overview]
Message-ID: <1459469725-3333-3-git-send-email-rasesh.mody@qlogic.com> (raw)
In-Reply-To: <1459469725-3333-1-git-send-email-rasesh.mody@qlogic.com>
Enhance the stats_get() routine to display drop counters under the
control of a debug flag.
Fix RX stats.
Signed-off-by: Harish Patil <harish.patil@qlogic.com>
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
drivers/net/bnx2x/bnx2x_ethdev.c | 53 ++++++++++++++++++++++++++++++++++++++
drivers/net/bnx2x/bnx2x_rxtx.c | 2 ++
2 files changed, 55 insertions(+)
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index 7e5be08..019dc66 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -276,6 +276,17 @@ static void
bnx2x_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
{
struct bnx2x_softc *sc = dev->data->dev_private;
+ uint32_t brb_truncate_discard;
+ uint64_t brb_drops;
+ uint64_t brb_truncates;
+#ifdef RTE_LIBRTE_BNX2X_DEBUG
+ uint32_t mf_tag_discard;
+ uint32_t mac_filter_discard;
+ uint64_t rx_pause;
+ uint64_t tx_pause;
+ uint64_t rx_pfc;
+ uint64_t tx_pfc;
+#endif
PMD_INIT_FUNC_TRACE();
@@ -316,6 +327,48 @@ bnx2x_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
stats->rx_nombuf =
HILO_U64(sc->eth_stats.no_buff_discard_hi,
sc->eth_stats.no_buff_discard_lo);
+ brb_drops =
+ HILO_U64(sc->eth_stats.brb_drop_hi,
+ sc->eth_stats.brb_drop_lo);
+
+ brb_truncates =
+ HILO_U64(sc->eth_stats.brb_truncate_hi,
+ sc->eth_stats.brb_truncate_lo);
+
+ brb_truncate_discard = sc->eth_stats.brb_truncate_discard;
+
+ stats->imissed = brb_drops + brb_truncates +
+ brb_truncate_discard + stats->rx_nombuf;
+
+#ifdef RTE_LIBRTE_BNX2X_DEBUG
+ mac_filter_discard = sc->eth_stats.mac_filter_discard;
+
+ mf_tag_discard = sc->eth_stats.mf_tag_discard;
+
+ tx_pause = HILO_U64(sc->eth_stats.pause_frames_sent_hi,
+ sc->eth_stats.pause_frames_sent_lo);
+
+ rx_pause = HILO_U64(sc->eth_stats.pause_frames_received_hi,
+ sc->eth_stats.pause_frames_received_lo);
+
+ tx_pfc = HILO_U64(sc->eth_stats.pfc_frames_sent_hi,
+ sc->eth_stats.pfc_frames_sent_lo);
+
+ rx_pfc = HILO_U64(sc->eth_stats.pfc_frames_received_hi,
+ sc->eth_stats.pfc_frames_received_lo);
+
+ PMD_DRV_LOG(DEBUG, "port=%u, nobuff=%"PRIu64", brb_drops=%"PRIu64""
+ "brb_truncates=%"PRIu64", brb_truncate_discard=%"PRIu32""
+ "mac_filter_discard=%"PRIu32", mf_tag_discard=%"PRIu32"",
+ dev->data->port_id, stats->rx_nombuf, brb_drops,
+ brb_truncates, brb_truncate_discard,
+ mac_filter_discard, mf_tag_discard);
+
+ PMD_DRV_LOG(DEBUG, "port=%u, rx_pause=%"PRIu64", tx_pause=%"PRIu64""
+ "rx_pfc=%"PRIu64", tx_pfc=%"PRIu64"",
+ dev->data->port_id, rx_pause, tx_pause,
+ rx_pfc, tx_pfc);
+#endif
}
static void
diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c
index 8b047d4..60bd08b 100644
--- a/drivers/net/bnx2x/bnx2x_rxtx.c
+++ b/drivers/net/bnx2x/bnx2x_rxtx.c
@@ -405,6 +405,8 @@ bnx2x_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
new_mb = bnx2x_rxmbuf_alloc(rxq->mb_pool);
if (unlikely(!new_mb)) {
PMD_RX_LOG(ERR, "mbuf alloc fail fp[%02d]", fp->index);
+ rte_eth_devices[rxq->port_id].data->
+ rx_mbuf_alloc_failed++;
goto next_rx;
}
--
1.7.10.3
next prev parent reply other threads:[~2016-04-01 0:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 0:15 [dpdk-dev] [PATCH v2 1/4] bnx2x: Update documentation Rasesh Mody
2016-04-01 0:15 ` [dpdk-dev] [PATCH v2 2/4] bnx2x: Fix Tx Performance Rasesh Mody
2016-04-01 0:15 ` Rasesh Mody [this message]
2016-04-01 8:17 ` [dpdk-dev] [PATCH v2 3/4] bnx2x: Enhance stats get routine Thomas Monjalon
2016-04-01 0:15 ` [dpdk-dev] [PATCH v2 4/4] bnx2x: Update PMD version to 1.0.1.1 Rasesh Mody
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=1459469725-3333-3-git-send-email-rasesh.mody@qlogic.com \
--to=rasesh.mody@qlogic.com \
--cc=ameen.rahman@qlogic.com \
--cc=dev@dpdk.org \
--cc=harish.patil@qlogic.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).