From: "Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
To: <jerinj@marvell.com>
Cc: dev@dpdk.org, stefan.sundkvist@ericsson.com,
Ola.Liljedahl@arm.com,
"Mattias Rönnblom" <mattias.ronnblom@ericsson.com>
Subject: [dpdk-dev] [PATCH 8/8] event/dsw: add port busy cycles xstats
Date: Mon, 9 Mar 2020 07:51:06 +0100 [thread overview]
Message-ID: <20200309065106.23800-9-mattias.ronnblom@ericsson.com> (raw)
In-Reply-To: <20200309065106.23800-1-mattias.ronnblom@ericsson.com>
DSW keeps an internal port load estimate, used by the load balancing
mechanism. As a side effect, it keeps track of the total number of
busy cycles since startup. This metric is indirectly exposed in the
form of DSW xstats' "port_<n>_event_proc_latency", which is the total
number of busy cycles divided by the total number of events processed
on a particular port.
An external application can take (event_latency * dequeued) to go back
to busy_cycles. One reason for doing this is to measure the port's
load during a longer time period, without resorting to sampling
"port_<n>_load". However, as the number dequeued events grows, a
rounding error in event_latency renders the application-calculated
busy_cycles inaccurate.
Thus, it makes sense to directly expose the number of busy cycles as a
DSW xstats, even though it might seem redundant.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
---
drivers/event/dsw/dsw_xstats.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/event/dsw/dsw_xstats.c b/drivers/event/dsw/dsw_xstats.c
index d332a57b6..e8e92183e 100644
--- a/drivers/event/dsw/dsw_xstats.c
+++ b/drivers/event/dsw/dsw_xstats.c
@@ -109,6 +109,13 @@ dsw_xstats_port_get_event_proc_latency(struct dsw_evdev *dsw, uint8_t port_id,
return dequeued > 0 ? total_busy_cycles / dequeued : 0;
}
+static uint64_t
+dsw_xstats_port_get_busy_cycles(struct dsw_evdev *dsw, uint8_t port_id,
+ uint8_t queue_id __rte_unused)
+{
+ return dsw->ports[port_id].total_busy_cycles;
+}
+
DSW_GEN_PORT_ACCESS_FN(inflight_credits)
DSW_GEN_PORT_ACCESS_FN(pending_releases)
@@ -147,6 +154,8 @@ static struct dsw_xstats_port dsw_port_xstats[] = {
false },
{ "port_%u_event_proc_latency", dsw_xstats_port_get_event_proc_latency,
false },
+ { "port_%u_busy_cycles", dsw_xstats_port_get_busy_cycles,
+ false },
{ "port_%u_inflight_credits", dsw_xstats_port_get_inflight_credits,
false },
{ "port_%u_pending_releases", dsw_xstats_port_get_pending_releases,
--
2.17.1
next prev parent reply other threads:[~2020-03-09 6:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-09 6:50 [dpdk-dev] [PATCH 0/8] DSW performance and statistics improvements Mattias Rönnblom
2020-03-09 6:50 ` [dpdk-dev] [PATCH 1/8] event/dsw: reduce latency in low-load situations Mattias Rönnblom
2020-03-09 6:51 ` [dpdk-dev] [PATCH 2/8] event/dsw: reduce max flows to speed up load balancing Mattias Rönnblom
2020-03-09 6:51 ` [dpdk-dev] [PATCH 3/8] event/dsw: extend statistics Mattias Rönnblom
2020-03-09 6:51 ` [dpdk-dev] [PATCH 4/8] event/dsw: improve migration mechanism Mattias Rönnblom
2020-03-09 6:51 ` [dpdk-dev] [PATCH 5/8] event/dsw: avoid migration waves in large systems Mattias Rönnblom
2020-03-09 6:51 ` [dpdk-dev] [PATCH 6/8] event/dsw: remove redundant control ring poll Mattias Rönnblom
2020-03-09 6:51 ` [dpdk-dev] [PATCH 7/8] event/dsw: remove unnecessary read barrier Mattias Rönnblom
2020-03-09 6:51 ` Mattias Rönnblom [this message]
2020-04-04 14:35 ` [dpdk-dev] [EXT] [PATCH 0/8] DSW performance and statistics improvements Jerin Jacob Kollanukkaran
2020-04-15 16:37 ` David Marchand
2020-04-15 17:39 ` Mattias Rönnblom
2020-04-15 17:45 ` [dpdk-dev] [dpdk-ci] " Thomas Monjalon
2020-04-15 18:09 ` Mattias Rönnblom
2020-04-15 18:15 ` [dpdk-dev] [PATCH v2] event/dsw: fix gcc 4.8 false positive warning Mattias Rönnblom
2020-04-15 19:45 ` David Marchand
2020-04-16 6:15 ` Mattias Rönnblom
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=20200309065106.23800-9-mattias.ronnblom@ericsson.com \
--to=mattias.ronnblom@ericsson.com \
--cc=Ola.Liljedahl@arm.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=stefan.sundkvist@ericsson.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).