graph: fix xstats description allocation
PATCH 1/1 graph: fix xstats description allocation
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.
--- lib/graph/graph_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/graph/graph_stats.c +1 -1
@@ -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);
Signature · 1 line
2.51.0
Quoted 6 lines
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 070db97e01 ("graph: support node xstats")Signed-off-by Christophe Fontaine <[email protected]>
Quoted 19 lines
---
lib/graph/graph_stats.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)lib/graph/graph_stats.c +1
-2@@ -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); --2.51.0
PATCH v2 1/1 graph: fix xstats description allocation
In reply to Christophe FontaineFix 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.
---
Notes:
v2: add acked-by
fix sha length
lib/graph/graph_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/graph/graph_stats.c +1 -1
@@ -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);
Signature · 1 line
2.51.0
Thomas Monjalon
Applied28/10/2025 12:09, Christophe Fontaine:
Quoted 7 lines
Fix the extended stats name allocation size: instead of allocating
RTE_NODE_XSTAT_DESC_SIZE(64 bytes), onlysizeof(RTE_NODE_XSTAT_DESC_SIZE)were allocated for each xstat name.Fixes 070db97e017b ("graph: support node xstats")Signed-off-by Christophe Fontaine <[email protected]>Acked-by Pavan Nikhilesh <[email protected]>
Applied, thanks.