[PATCH v3 03/15] graph: move node process into inline function
Jerin Jacob
jerinjacobk at gmail.com
Wed Mar 29 17:41:30 CEST 2023
On Wed, Mar 29, 2023 at 9:04 PM Stephen Hemminger
<stephen at networkplumber.org> wrote:
>
> On Wed, 29 Mar 2023 15:43:28 +0900
> Zhirun Yan <zhirun.yan at intel.com> wrote:
>
> > +/**
> > + * @internal
> > + *
> > + * Enqueue a given node to the tail of the graph reel.
> > + *
> > + * @param graph
> > + * Pointer Graph object.
> > + * @param node
> > + * Pointer to node object to be enqueued.
> > + */
> > +static __rte_always_inline void
> > +__rte_node_process(struct rte_graph *graph, struct rte_node *node)
> > +{
> > + uint64_t start;
> > + uint16_t rc;
> > + void **objs;
> > +
> > + RTE_ASSERT(node->fence == RTE_GRAPH_FENCE);
> > + objs = node->objs;
> > + rte_prefetch0(objs);
> > +
> > + if (rte_graph_has_stats_feature()) {
> > + start = rte_rdtsc();
> > + rc = node->process(graph, node, objs, node->idx);
> > + node->total_cycles += rte_rdtsc() - start;
> > + node->total_calls++;
> > + node->total_objs += rc;
> > + } else {
> > + node->process(graph, node, objs, node->idx);
> > + }
> > + node->idx = 0;
> > +}
> > +
>
> Why inline? Doing everything as inlines has long term ABI
> impacts. And this is not a super critical performance path.
This is one of the real fast path routine.
More information about the dev
mailing list