From: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>,
Jerin Jacob <jerinj@marvell.com>,
Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
"zhirun.yan@intel.com" <zhirun.yan@intel.com>,
Zhirun Yan <yanzhirun_163@163.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
Subject: RE: [PATCH v4 2/5] graph: add node fastpath error counters
Date: Thu, 22 Aug 2024 06:37:34 +0000 [thread overview]
Message-ID: <PH0PR18MB5071C9F64637B73EA1719243AC8F2@PH0PR18MB5071.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20240816150926.5789-2-pbhagavatula@marvell.com>
> -----Original Message-----
> From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
> Sent: Friday, August 16, 2024 8:39 PM
> To: Jerin Jacob <jerinj@marvell.com>; Nithin Kumar Dabilpuram
> <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda
> <kirankumark@marvell.com>; zhirun.yan@intel.com; Zhirun Yan
> <yanzhirun_163@163.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
> Subject: [PATCH v4 2/5] graph: add node fastpath error counters
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add node fastpath error counters advertised during node registration.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
Acked-by: Kiran Kumar Kokkilagadda <kirankumark@marvell.com>
> lib/graph/graph_populate.c | 20 ++++++++++++++++++--
> lib/graph/graph_private.h | 2 ++
> lib/graph/rte_graph_worker_common.h | 1 +
> 3 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/lib/graph/graph_populate.c b/lib/graph/graph_populate.c index
> ed596a7711..9c4c919e14 100644
> --- a/lib/graph/graph_populate.c
> +++ b/lib/graph/graph_populate.c
> @@ -39,6 +39,15 @@ graph_fp_mem_calc_size(struct graph *graph)
> /* Pointer to next nodes(edges) */
> sz += sizeof(struct rte_node *) * graph_node->node->nb_edges;
> }
> + sz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE);
> + graph->errors_start = sz;
> + /* For 0..N node objects with error counters */
> + STAILQ_FOREACH(graph_node, &graph->node_list, next) {
> + if (graph_node->node->errs == NULL)
> + continue;
> + sz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE);
> + sz += sizeof(uint64_t) * graph_node->node->errs->nb_errors;
> + }
>
> graph->mem_sz = sz;
> return sz;
> @@ -64,6 +73,7 @@ graph_header_popluate(struct graph *_graph) static void
> graph_nodes_populate(struct graph *_graph) {
> + rte_graph_off_t err_off = _graph->errors_start;
> rte_graph_off_t off = _graph->nodes_start;
> struct rte_graph *graph = _graph->graph;
> struct graph_node *graph_node;
> @@ -99,6 +109,12 @@ graph_nodes_populate(struct graph *_graph)
> ->adjacency_list[count]
> ->node->name[0];
>
> + if (graph_node->node->errs != NULL) {
> + node->err_off = err_off - off;
> + err_off += sizeof(uint64_t) * graph_node->node->errs-
> >nb_errors;
> + err_off = RTE_ALIGN(err_off, RTE_CACHE_LINE_SIZE);
> + }
> +
> off += sizeof(struct rte_node *) * nb_edges;
> off = RTE_ALIGN(off, RTE_CACHE_LINE_SIZE);
> node->next = off;
> @@ -158,7 +174,7 @@ graph_node_nexts_populate(struct graph *_graph) }
>
> static int
> -graph_src_nodes_populate(struct graph *_graph)
> +graph_src_nodes_offset_populate(struct graph *_graph)
> {
> struct rte_graph *graph = _graph->graph;
> struct graph_node *graph_node;
> @@ -193,7 +209,7 @@ graph_fp_mem_populate(struct graph *graph)
> graph_pcap_init(graph);
> graph_nodes_populate(graph);
> rc = graph_node_nexts_populate(graph);
> - rc |= graph_src_nodes_populate(graph);
> + rc |= graph_src_nodes_offset_populate(graph);
>
> return rc;
> }
> diff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h index
> e663b04d8b..01921b254c 100644
> --- a/lib/graph/graph_private.h
> +++ b/lib/graph/graph_private.h
> @@ -103,6 +103,8 @@ struct graph {
> /**< Memzone to store graph data. */
> rte_graph_off_t nodes_start;
> /**< Node memory start offset in graph reel. */
> + rte_graph_off_t errors_start;
> + /**< Node error memory start offset in graph reel. */
> rte_node_t src_node_count;
> /**< Number of source nodes in a graph. */
> struct rte_graph *graph;
> diff --git a/lib/graph/rte_graph_worker_common.h
> b/lib/graph/rte_graph_worker_common.h
> index 36d864e2c1..fa59d40f57 100644
> --- a/lib/graph/rte_graph_worker_common.h
> +++ b/lib/graph/rte_graph_worker_common.h
> @@ -110,6 +110,7 @@ struct __rte_cache_aligned rte_node {
> uint64_t total_sched_fail; /**< Number of scheduled
> failure. */
> } dispatch;
> };
> + rte_graph_off_t err_off; /**< Offset to error counters. */
> /* Fast path area */
> #define RTE_NODE_CTX_SZ 16
> alignas(RTE_CACHE_LINE_SIZE) uint8_t ctx[RTE_NODE_CTX_SZ]; /**<
> Node Context. */
> --
> 2.25.1
next prev parent reply other threads:[~2024-08-22 6:37 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-21 16:26 [PATCH 1/5] graph: add support for node specific errors pbhagavatula
2024-02-21 16:26 ` [PATCH 2/5] graph: add node fastpath error counters pbhagavatula
2024-02-21 16:26 ` [PATCH 3/5] graph: add stats for node specific errors pbhagavatula
2024-02-21 16:26 ` [PATCH 4/5] node: add error stats for ip4 lookup node pbhagavatula
2024-02-21 16:26 ` [PATCH 5/5] node: add error stats for ip4 reassembly node pbhagavatula
2024-02-22 5:36 ` [24.11 PATCH v2 1/5] graph: add support for node specific errors pbhagavatula
2024-02-22 5:36 ` [24.11 PATCH v2 2/5] graph: add node fastpath error counters pbhagavatula
2024-02-22 5:36 ` [24.11 PATCH v2 3/5] graph: add stats for node specific errors pbhagavatula
2024-02-22 5:36 ` [24.11 PATCH v2 4/5] node: add error stats for ip4 lookup node pbhagavatula
2024-02-22 5:36 ` [24.11 PATCH v2 5/5] node: add error stats for ip4 reassembly node pbhagavatula
2024-02-22 12:23 ` [24.11 PATCH v3 1/5] graph: add support for node specific errors pbhagavatula
2024-02-22 12:23 ` [24.11 PATCH v3 2/5] graph: add node fastpath error counters pbhagavatula
2024-02-23 7:15 ` Yan, Zhirun
2024-02-22 12:23 ` [24.11 PATCH v3 3/5] graph: add stats for node specific errors pbhagavatula
2024-02-22 12:23 ` [24.11 PATCH v3 4/5] node: add error stats for ip4 lookup node pbhagavatula
2024-02-23 7:18 ` Yan, Zhirun
2024-02-26 7:46 ` Pavan Nikhilesh Bhagavatula
2024-02-22 12:23 ` [24.11 PATCH v3 5/5] node: add error stats for ip4 reassembly node pbhagavatula
2024-02-23 7:13 ` [24.11 PATCH v3 1/5] graph: add support for node specific errors Yan, Zhirun
2024-02-26 7:49 ` Pavan Nikhilesh Bhagavatula
2024-08-16 15:09 ` [PATCH v4 " pbhagavatula
2024-08-16 15:09 ` [PATCH v4 2/5] graph: add node fastpath error counters pbhagavatula
2024-08-22 6:37 ` Kiran Kumar Kokkilagadda [this message]
2024-08-16 15:09 ` [PATCH v4 3/5] graph: add stats for node specific errors pbhagavatula
2024-08-22 6:37 ` Kiran Kumar Kokkilagadda
2024-08-16 15:09 ` [PATCH v4 4/5] node: add error stats for ip4 lookup node pbhagavatula
2024-08-22 6:38 ` Kiran Kumar Kokkilagadda
2024-08-16 15:09 ` [PATCH v4 5/5] node: add error stats for ip4 reassembly node pbhagavatula
2024-08-22 6:38 ` Kiran Kumar Kokkilagadda
2024-08-22 6:37 ` [PATCH v4 1/5] graph: add support for node specific errors Kiran Kumar Kokkilagadda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PH0PR18MB5071C9F64637B73EA1719243AC8F2@PH0PR18MB5071.namprd18.prod.outlook.com \
--to=kirankumark@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=pbhagavatula@marvell.com \
--cc=yanzhirun_163@163.com \
--cc=zhirun.yan@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).