From: Ciara Power <ciara.power@intel.com>
To: kevin.laatz@intel.com
Cc: dev@dpdk.org, Ciara Power <ciara.power@intel.com>,
reshma.pattan@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] telemetry: fix struct reset after value assignment
Date: Thu, 27 Feb 2020 17:04:56 +0000 [thread overview]
Message-ID: <20200227170456.29164-1-ciara.power@intel.com> (raw)
The ep struct is used to track what type of stats are required by the
client. For PORT_STATS type, it contains the lists of port and metric
ids to query, and the number of ids in each list.
The ep struct has values set (num of port and metric ids) when a request
for port stats values by name is received. However, after this value
assignment, the struct is reset to all 0 values, meaning the number of
port and metric ids required now both show as 0, and the client will not
receive the requested data in response. To fix this issue, the memset
call is now moved above the ep struct value assignment.
Fixes: 4080e46c8078 ("telemetry: support global metrics")
Cc: reshma.pattan@intel.com
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
---
lib/librte_telemetry/rte_telemetry_parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_telemetry/rte_telemetry_parser.c b/lib/librte_telemetry/rte_telemetry_parser.c
index 960132397..e8c269e85 100644
--- a/lib/librte_telemetry/rte_telemetry_parser.c
+++ b/lib/librte_telemetry/rte_telemetry_parser.c
@@ -456,9 +456,9 @@ rte_telemetry_command_ports_stats_values_by_name(struct telemetry_impl
size_t index;
json_t *value;
+ memset(&ep, 0, sizeof(ep));
ep.pp.num_port_ids = json_array_size(port_ids_json);
ep.pp.num_metric_ids = num_stat_names;
- memset(&ep, 0, sizeof(ep));
if (telemetry == NULL) {
TELEMETRY_LOG_ERR("Invalid telemetry argument");
return -1;
--
2.17.1
next reply other threads:[~2020-02-27 17:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-27 17:04 Ciara Power [this message]
2020-02-27 17:34 ` Laatz, Kevin
2020-03-13 9:33 ` David Marchand
2020-03-13 10:30 ` Power, Ciara
2020-03-13 13:12 ` David Marchand
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=20200227170456.29164-1-ciara.power@intel.com \
--to=ciara.power@intel.com \
--cc=dev@dpdk.org \
--cc=kevin.laatz@intel.com \
--cc=reshma.pattan@intel.com \
--cc=stable@dpdk.org \
/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).