patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] telemetry: fix struct reset after value assignment
@ 2020-02-27 17:04 Ciara Power
  2020-02-27 17:34 ` Laatz, Kevin
  0 siblings, 1 reply; 5+ messages in thread
From: Ciara Power @ 2020-02-27 17:04 UTC (permalink / raw)
  To: kevin.laatz; +Cc: dev, Ciara Power, reshma.pattan, stable

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-stable] [PATCH] telemetry: fix struct reset after value assignment
  2020-02-27 17:04 [dpdk-stable] [PATCH] telemetry: fix struct reset after value assignment Ciara Power
@ 2020-02-27 17:34 ` Laatz, Kevin
  2020-03-13  9:33   ` [dpdk-stable] [dpdk-dev] " David Marchand
  2020-03-13 13:12   ` David Marchand
  0 siblings, 2 replies; 5+ messages in thread
From: Laatz, Kevin @ 2020-02-27 17:34 UTC (permalink / raw)
  To: Power, Ciara; +Cc: dev, Pattan, Reshma, stable

> 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>

Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] telemetry: fix struct reset after value assignment
  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
  1 sibling, 1 reply; 5+ messages in thread
From: David Marchand @ 2020-03-13  9:33 UTC (permalink / raw)
  To: Power, Ciara; +Cc: dev, Pattan, Reshma, stable, Laatz, Kevin

Hello,

On Thu, Feb 27, 2020 at 6:34 PM Laatz, Kevin <kevin.laatz@intel.com> wrote:
>
> > 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>
>
> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
>

For the title, how about:
telemetry: fix port stats retrieval

I can fix while applying.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] telemetry: fix struct reset after value assignment
  2020-03-13  9:33   ` [dpdk-stable] [dpdk-dev] " David Marchand
@ 2020-03-13 10:30     ` Power, Ciara
  0 siblings, 0 replies; 5+ messages in thread
From: Power, Ciara @ 2020-03-13 10:30 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Pattan, Reshma, stable, Laatz, Kevin


Hi David, 


> Hello,
> 
> On Thu, Feb 27, 2020 at 6:34 PM Laatz, Kevin <kevin.laatz@intel.com>
> wrote:
> >
> > > 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>
> >
> > Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
> >
> 
> For the title, how about:
> telemetry: fix port stats retrieval
> 
> I can fix while applying.
> 
> 
> --
> David Marchand


That title change is okay with me, thanks.

- Ciara

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH] telemetry: fix struct reset after value assignment
  2020-02-27 17:34 ` Laatz, Kevin
  2020-03-13  9:33   ` [dpdk-stable] [dpdk-dev] " David Marchand
@ 2020-03-13 13:12   ` David Marchand
  1 sibling, 0 replies; 5+ messages in thread
From: David Marchand @ 2020-03-13 13:12 UTC (permalink / raw)
  To: Power, Ciara; +Cc: dev, Pattan, Reshma, stable, Laatz, Kevin

On Thu, Feb 27, 2020 at 6:34 PM Laatz, Kevin <kevin.laatz@intel.com> wrote:
>
> > 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>
>
> Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>

Applied, thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 17:04 [dpdk-stable] [PATCH] telemetry: fix struct reset after value assignment Ciara Power
2020-02-27 17:34 ` Laatz, Kevin
2020-03-13  9:33   ` [dpdk-stable] [dpdk-dev] " David Marchand
2020-03-13 10:30     ` Power, Ciara
2020-03-13 13:12   ` David Marchand

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox