On Sat, Sep 7, 2024 at 1:07 PM Nitin Saxena <nsax...@marvell.com> wrote: > > add feature arc to allow dynamic steering of packets across graph nodes > based on protocol features enabled on incoming or outgoing interface > > Signed-off-by: Nitin Saxena <nsax...@marvell.com> > --- > lib/graph/graph_feature_arc.c | 959 +++++++++++++++++++++++ > lib/graph/meson.build | 2 + > lib/graph/rte_graph_feature_arc.h | 373 +++++++++ > lib/graph/rte_graph_feature_arc_worker.h | 548 +++++++++++++ > lib/graph/version.map | 17 + > 5 files changed, 1899 insertions(+) > create mode 100644 lib/graph/graph_feature_arc.c > create mode 100644 lib/graph/rte_graph_feature_arc.h > create mode 100644 lib/graph/rte_graph_feature_arc_worker.h
Missed adding these new files in doc/api/doxy-api-index.md > > diff --git a/lib/graph/graph_feature_arc.c b/lib/graph/graph_feature_arc.c > new file mode 100644 > index 0000000000..3b05bac137 > --- /dev/null > +++ b/lib/graph/graph_feature_arc.c > @@ -0,0 +1,959 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2024 Marvell International Ltd. > + */ > + > +#include "graph_private.h" Internal header files, move after public header files. > +#include <rte_graph_feature_arc_worker.h> > +#include <rte_malloc.h> > + > +#define __RTE_GRAPH_FEATURE_ARC_MAX 32 Internal symbols may not need __RTE_... > + > +#define ARC_PASSIVE_LIST(arc) (arc->active_feature_list ^ 0x1) > + > +#define rte_graph_uint_cast(x) ((unsigned int)x) Internal symbols may not need rte_ > +#define feat_dbg graph_err > + > +rte_graph_feature_arc_main_t *__feature_arc_main; No global variables, please. It will break the multiprocess. use memzone_lookup() scheme instead. > + > +/* Make sure fast path cache line is compact */ > +_Static_assert((offsetof(struct rte_graph_feature_arc, slow_path_variables) > + - offsetof(struct rte_graph_feature_arc, fast_path_variables)) > + <= RTE_CACHE_LINE_SIZE); use static_assert or RTE_BUILD_BUG_ON from rte_common.h > + > diff --git a/lib/graph/meson.build b/lib/graph/meson.build > index 0cb15442ab..d916176fb7 100644 > --- a/lib/graph/meson.build > +++ b/lib/graph/meson.build > @@ -14,11 +14,13 @@ sources = files( > 'graph_debug.c', > 'graph_stats.c', > 'graph_populate.c', > + 'graph_feature_arc.c', > 'graph_pcap.c', > 'rte_graph_worker.c', > 'rte_graph_model_mcore_dispatch.c', > ) > headers = files('rte_graph.h', 'rte_graph_worker.h') > +headers += files('rte_graph_feature_arc.h', 'rte_graph_feature_arc_worker.h') > indirect_headers += files( > 'rte_graph_model_mcore_dispatch.h', > 'rte_graph_model_rtc.h', > diff --git a/lib/graph/rte_graph_feature_arc.h > b/lib/graph/rte_graph_feature_arc.h > new file mode 100644 > index 0000000000..e3bf4eb73d > --- /dev/null > +++ b/lib/graph/rte_graph_feature_arc.h > @@ -0,0 +1,373 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2024 Marvell International Ltd. > + */ > + > +#ifndef _RTE_GRAPH_FEATURE_ARC_H_ > +#define _RTE_GRAPH_FEATURE_ARC_H_ > + > +#include <assert.h> > +#include <errno.h> > +#include <signal.h> > +#include <stddef.h> > +#include <stdint.h> > +#include <stdio.h> > +#include <stdlib.h> > +#include <string.h> > + > +#include <rte_common.h> > +#include <rte_compat.h> > +#include <rte_debug.h> > +#include <rte_graph.h> > +#include <rte_graph_worker.h> > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +/** > + * @file > + * > + * rte_graph_feature_arc.h Not yet reviewed the full API spec, will do a bit later.