[PATCH v10 3/7] graph: add feature arc init APIs
Nitin Saxena
nsaxena16 at gmail.com
Wed Jun 4 17:50:28 CEST 2025
Hi Kiran,
On Wed, Jun 4, 2025 at 4:54 PM Kiran Kumar Kokkilagadda
<kirankumark at marvell.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Nitin Saxena <nsaxena at marvell.com>
> > Sent: Wednesday, June 4, 2025 3:43 PM
> > To: Jerin Jacob <jerinj at marvell.com>; Kiran Kumar Kokkilagadda
> > <kirankumark at marvell.com>; Nithin Kumar Dabilpuram
> > <ndabilpuram at marvell.com>; Zhirun Yan <yanzhirun_163 at 163.com>; Robin
> > Jarry <rjarry at redhat.com>; Christophe Fontaine <cfontain at redhat.com>
> > Cc: dev at dpdk.org; Nitin Saxena <nsaxena16 at gmail.com>
> > Subject: [PATCH v10 3/7] graph: add feature arc init APIs
> >
> > This patch adds feature arc init()/create()/destroy() APIs. It also add
> > APIs for adding feature node to an arc.
> >
> > Signed-off-by: Nitin Saxena <nsaxena at marvell.com>
> > ---
> > doc/api/doxy-api-index.md | 1 +
> > doc/guides/prog_guide/graph_lib.rst | 23 +-
> > lib/graph/graph_feature_arc.c | 1329 +++++++++++++++++++++-
> > lib/graph/graph_private.h | 4 +
> > lib/graph/meson.build | 2 +-
> > lib/graph/rte_graph_feature_arc.h | 248 +++-
> > lib/graph/rte_graph_feature_arc_worker.h | 303 +++++
> > 7 files changed, 1902 insertions(+), 8 deletions(-)
> > create mode 100644 lib/graph/rte_graph_feature_arc_worker.h
> >
> > diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
> > index a7bdbf892c..6d8b531344 100644
> > --- a/doc/api/doxy-api-index.md
> > +++ b/doc/api/doxy-api-index.md
> > @@ -215,6 +215,7 @@ The public API headers are grouped by topics:
> > * [graph](@ref rte_graph.h):
> > [graph_worker](@ref rte_graph_worker.h)
> > [graph_feature_arc](@ref rte_graph_feature_arc.h)
> > + [graph_feature_arc_worker](@ref rte_graph_feature_arc_worker.h)
> > * graph_nodes:
> > [eth_node](@ref rte_node_eth_api.h),
> > [ip4_node](@ref rte_node_ip4_api.h),
> > diff --git a/doc/guides/prog_guide/graph_lib.rst
> > b/doc/guides/prog_guide/graph_lib.rst
> > index 191c8e8a0b..c9ac9e7ae0 100644
> > --- a/doc/guides/prog_guide/graph_lib.rst
> > +++ b/doc/guides/prog_guide/graph_lib.rst
> > @@ -815,7 +815,7 @@ added to existing arc as follows:
> > ...
> > ...
> > ...
> > - .override_index_cb = Feature-3_override_index_cb(),
> > + .override_index_cb = Feature-2_override_index_cb(),
> > .runs_after = "Feature-1",
> > .runs_before = "Custom-Feature",
> > };
> > @@ -848,3 +848,24 @@ this callback. In case of multiple features, largest
> > value returned by any
> > feature would be selected for creating feature arc.
> >
> > .. _Feature_Arc_Initialization:
> > +
> > +Initializing Feature arc
> > +^^^^^^^^^^^^^^^^^^^^^^^^
> > +Following code shows how to initialize feature arc sub-system.
> > +``rte_graph_feature_arc_init()`` API is used to initialize a feature arc
> > +sub-system. If not called, feature arc has no impact on application.
> > +
> > +.. code-block:: c
> > +
> > + struct rte_graph_param *graph_param = app_get_graph_param();
> > +
> > + /* Initialize feature arc before graph create */
> > + rte_graph_feature_arc_init(0);
> > +
> > + rte_graph_create(graph_param);
> > +
> > +.. note::
> > +
> > + ``rte_graph_feature_arc_init()`` API should be called before
> > + ``rte_graph_create()``. If not called, feature arc is a ``NOP`` to
> > + application.
> > diff --git a/lib/graph/graph_feature_arc.c b/lib/graph/graph_feature_arc.c
> > index 6135b262d5..b28f0ec321 100644
> > --- a/lib/graph/graph_feature_arc.c
> > +++ b/lib/graph/graph_feature_arc.c
> > @@ -2,10 +2,57 @@
> > * Copyright(C) 2025 Marvell International Ltd.
> > */
> >
> > -#include <rte_graph_feature_arc.h>
> > +#include <rte_graph_feature_arc_worker.h>
> > +#include <rte_malloc.h>
> > +#include <rte_string_fns.h>
> > #include <eal_export.h>
> > #include "graph_private.h"
> >
> > +#define GRAPH_FEATURE_MAX_NUM_PER_ARC (64)
> > +
> > +#define connect_graph_nodes(node1, node2, edge, arc_name) \
> > + __connect_graph_nodes(node1, node2, edge, arc_name, __LINE__)
> > +
> > +#define FEATURE_ARC_MEMZONE_NAME "__rte_feature_arc_main_mz"
> > +
> > +#define NUM_EXTRA_FEATURE_DATA (2)
> > +
> > +#define graph_uint_cast(f) ((unsigned int)f)
>
> Not used anywhere in the patch.
It is getting used in enable/disable APIs. I have moved this macro to
another patch where it is being used
<snip>
More information about the dev
mailing list