[dpdk-stable] patch 'telemetry: fix mapping of statistics' has been queued to LTS release 18.11.2
Kevin Traynor
ktraynor at redhat.com
Thu Apr 25 17:40:08 CEST 2019
Hi,
FYI, your patch has been queued to LTS release 18.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/01/19. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches can be viewed on the 18.11 branch at:
https://github.com/kevintraynor/dpdk-stable-queue.git
Thanks.
Kevin Traynor
---
>From 9c3a20924e62ad9b2eae25d784e64ce660a22a94 Mon Sep 17 00:00:00 2001
From: Bruce Richardson <bruce.richardson at intel.com>
Date: Thu, 28 Mar 2019 15:30:45 +0000
Subject: [PATCH] telemetry: fix mapping of statistics
[ upstream commit c12cefa3795881be175e64bebc2798d1f77f9132 ]
If we have two NIC ports which have a different set of NIC stats we can
end up having two different stats registered with xstats with the same
name. [Since the stats are updated in bulk as a contiguous set, the
second driver re-using the registration of the first is not possible.]
This causes issues with the invalid stat for one driver being found due to
a lookup by name which is unnecessary. Instead of getting stat names
involved do the lookup by ID instead.
Fixes: 1b756087db93 ("telemetry: add parser for client socket messages")
Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
Acked-by: Kevin Laatz <kevin.laatz at intel.com>
---
lib/librte_telemetry/rte_telemetry_parser.c | 26 +++++++++------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/lib/librte_telemetry/rte_telemetry_parser.c b/lib/librte_telemetry/rte_telemetry_parser.c
index 03a58a2fd..9bc16eef4 100644
--- a/lib/librte_telemetry/rte_telemetry_parser.c
+++ b/lib/librte_telemetry/rte_telemetry_parser.c
@@ -257,5 +257,5 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
{
int ret, num_metrics, i, p;
- struct rte_metric_name *names;
+ struct rte_metric_value *values;
uint64_t num_port_ids = 0;
uint32_t port_ids[RTE_MAX_ETHPORTS];
@@ -282,5 +282,5 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
}
- num_metrics = rte_metrics_get_names(NULL, 0);
+ num_metrics = rte_metrics_get_values(0, NULL, 0);
if (num_metrics < 0) {
TELEMETRY_LOG_ERR("Cannot get metrics count");
@@ -301,6 +301,6 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
}
- names = malloc(sizeof(struct rte_metric_name) * num_metrics);
- if (names == NULL) {
+ values = malloc(sizeof(struct rte_metric_value) * num_metrics);
+ if (values == NULL) {
TELEMETRY_LOG_ERR("Cannot allocate memory");
ret = rte_telemetry_send_error_response(telemetry,
@@ -311,5 +311,4 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
}
- const char *stat_names[num_metrics];
uint32_t stat_ids[num_metrics];
@@ -329,14 +328,11 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
}
- ret = rte_metrics_get_names(names, num_metrics);
+ ret = rte_metrics_get_values(port_ids[0], values, num_metrics);
+ if (ret < 0) {
+ TELEMETRY_LOG_ERR("Could not get stat values");
+ goto fail;
+ }
for (i = 0; i < num_metrics; i++)
- stat_names[i] = names[i].name;
-
- ret = rte_telemetry_stat_names_to_ids(telemetry, stat_names, stat_ids,
- num_metrics);
- if (ret < 0) {
- TELEMETRY_LOG_ERR("Could not convert stat names to IDs");
- goto fail;
- }
+ stat_ids[i] = values[i].key;
ret = rte_telemetry_send_ports_stats_values(stat_ids, num_metrics,
@@ -350,5 +346,5 @@ rte_telemetry_command_ports_all_stat_values(struct telemetry_impl *telemetry,
fail:
- free(names);
+ free(values);
return -1;
}
--
2.20.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2019-04-25 16:37:48.184962934 +0100
+++ 0033-telemetry-fix-mapping-of-statistics.patch 2019-04-25 16:37:46.741295041 +0100
@@ -1 +1 @@
-From c12cefa3795881be175e64bebc2798d1f77f9132 Mon Sep 17 00:00:00 2001
+From 9c3a20924e62ad9b2eae25d784e64ce660a22a94 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c12cefa3795881be175e64bebc2798d1f77f9132 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list