On Mon, Oct 14, 2024 at 9:41 PM <pbhagavat...@marvell.com> wrote: > > From: Pavan Nikhilesh <pbhagavat...@marvell.com> > > Add ability for Nodes to advertise xstat counters > during registration and increment them in fastpath. > Add support for retrieving/printing stats for node > specific xstats using rte_graph_cluster_stats_get(). > Add `rte_node_xstat_increment` API to increment node > specific xstat counters. > > Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com> > Acked-by: Kiran Kumar K <kirankum...@marvell.com> > Reviewed-by: Robin Jarry <rja...@redhat.com> > --- > doc/guides/prog_guide/graph_lib.rst | 22 +++++-- > doc/guides/rel_notes/deprecation.rst | 6 -- > doc/guides/rel_notes/release_24_11.rst | 8 +++ > lib/graph/graph_populate.c | 20 ++++++- > lib/graph/graph_private.h | 3 + > lib/graph/graph_stats.c | 79 +++++++++++++++++++++++++- > lib/graph/node.c | 37 +++++++++++- > lib/graph/rte_graph.h | 11 ++++ > lib/graph/rte_graph_worker_common.h | 23 ++++++++ > lib/graph/version.map | 7 +++ > 10 files changed, 201 insertions(+), 15 deletions(-)
> Doxygen comment is missing for rte_node_xstats structure. > +struct rte_node_xstats { > + uint16_t nb_xstats; /**< Number of xstats. */ > + char xstat_desc[][RTE_NODE_XSTAT_DESC_SIZE]; /**< Names of xstats. */ > +}; > + > > +/** > + * Increment Node xstat count. > + * > + * Increment the count of an xstat for a given node. > + * > + * @param node > + * Pointer to the node. > + * @param xstat_id > + * Error ID. Extend stats ID With the above fixes: Acked-by: Jerin Jacob <jer...@marvell.com> > + * @param value > + * Value to increment. > + */ > +__rte_experimental > +static inline void > +rte_node_xstat_increment(struct rte_node *node, uint16_t xstat_id, uint64_t > value) > +{ > + if (rte_graph_has_stats_feature()) { > + uint64_t *xstat = (uint64_t *)RTE_PTR_ADD(node, > node->xstat_off); > + xstat[xstat_id] += value; > + } > +} > +