From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: dev@dpdk.org
Cc: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH 02/11] net/sfc: rename accumulative SW stats to total
Date: Tue, 28 Sep 2021 14:29:03 +0300 [thread overview]
Message-ID: <20210928112912.785412-3-andrew.rybchenko@oktetlabs.ru> (raw)
In-Reply-To: <20210928112912.785412-1-andrew.rybchenko@oktetlabs.ru>
From: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
This is a better word used in RTE docs.
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
drivers/net/sfc/sfc_sw_stats.c | 52 +++++++++++++++++-----------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/drivers/net/sfc/sfc_sw_stats.c b/drivers/net/sfc/sfc_sw_stats.c
index 2b8b1b56e9..a9f1790d38 100644
--- a/drivers/net/sfc/sfc_sw_stats.c
+++ b/drivers/net/sfc/sfc_sw_stats.c
@@ -126,7 +126,7 @@ sfc_sw_stat_get_queue_count(struct sfc_adapter *sa,
static unsigned int
sfc_sw_xstat_per_queue_get_count(unsigned int nb_queues)
{
- /* Take into account the accumulative xstat of all queues */
+ /* Take into account the total xstat of all queues */
return nb_queues > 0 ? 1 + nb_queues : 0;
}
@@ -160,7 +160,7 @@ sfc_sw_stat_get_names(struct sfc_adapter *sa,
*nb_supported += sfc_sw_xstat_per_queue_get_count(nb_queues);
/*
- * The order of each software xstat type is the accumulative xstat
+ * The order of each software xstat type is the total xstat
* followed by per-queue xstats.
*/
if (*nb_written < xstats_names_sz) {
@@ -206,7 +206,7 @@ sfc_sw_xstat_get_names_by_id(struct sfc_adapter *sa,
*nb_supported += sfc_sw_xstat_per_queue_get_count(nb_queues);
/*
- * The order of each software xstat type is the accumulative xstat
+ * The order of each software xstat type is the total xstat
* followed by per-queue xstats.
*/
for (i = 0; i < size; i++) {
@@ -232,8 +232,8 @@ sfc_sw_xstat_get_values(struct sfc_adapter *sa,
{
unsigned int qid;
uint64_t value;
- struct rte_eth_xstat *accum_xstat;
- bool count_accum_value = false;
+ struct rte_eth_xstat *total_xstat;
+ bool count_total_value = false;
unsigned int nb_queues;
nb_queues = sfc_sw_stat_get_queue_count(sa, sw_xstat);
@@ -242,12 +242,12 @@ sfc_sw_xstat_get_values(struct sfc_adapter *sa,
*nb_supported += sfc_sw_xstat_per_queue_get_count(nb_queues);
/*
- * The order of each software xstat type is the accumulative xstat
+ * The order of each software xstat type is the total xstat
* followed by per-queue xstats.
*/
if (*nb_written < xstats_size) {
- count_accum_value = true;
- accum_xstat = &xstats[*nb_written];
+ count_total_value = true;
+ total_xstat = &xstats[*nb_written];
xstats[*nb_written].id = *nb_written;
xstats[*nb_written].value = 0;
(*nb_written)++;
@@ -262,8 +262,8 @@ sfc_sw_xstat_get_values(struct sfc_adapter *sa,
(*nb_written)++;
}
- if (count_accum_value)
- accum_xstat->value += value;
+ if (count_total_value)
+ total_xstat->value += value;
}
}
@@ -278,9 +278,9 @@ sfc_sw_xstat_get_values_by_id(struct sfc_adapter *sa,
rte_spinlock_t *bmp_lock = &sa->sw_xstats.queues_bitmap_lock;
struct rte_bitmap *bmp = sa->sw_xstats.queues_bitmap;
unsigned int id_base = *nb_supported;
- bool count_accum_value = false;
- unsigned int accum_value_idx;
- uint64_t accum_value = 0;
+ bool count_total_value = false;
+ unsigned int total_value_idx;
+ uint64_t total_value = 0;
unsigned int i, qid;
unsigned int nb_queues;
@@ -294,32 +294,32 @@ sfc_sw_xstat_get_values_by_id(struct sfc_adapter *sa,
*nb_supported += sfc_sw_xstat_per_queue_get_count(nb_queues);
/*
- * The order of each software xstat type is the accumulative xstat
+ * The order of each software xstat type is the total xstat
* followed by per-queue xstats.
*/
for (i = 0; i < ids_size; i++) {
if (id_base <= ids[i] && ids[i] <= (id_base + nb_queues)) {
if (ids[i] == id_base) { /* Accumulative value */
- count_accum_value = true;
- accum_value_idx = i;
+ count_total_value = true;
+ total_value_idx = i;
continue;
}
qid = ids[i] - id_base - 1;
values[i] = sw_xstat->get_val(sa, qid);
- accum_value += values[i];
+ total_value += values[i];
rte_bitmap_set(bmp, qid);
}
}
- if (count_accum_value) {
- values[accum_value_idx] = 0;
+ if (count_total_value) {
+ values[total_value_idx] = 0;
for (qid = 0; qid < nb_queues; ++qid) {
if (rte_bitmap_get(bmp, qid) != 0)
continue;
- values[accum_value_idx] += sw_xstat->get_val(sa, qid);
+ values[total_value_idx] += sw_xstat->get_val(sa, qid);
}
- values[accum_value_idx] += accum_value;
+ values[total_value_idx] += total_value;
}
unlock:
@@ -457,7 +457,7 @@ sfc_sw_xstat_reset(struct sfc_adapter *sa, struct sfc_sw_xstat_descr *sw_xstat,
{
unsigned int nb_queues;
unsigned int qid;
- uint64_t *accum_xstat_reset;
+ uint64_t *total_xstat_reset;
SFC_ASSERT(sfc_adapter_is_locked(sa));
@@ -466,16 +466,16 @@ sfc_sw_xstat_reset(struct sfc_adapter *sa, struct sfc_sw_xstat_descr *sw_xstat,
return;
/*
- * The order of each software xstat type is the accumulative xstat
+ * The order of each software xstat type is the total xstat
* followed by per-queue xstats.
*/
- accum_xstat_reset = reset_vals;
- *accum_xstat_reset = 0;
+ total_xstat_reset = reset_vals;
+ *total_xstat_reset = 0;
reset_vals++;
for (qid = 0; qid < nb_queues; ++qid) {
reset_vals[qid] = sw_xstat->get_val(sa, qid);
- *accum_xstat_reset += reset_vals[qid];
+ *total_xstat_reset += reset_vals[qid];
}
}
--
2.30.2
next prev parent reply other threads:[~2021-09-28 11:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 11:29 [dpdk-dev] [PATCH 00/11] net/sfc: support per-queue stats on EF100 Andrew Rybchenko
2021-09-28 11:29 ` [dpdk-dev] [PATCH 01/11] net/sfc: rename array of SW stats descriptions Andrew Rybchenko
2021-09-28 11:29 ` Andrew Rybchenko [this message]
2021-09-28 11:29 ` [dpdk-dev] [PATCH 03/11] net/sfc: rename SW stats structures Andrew Rybchenko
2021-09-28 11:29 ` [dpdk-dev] [PATCH 04/11] net/sfc: fix cleanup order of SW stats Andrew Rybchenko
2021-09-28 11:29 ` [dpdk-dev] [PATCH 05/11] net/sfc: fix missing const of SW stats descriptions Andrew Rybchenko
2021-09-28 11:29 ` [dpdk-dev] [PATCH 06/11] net/sfc: optimize getting number of SW stats Andrew Rybchenko
2021-09-28 11:29 ` [dpdk-dev] [PATCH 07/11] net/sfc: prepare having no some SW stats on an adapter Andrew Rybchenko
2021-09-28 11:29 ` [dpdk-dev] [PATCH 08/11] net/sfc: add toggle to disable total stat Andrew Rybchenko
2021-09-28 11:29 ` [dpdk-dev] [PATCH 09/11] net/sfc: add support for SW stats groups Andrew Rybchenko
2021-09-28 11:29 ` [dpdk-dev] [PATCH 10/11] net/sfc: collect per queue stats in EF100 Rx datapath Andrew Rybchenko
2021-09-28 11:29 ` [dpdk-dev] [PATCH 11/11] net/sfc: collect per queue stats in EF100 Tx datapath Andrew Rybchenko
2021-10-11 16:38 ` [dpdk-dev] [PATCH 00/11] net/sfc: support per-queue stats on EF100 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=20210928112912.785412-3-andrew.rybchenko@oktetlabs.ru \
--to=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=ivan.ilchenko@oktetlabs.ru \
/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).