From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D72ACA05D3 for ; Thu, 25 Apr 2019 17:41:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CC1F71B5C4; Thu, 25 Apr 2019 17:41:39 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 522ED1B5ED for ; Thu, 25 Apr 2019 17:41:38 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B9CD730ABAD7; Thu, 25 Apr 2019 15:41:37 +0000 (UTC) Received: from rh.redhat.com (unknown [10.36.116.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACBA35D9C6; Thu, 25 Apr 2019 15:41:36 +0000 (UTC) From: Kevin Traynor To: Bruce Richardson Cc: Kevin Laatz , dpdk stable Date: Thu, 25 Apr 2019 16:40:08 +0100 Message-Id: <20190425154037.28778-33-ktraynor@redhat.com> In-Reply-To: <20190425154037.28778-1-ktraynor@redhat.com> References: <20190425154037.28778-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 25 Apr 2019 15:41:37 +0000 (UTC) Subject: [dpdk-stable] patch 'telemetry: fix mapping of statistics' has been queued to LTS release 18.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 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 Acked-by: Kevin Laatz --- 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@dpdk.org