[v2] graph: fix xstats description allocation

Message ID 20251028110920.16353-1-cfontain@redhat.com (mailing list archive)
State Accepted
Delegated to: Thomas Monjalon
Headers
Series [v2] graph: fix xstats description allocation |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/github-robot: build success github build: passed
ci/github-robot-post success github post: success
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-sample-apps-testing warning Testing issues
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/aws-unit-testing success Unit Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing warning Testing issues
ci/Intel-compilation success Compilation OK
ci/intel-Functional success Functional PASS
ci/intel-Testing success Testing PASS

Commit Message

Christophe Fontaine Oct. 28, 2025, 11:09 a.m. UTC
Fix the extended stats name allocation size: instead of allocating
RTE_NODE_XSTAT_DESC_SIZE (64 bytes), only sizeof(RTE_NODE_XSTAT_DESC_SIZE)
were allocated for each xstat name.

Fixes: 070db97e017b ("graph: support node xstats")
Signed-off-by: Christophe Fontaine <cfontain@redhat.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---

Notes:
    v2: add acked-by
        fix sha length

 lib/graph/graph_stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Nov. 11, 2025, 2:14 p.m. UTC | #1
28/10/2025 12:09, Christophe Fontaine:
> Fix the extended stats name allocation size: instead of allocating
> RTE_NODE_XSTAT_DESC_SIZE (64 bytes), only sizeof(RTE_NODE_XSTAT_DESC_SIZE)
> were allocated for each xstat name.
> 
> Fixes: 070db97e017b ("graph: support node xstats")
> Signed-off-by: Christophe Fontaine <cfontain@redhat.com>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Applied, thanks.
  

Patch

diff --git a/lib/graph/graph_stats.c b/lib/graph/graph_stats.c
index e0fc8fd25c..b87b5707f7 100644
--- a/lib/graph/graph_stats.c
+++ b/lib/graph/graph_stats.c
@@ -302,7 +302,7 @@  stats_mem_populate(struct rte_graph_cluster_stats *stats,
 				    graph_node->node->name, graph->name);
 
 		cluster->stat.xstat_desc = rte_zmalloc_socket(NULL,
-			sizeof(RTE_NODE_XSTAT_DESC_SIZE) * graph_node->node->xstats->nb_xstats,
+			RTE_NODE_XSTAT_DESC_SIZE * graph_node->node->xstats->nb_xstats,
 			RTE_CACHE_LINE_SIZE, stats->socket_id);
 		if (cluster->stat.xstat_desc == NULL) {
 			rte_free(cluster->stat.xstat_count);