From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 605F443B64; Wed, 21 Feb 2024 17:26:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3183140685; Wed, 21 Feb 2024 17:26:24 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 95173402CE for ; Wed, 21 Feb 2024 17:26:21 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41LF7hW3007963; Wed, 21 Feb 2024 08:26:21 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= pfpt0220; bh=T7I1xto+LXgIR45RR8YCBH3IVze2msLGxo+inOHK2eA=; b=Unn nHGRDBwv1PLDSEVlj9h8raLE4jBZrBKpQpHE9W0sYwiyZ/PhQuxfGBHMp813jq4E mbhSa+g9C6G/dl8jSJMrf7D2d5xDIJ/DKmxIzqKxVadwhQjwC6vcmCu7Adv7/vlE NwkUjYfTfw7xpoWFvIcuDGJ9V5IdLe5m/iFIdxiAB9cEFW6qxY6iy1O/US1xM3KZ exBMRRlSZeh0kdlIyGOT+WP+LFKKBs8kFPZct+nQVbZjyjKmoJSqZ9akJaxdnDK9 jnZXaVxOBnYUnr7G9uPRrpINVPQgU+hIffQQl+8jIU20zG9+eMTBc9DdzkSjgI5s hu2T6tTuXGOTkieW45A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wd21kcmn3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 08:26:20 -0800 (PST) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 21 Feb 2024 08:26:18 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Wed, 21 Feb 2024 08:26:18 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 21 Feb 2024 08:26:18 -0800 Received: from MININT-80QBFE8.corp.innovium.com (unknown [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id B8F343F70B6; Wed, 21 Feb 2024 08:26:14 -0800 (PST) From: To: , , , CC: , Pavan Nikhilesh Subject: [PATCH 2/5] graph: add node fastpath error counters Date: Wed, 21 Feb 2024 21:56:05 +0530 Message-ID: <20240221162608.10412-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240221162608.10412-1-pbhagavatula@marvell.com> References: <20240221162608.10412-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: 00Ga4LHS1_y0qgr3AQPpf2Gq5awulb6s X-Proofpoint-ORIG-GUID: 00Ga4LHS1_y0qgr3AQPpf2Gq5awulb6s X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-21_03,2024-02-21_02,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Pavan Nikhilesh Add node fastpath error counters advertised during node registration. Signed-off-by: Pavan Nikhilesh --- lib/graph/graph_populate.c | 22 +++++++++++++++++++--- lib/graph/graph_private.h | 2 ++ lib/graph/rte_graph_worker_common.h | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/graph/graph_populate.c b/lib/graph/graph_populate.c index ed596a7711..924f5a3034 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; } @@ -228,7 +244,7 @@ graph_nodes_mem_destroy(struct rte_graph *graph) if (graph == NULL) return; - rte_graph_foreach_node(count, off, graph, node) + rte_graph_foreach_node (count, off, graph, node) rte_free(node->objs); } diff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h index eb4d461c6e..a185a5a4ea 100644 --- a/lib/graph/graph_private.h +++ b/lib/graph/graph_private.h @@ -104,6 +104,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 4045a7a8dc..b58f37c734 100644 --- a/lib/graph/rte_graph_worker_common.h +++ b/lib/graph/rte_graph_worker_common.h @@ -107,6 +107,7 @@ struct 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 uint8_t ctx[RTE_NODE_CTX_SZ] __rte_cache_aligned; /**< Node Context. */ -- 2.25.1