From patchwork Thu Feb 22 05:36:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 137320 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83F2543C03; Tue, 27 Feb 2024 07:02:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 620D342E57; Tue, 27 Feb 2024 07:02:31 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id EF9FB40281 for ; Thu, 22 Feb 2024 06:37:22 +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 41M42unN016559; Wed, 21 Feb 2024 21:37:22 -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=PJCBqm/PHSesEOkJ8K1jgEuDtsNoek6u8FgKK0r9bFk=; b=Ol/ AgcpftMTh8UeuBDggLBqggEzJW/ZHOT1a0Kj7i7r38QZRZIg7AANXDvoTa2HPHot aATFjr06a5AfSt/+B4hkwI+MxgRoGQvo8Vm8oNWKR18mhmDr80AN6MvD+4rx+dMt J2buentT2kO9FND+t/IRdSPtZOV8VhTxHA0hKYdos0R9neI++PzFe+brg6mfZvF6 uI5AwkHtu3O+TfzcVlNv3RWcHy380YO2+d1JtB/tbfFErePkmBt/i6S+OhUw14B4 NruRqosn7pIK3MPwfg9YZOd2T/bnjgQ7ch5CtTO18NZmwr64D7r7pt/ZmrF9QjcI H2GiOWqi4tUXXSQhQdA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wd21kf9py-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 21:37:20 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 21 Feb 2024 21:36:51 -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 21:36:51 -0800 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.8.42]) by maili.marvell.com (Postfix) with ESMTP id 429F03F70A7; Wed, 21 Feb 2024 21:36:47 -0800 (PST) From: To: , , , CC: , Pavan Nikhilesh Subject: [24.11 PATCH v2 1/5] graph: add support for node specific errors Date: Thu, 22 Feb 2024 11:06:35 +0530 Message-ID: <20240222053639.15057-1-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 X-Proofpoint-GUID: PNklPWYYfqaTaC5EPpufQePdKJKZw7oo X-Proofpoint-ORIG-GUID: PNklPWYYfqaTaC5EPpufQePdKJKZw7oo 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-22_03,2024-02-22_01,2023-05-22_02 X-Mailman-Approved-At: Tue, 27 Feb 2024 07:02:24 +0100 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 ability for Nodes to advertise error counters during registration. Signed-off-by: Pavan Nikhilesh --- v2 Changes: - Fix compilation doc/guides/prog_guide/graph_lib.rst | 22 +- .../prog_guide/img/anatomy_of_a_node.svg | 329 +++++-- .../prog_guide/img/graph_mem_layout.svg | 921 +++++++++++++----- lib/graph/graph_private.h | 1 + lib/graph/node.c | 37 +- lib/graph/rte_graph.h | 7 + 6 files changed, 1016 insertions(+), 301 deletions(-) -- 2.25.1 diff --git a/doc/guides/prog_guide/graph_lib.rst b/doc/guides/prog_guide/graph_lib.rst index ad09bdfe26..018900caea 100644 --- a/doc/guides/prog_guide/graph_lib.rst +++ b/doc/guides/prog_guide/graph_lib.rst @@ -21,6 +21,7 @@ Features of the Graph library are: - Nodes as plugins. - Support for out of tree nodes. - Inbuilt nodes for packet processing. +- Node specific error counts. - Multi-process support. - Low overhead graph walk and node enqueue. - Low overhead statistics collection infrastructure. @@ -124,6 +125,18 @@ Source nodes are static nodes created using ``RTE_NODE_REGISTER`` by passing While performing the graph walk, the ``process()`` function of all the source nodes will be called first. So that these nodes can be used as input nodes for a graph. +nb_errors: +^^^^^^^^^^ + +The number of errors that this node can report. The ``err_desc[]`` stores the error +descriptions which will later be propagated to stats. + +err_desc[]: +^^^^^^^^^^^ + +The dynamic array to store the error descriptions that will be reported by this +node. + Node creation and registration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Node implementer creates the node by implementing ops and attributes of @@ -141,13 +154,13 @@ Link the Nodes to create the graph topology Topology after linking the nodes Once nodes are available to the program, Application or node public API -functions can links them together to create a complex packet processing graph. +functions can link them together to create a complex packet processing graph. There are multiple different types of strategies to link the nodes. Method (a): ^^^^^^^^^^^ -Provide the ``next_nodes[]`` at the node registration time. See ``struct rte_node_register::nb_edges``. +Provide the ``next_nodes[]`` at the node registration time. See ``struct rte_node_register::nb_edges``. This is a use case to address the static node scheme where one knows upfront the ``next_nodes[]`` of the node. @@ -385,8 +398,9 @@ Understanding the memory layout helps to debug the graph library and improve the performance if needed. Graph object consists of a header, circular buffer to store the pending -stream when walking over the graph, and variable-length memory to store -the ``rte_node`` objects. +stream when walking over the graph, variable-length memory to store +the ``rte_node`` objects, and variable-length memory to store the errors +reported by each ``rte_node``. The graph_nodes_mem_create() creates and populate this memory. The functions such as ``rte_graph_walk()`` and ``rte_node_enqueue_*`` use this memory diff --git a/doc/guides/prog_guide/img/anatomy_of_a_node.svg b/doc/guides/prog_guide/img/anatomy_of_a_node.svg index d3bc742e77..29818e267b 100644 --- a/doc/guides/prog_guide/img/anatomy_of_a_node.svg +++ b/doc/guides/prog_guide/img/anatomy_of_a_node.svg @@ -3,13 +3,6 @@ + inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> @@ -27,12 +27,51 @@ image/svg+xml - + + id="defs423"> + + + + + + + + + + inkscape:current-layer="g417" + inkscape:showpageshadow="2" + inkscape:pagecheckerboard="0" + inkscape:deskcolor="#d1d1d1" + inkscape:lockguides="true" /> + style="fill:#ffffff;fill-rule:evenodd;fill-opacity:1" /> @@ -90,87 +133,92 @@ inkscape:connector-curvature="0" style="fill-rule:evenodd;stroke:#c27ba0;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:4, 3, 1, 3" /> + style="fill-rule:nonzero;stroke:#1155cc;stroke-width:0.99953708;stroke-linecap:butt;stroke-dasharray:none" /> + @@ -275,32 +323,37 @@ inkscape:connector-curvature="0" style="fill:#000000;fill-opacity:0;fill-rule:evenodd" /> + @@ -975,10 +1028,11 @@ inkscape:connector-curvature="0" style="fill:#000000;fill-opacity:0;fill-rule:evenodd" /> + style="fill-rule:evenodd;stroke:#595959;stroke-width:1.2253;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:9.80238, 3.67589" + sodipodi:nodetypes="cssscc" /> + style="fill-rule:evenodd;stroke:#595959;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:8, 3" + sodipodi:nodetypes="cssscc" /> + style="fill-rule:evenodd;stroke:#595959;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:8, 3" + sodipodi:nodetypes="cssc" /> @@ -1020,10 +1076,11 @@ inkscape:connector-curvature="0" style="fill:#000000;fill-opacity:0;fill-rule:evenodd" /> + style="fill-rule:evenodd;stroke:#595959;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:8, 3" + sodipodi:nodetypes="cssssscc" /> + + + + + + + nb_errors + Error 1 + Error 2 + Error 3 + Error n + + + + + + diff --git a/doc/guides/prog_guide/img/graph_mem_layout.svg b/doc/guides/prog_guide/img/graph_mem_layout.svg index 1d41729c9c..042c7fcb0d 100644 --- a/doc/guides/prog_guide/img/graph_mem_layout.svg +++ b/doc/guides/prog_guide/img/graph_mem_layout.svg @@ -3,700 +3,1141 @@ - - - - image/svg+xml - - - - - - + id="svg1" + inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)" + sodipodi:docname="graph_mem_layout.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> - - - + inkscape:current-layer="layer1"> + + + + + + + + + + + + + + + + + + + + + + + - - - + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + + + + + id="path286" + style="fill:none" /> + + + id="path338" + style="fill:none" /> + + + + + + + + Node 1 Errors + Node 1 + Error 1 + Error 1 + Error 1 + Error 2 + Error 2 + Error 2 + Error N + Error 3 + Error 3 + Error 4 + Node 4 + Node 8 + Node N + Node 4 Errors + Node 8 Errors + Node N Errors + + rte_node error memory layout + + + + + + + + + + + + diff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h index fb88d4bc84..eb4d461c6e 100644 --- a/lib/graph/graph_private.h +++ b/lib/graph/graph_private.h @@ -62,6 +62,7 @@ struct node { rte_node_t id; /**< Allocated identifier for the node. */ rte_node_t parent_id; /**< Parent node identifier. */ rte_edge_t nb_edges; /**< Number of edges from this node. */ + struct rte_node_errors *errs; /**< Node specific errors. */ char next_nodes[][RTE_NODE_NAMESIZE]; /**< Names of next nodes. */ }; diff --git a/lib/graph/node.c b/lib/graph/node.c index 99a9622779..be96005a9e 100644 --- a/lib/graph/node.c +++ b/lib/graph/node.c @@ -85,9 +85,24 @@ __rte_node_register(const struct rte_node_register *reg) goto fail; } + if (reg->errs) { + sz = sizeof(*reg->errs) + (reg->errs->nb_errors * RTE_NODE_ERROR_DESC_SIZE); + node->errs = calloc(1, sz); + if (node->errs == NULL) { + rte_errno = ENOMEM; + goto free; + } + + node->errs->nb_errors = reg->errs->nb_errors; + for (i = 0; i < reg->errs->nb_errors; i++) + if (rte_strscpy(node->errs->err_desc[i], reg->errs->err_desc[i], + RTE_NODE_ERROR_DESC_SIZE) < 0) + goto free_err; + } + /* Initialize the node */ if (rte_strscpy(node->name, reg->name, RTE_NODE_NAMESIZE) < 0) - goto free; + goto free_err; node->flags = reg->flags; node->process = reg->process; node->init = reg->init; @@ -97,7 +112,7 @@ __rte_node_register(const struct rte_node_register *reg) for (i = 0; i < reg->nb_edges; i++) { if (rte_strscpy(node->next_nodes[i], reg->next_nodes[i], RTE_NODE_NAMESIZE) < 0) - goto free; + goto free_err; } node->lcore_id = RTE_MAX_LCORE; @@ -108,6 +123,8 @@ __rte_node_register(const struct rte_node_register *reg) graph_spinlock_unlock(); return node->id; +free_err: + free(node->errs); free: free(node); fail: @@ -134,6 +151,20 @@ node_clone(struct node *node, const char *name) goto fail; } + if (node->errs) { + reg->errs = calloc(1, sizeof(*node->errs) + + (node->errs->nb_errors * RTE_NODE_ERROR_DESC_SIZE)); + if (reg->errs == NULL) { + rte_errno = ENOMEM; + goto fail; + } + + for (i = 0; i < node->errs->nb_errors; i++) + if (rte_strscpy(reg->errs->err_desc[i], node->errs->err_desc[i], + RTE_NODE_ERROR_DESC_SIZE) < 0) + goto free_err; + } + /* Clone the source node */ reg->flags = node->flags; reg->process = node->process; @@ -150,6 +181,8 @@ node_clone(struct node *node, const char *name) goto free; rc = __rte_node_register(reg); +free_err: + free(reg->errs); free: free(reg); fail: diff --git a/lib/graph/rte_graph.h b/lib/graph/rte_graph.h index 2d37d5e0d6..70b68673c1 100644 --- a/lib/graph/rte_graph.h +++ b/lib/graph/rte_graph.h @@ -29,6 +29,7 @@ extern "C" { #define RTE_GRAPH_NAMESIZE 64 /**< Max length of graph name. */ #define RTE_NODE_NAMESIZE 64 /**< Max length of node name. */ +#define RTE_NODE_ERROR_DESC_SIZE 64 /**< Max length of node name. */ #define RTE_GRAPH_PCAP_FILE_SZ 64 /**< Max length of pcap file name. */ #define RTE_GRAPH_OFF_INVALID UINT32_MAX /**< Invalid graph offset. */ #define RTE_NODE_ID_INVALID UINT32_MAX /**< Invalid node id. */ @@ -460,6 +461,11 @@ void rte_graph_cluster_stats_get(struct rte_graph_cluster_stats *stat, */ void rte_graph_cluster_stats_reset(struct rte_graph_cluster_stats *stat); +struct rte_node_errors { + uint16_t nb_errors; /**< Number of errors. */ + char err_desc[][RTE_NODE_ERROR_DESC_SIZE]; /**< Names of errors. */ +}; + /** * Structure defines the node registration parameters. * @@ -472,6 +478,7 @@ struct rte_node_register { rte_node_process_t process; /**< Node process function. */ rte_node_init_t init; /**< Node init function. */ rte_node_fini_t fini; /**< Node fini function. */ + struct rte_node_errors *errs; /**< Node specific errors. */ rte_node_t id; /**< Node Identifier. */ rte_node_t parent_id; /**< Identifier of parent node. */ rte_edge_t nb_edges; /**< Number of edges from this node. */ From patchwork Thu Feb 22 05:36:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 136989 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E005543B68; Thu, 22 Feb 2024 06:37:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9166402DE; Thu, 22 Feb 2024 06:37:23 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 4633840281 for ; Thu, 22 Feb 2024 06:37: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 41LNpFnH007495; Wed, 21 Feb 2024 21:37:20 -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=U1JdzU2Hxor7ineRp9RJQ9HYQSKQf+d1EHPrUdTc+JI=; b=O8k QMSJjr+Ryo++b91GVTC874IFBgmg/i6EwAay4Wgql+VcP3C3bpdFwyjqFmh/gWwu HjvWw1jnOt6QBjl4nb6Zr4Gp4YXCfg9ZDvu8q6lxW08oy8nd4EEMn7PnqISI4R9Y XF1olLkDCAVLAxwfJnE4FcAJNSQyWvo8SLYgpsxEBsr1OVRIEhl6taHlMep5hBmX YORjEiWjSN4VeMFuQya9AopD/raqHy7F2iyqjkiGBbAd46yEV34NCiAL9vWT2W1r oczVkvQ+mWGrztmeYyWxsKjPsD5g16kb1Wi+alO5xYjFa/TcrLHrSMwh+WR/mLir /SgSh6PnNKVq5pLS2Fg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wd21kf9q0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 21:37:20 -0800 (PST) Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 21 Feb 2024 21:36:54 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 21 Feb 2024 21:36:54 -0800 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.8.42]) by maili.marvell.com (Postfix) with ESMTP id 1A7A73F70AA; Wed, 21 Feb 2024 21:36:51 -0800 (PST) From: To: , , , CC: , Pavan Nikhilesh Subject: [24.11 PATCH v2 2/5] graph: add node fastpath error counters Date: Thu, 22 Feb 2024 11:06:36 +0530 Message-ID: <20240222053639.15057-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240222053639.15057-1-pbhagavatula@marvell.com> References: <20240221162608.10412-1-pbhagavatula@marvell.com> <20240222053639.15057-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: 3oiFkduCQ0Rrj02kDh7f20e1S85biKQz X-Proofpoint-ORIG-GUID: 3oiFkduCQ0Rrj02kDh7f20e1S85biKQz 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-22_03,2024-02-22_01,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. */ From patchwork Thu Feb 22 05:36:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 136990 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 59BEB43B68; Thu, 22 Feb 2024 06:37:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00BA240608; Thu, 22 Feb 2024 06:37:25 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 33CCC402DA for ; Thu, 22 Feb 2024 06:37:23 +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 41LNpFnK007495; Wed, 21 Feb 2024 21:37:22 -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=zu2uSK0CYXPOFPrEI1rDf/WUnhTzA/sQOnXb8xkqw3g=; b=BG7 5qcV+EiLrxAV30NTHcRGbTBrZcCMrrehWmEvmCZmXEmCYrk3KbE/tlHwQlr/pd/W 0EX0r1yR3cclK2F1ER/AWQAgo3CjxY6azN/pLAzPVHT408YEV14jiTP1KseqJy9m 3EOHLJTJkJYNXIWIRXy3f+BRsU5SMsee3JeaEzrMJdpRtUrqPEGt7OGs4Attwwpo qwelOCs0Jsg6aHviAwckXCSQE8oV+FTS+0oqBEGKRSv1eWD4pfeXToBYzhTNuhtb sQfno9i4LANb/PfpjGRtSPgbsX1ElofaY9Eja2BqxIPx9ZrrT3Ny8SpHJBjE8uvz Wlu36L1NSXWuFZhagQw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wd21kf9q0-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 21:37:22 -0800 (PST) Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 21 Feb 2024 21:36:56 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 21 Feb 2024 21:36:56 -0800 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.8.42]) by maili.marvell.com (Postfix) with ESMTP id A112B3F70A7; Wed, 21 Feb 2024 21:36:54 -0800 (PST) From: To: , , , CC: , Pavan Nikhilesh Subject: [24.11 PATCH v2 3/5] graph: add stats for node specific errors Date: Thu, 22 Feb 2024 11:06:37 +0530 Message-ID: <20240222053639.15057-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240222053639.15057-1-pbhagavatula@marvell.com> References: <20240221162608.10412-1-pbhagavatula@marvell.com> <20240222053639.15057-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: qJm9bYAINN69TpKfPPMB8Hiap8RP3e2v X-Proofpoint-ORIG-GUID: qJm9bYAINN69TpKfPPMB8Hiap8RP3e2v 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-22_03,2024-02-22_01,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 support for retrieving/printing stats for node specific errors using rte_graph_cluster_stats_get(). Signed-off-by: Pavan Nikhilesh --- lib/graph/graph_stats.c | 81 ++++++++++++++++++++++++++++++++++++++++- lib/graph/rte_graph.h | 4 ++ 2 files changed, 84 insertions(+), 1 deletion(-) diff --git a/lib/graph/graph_stats.c b/lib/graph/graph_stats.c index cc32245c05..7e026f0c68 100644 --- a/lib/graph/graph_stats.c +++ b/lib/graph/graph_stats.c @@ -122,6 +122,26 @@ print_node(FILE *f, const struct rte_graph_cluster_node_stats *stat) } } +static inline void +print_err(FILE *f, const struct rte_graph_cluster_node_stats *stat) +{ + int i; + + if (rte_graph_worker_model_get(STAILQ_FIRST(graph_list_head_get())->graph) == + RTE_GRAPH_MODEL_MCORE_DISPATCH) { + for (i = 0; i < stat->node_error_cntrs; i++) + fprintf(f, + "|\t%-24s|%15s|%-15" PRIu64 "|%15s|%15s|%15s|%15s|%15s|%11.4s|\n", + stat->node_error_desc[i], "", stat->node_error_count[i], "", "", "", + "", "", ""); + } else { + for (i = 0; i < stat->node_error_cntrs; i++) + fprintf(f, "|\t%-24s|%15s|%-15" PRIu64 "|%15s|%15.3s|%15.6s|%11.4s|\n", + stat->node_error_desc[i], "", stat->node_error_count[i], "", "", "", + ""); + } +} + static int graph_cluster_stats_cb(bool is_first, bool is_last, void *cookie, const struct rte_graph_cluster_node_stats *stat) @@ -133,8 +153,11 @@ graph_cluster_stats_cb(bool is_first, bool is_last, void *cookie, if (unlikely(is_first)) print_banner(f); - if (stat->objs) + if (stat->objs) { print_node(f, stat); + if (stat->node_error_cntrs) + print_err(f, stat); + } if (unlikely(is_last)) { if (model == RTE_GRAPH_MODEL_MCORE_DISPATCH) boarder_model_dispatch(); @@ -188,6 +211,7 @@ stats_mem_populate(struct rte_graph_cluster_stats **stats_in, struct cluster_node *cluster; struct rte_node *node; rte_node_t count; + uint8_t i; cluster = stats->clusters; @@ -225,6 +249,36 @@ stats_mem_populate(struct rte_graph_cluster_stats **stats_in, SET_ERR_JMP(ENOENT, free, "Failed to find node %s in graph %s", graph_node->node->name, graph->name); cluster->nodes[cluster->nb_nodes++] = node; + if (graph_node->node->errs) { + cluster->stat.node_error_cntrs = graph_node->node->errs->nb_errors; + cluster->stat.node_error_count = rte_zmalloc_socket( + NULL, sizeof(uint64_t) * graph_node->node->errs->nb_errors, + RTE_CACHE_LINE_SIZE, stats->socket_id); + if (cluster->stat.node_error_count == NULL) + SET_ERR_JMP(ENOMEM, free, "Failed to allocate memory node %s graph %s", + graph_node->node->name, graph->name); + + cluster->stat.node_error_desc = rte_zmalloc_socket( + NULL, sizeof(RTE_NODE_ERROR_DESC_SIZE) * graph_node->node->errs->nb_errors, + RTE_CACHE_LINE_SIZE, stats->socket_id); + if (cluster->stat.node_error_desc == NULL) { + rte_free(cluster->stat.node_error_count); + SET_ERR_JMP(ENOMEM, free, "Failed to allocate memory node %s graph %s", + graph_node->node->name, graph->name); + } + + for (i = 0; i < cluster->stat.node_error_cntrs; i++) { + if (rte_strscpy(cluster->stat.node_error_desc[i], + graph_node->node->errs->err_desc[i], + RTE_NODE_ERROR_DESC_SIZE) < 0) { + rte_free(cluster->stat.node_error_count); + rte_free(cluster->stat.node_error_desc); + SET_ERR_JMP(E2BIG, free, + "Error description overflow node %s graph %s", + graph_node->node->name, graph->name); + } + } + } stats->sz += stats->cluster_node_size; stats->max_nodes++; @@ -371,6 +425,18 @@ rte_graph_cluster_stats_create(const struct rte_graph_cluster_stats_param *prm) void rte_graph_cluster_stats_destroy(struct rte_graph_cluster_stats *stat) { + struct cluster_node *cluster; + rte_node_t count; + + cluster = stat->clusters; + for (count = 0; count < stat->max_nodes; count++) { + if (cluster->stat.node_error_cntrs) { + rte_free(cluster->stat.node_error_count); + rte_free(cluster->stat.node_error_desc); + } + + cluster = RTE_PTR_ADD(cluster, stat->cluster_node_size); + } return rte_free(stat); } @@ -382,9 +448,13 @@ cluster_node_arregate_stats(struct cluster_node *cluster) uint64_t sched_objs = 0, sched_fail = 0; struct rte_node *node; rte_node_t count; + uint64_t *err; + uint8_t i; int model; model = rte_graph_worker_model_get(STAILQ_FIRST(graph_list_head_get())->graph); + + memset(stat->node_error_count, 0, sizeof(uint64_t) * stat->node_error_cntrs); for (count = 0; count < cluster->nb_nodes; count++) { node = cluster->nodes[count]; @@ -397,6 +467,12 @@ cluster_node_arregate_stats(struct cluster_node *cluster) objs += node->total_objs; cycles += node->total_cycles; realloc_count += node->realloc_count; + + if (node->err_off == 0) + continue; + err = RTE_PTR_ADD(node, node->err_off); + for (i = 0; i < stat->node_error_cntrs; i++) + stat->node_error_count[i] += err[i]; } stat->calls = calls; @@ -449,6 +525,7 @@ rte_graph_cluster_stats_reset(struct rte_graph_cluster_stats *stat) { struct cluster_node *cluster; rte_node_t count; + uint8_t i; cluster = stat->clusters; @@ -464,6 +541,8 @@ rte_graph_cluster_stats_reset(struct rte_graph_cluster_stats *stat) node->prev_objs = 0; node->prev_cycles = 0; node->realloc_count = 0; + for (i = 0; i < node->node_error_cntrs; i++) + node->node_error_count[i] = 0; cluster = RTE_PTR_ADD(cluster, stat->cluster_node_size); } } diff --git a/lib/graph/rte_graph.h b/lib/graph/rte_graph.h index 70b68673c1..35f4c8db0c 100644 --- a/lib/graph/rte_graph.h +++ b/lib/graph/rte_graph.h @@ -223,6 +223,10 @@ struct rte_graph_cluster_node_stats { uint64_t realloc_count; /**< Realloc count. */ + uint8_t node_error_cntrs; /**< Number of Node error counters. */ + char (*node_error_desc)[RTE_NODE_ERROR_DESC_SIZE]; /**< Names of the Node error counters. */ + uint64_t *node_error_count; /**< Total error count per each error. */ + rte_node_t id; /**< Node identifier of stats. */ uint64_t hz; /**< Cycles per seconds. */ char name[RTE_NODE_NAMESIZE]; /**< Name of the node. */ From patchwork Thu Feb 22 05:36:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 136992 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DF26743B68; Thu, 22 Feb 2024 06:37:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1F974069F; Thu, 22 Feb 2024 06:37:27 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 1A2F94067D for ; Thu, 22 Feb 2024 06:37:25 +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 41LNpFnL007495; Wed, 21 Feb 2024 21:37:23 -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=Ue9s3Yb5WJTtRXNzT2xg0xDUojBfdpUtf+CYMLgEEYA=; b=EJw pW/7yknxrCJyh9LrtN6Uy1wrr7Sz6m8HF/+1HTq0OeiSv5sQfO9R0A4Gr1A0xFXn kv5czaU/uk1pBztdq7FdreFEPM6ugR+p0F0S5ANWWAFUxIJcR8IhTvIP6ZHatQl8 0dd+BaD1DUrBTHRMDR2pk7eH1J0T6PK6HQIESi5XtE7HUIKL5pEkz0R5YgeMhkaN feU2U8xaUCBsFmr74XgmqswOCFSOEg1+apAighTWUNyMIOszT1GWgu3d5B90b6Iz uZjyP8kdFGpxX1ydn/QtUfUeMtBxtAGx/XiGfpLInTlkWe6e3NbSyvVbdM6Y/9Qy IfzkvKfstLf4idpnG3w== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wd21kf9q0-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 21:37:23 -0800 (PST) Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 21 Feb 2024 21:37:00 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 21 Feb 2024 21:37:00 -0800 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.8.42]) by maili.marvell.com (Postfix) with ESMTP id 3618C3F70AB; Wed, 21 Feb 2024 21:36:56 -0800 (PST) From: To: , , , , Pavan Nikhilesh , Ruifeng Wang , "Bruce Richardson" , Konstantin Ananyev CC: Subject: [24.11 PATCH v2 4/5] node: add error stats for ip4 lookup node Date: Thu, 22 Feb 2024 11:06:38 +0530 Message-ID: <20240222053639.15057-4-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240222053639.15057-1-pbhagavatula@marvell.com> References: <20240221162608.10412-1-pbhagavatula@marvell.com> <20240222053639.15057-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: VPPNKSttsnZZglvSqxvtkku3W0GoQx-3 X-Proofpoint-ORIG-GUID: VPPNKSttsnZZglvSqxvtkku3W0GoQx-3 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-22_03,2024-02-22_01,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 error counters for ip4 LPM lookup failures in ip4_lookup node. Signed-off-by: Pavan Nikhilesh --- lib/node/ip4_lookup.c | 9 +++++++++ lib/node/ip4_lookup_neon.h | 5 +++++ lib/node/ip4_lookup_sse.h | 6 ++++++ lib/node/node_private.h | 8 ++++++++ 4 files changed, 28 insertions(+) diff --git a/lib/node/ip4_lookup.c b/lib/node/ip4_lookup.c index 18955971f6..5a7921db75 100644 --- a/lib/node/ip4_lookup.c +++ b/lib/node/ip4_lookup.c @@ -86,6 +86,7 @@ ip4_lookup_node_process_scalar(struct rte_graph *graph, struct rte_node *node, rc = rte_lpm_lookup(lpm, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop); next_hop = (rc == 0) ? next_hop : drop_nh; + NODE_INCREMENT_ERROR_ID(node, 0, (rc != 0), 1); node_mbuf_priv1(mbuf, dyn)->nh = (uint16_t)next_hop; next_hop = next_hop >> 16; @@ -219,11 +220,19 @@ ip4_lookup_node_init(const struct rte_graph *graph, struct rte_node *node) return 0; } +static struct rte_node_errors ip4_lookup_errors = { + .nb_errors = 1, + .err_desc = { + [0] = "ip4_lookup_error", + }, +}; + static struct rte_node_register ip4_lookup_node = { .process = ip4_lookup_node_process_scalar, .name = "ip4_lookup", .init = ip4_lookup_node_init, + .errs = &ip4_lookup_errors, .nb_edges = RTE_NODE_IP4_LOOKUP_NEXT_PKT_DROP + 1, .next_nodes = { diff --git a/lib/node/ip4_lookup_neon.h b/lib/node/ip4_lookup_neon.h index d5c8da3719..907c7c955a 100644 --- a/lib/node/ip4_lookup_neon.h +++ b/lib/node/ip4_lookup_neon.h @@ -116,6 +116,10 @@ ip4_lookup_node_process_vec(struct rte_graph *graph, struct rte_node *node, priv01.u16[4] = result.u16[2]; priv23.u16[0] = result.u16[4]; priv23.u16[4] = result.u16[6]; + NODE_INCREMENT_ERROR_ID(node, 0, result.u16[1] == (drop_nh >> 16), 1); + NODE_INCREMENT_ERROR_ID(node, 0, result.u16[3] == (drop_nh >> 16), 1); + NODE_INCREMENT_ERROR_ID(node, 0, result.u16[5] == (drop_nh >> 16), 1); + NODE_INCREMENT_ERROR_ID(node, 0, result.u16[7] == (drop_nh >> 16), 1); node_mbuf_priv1(mbuf0, dyn)->u = priv01.u64[0]; node_mbuf_priv1(mbuf1, dyn)->u = priv01.u64[1]; @@ -202,6 +206,7 @@ ip4_lookup_node_process_vec(struct rte_graph *graph, struct rte_node *node, &next_hop); next_hop = (rc == 0) ? next_hop : drop_nh; + NODE_INCREMENT_ERROR_ID(node, 0, (rc != 0), 1); node_mbuf_priv1(mbuf0, dyn)->nh = (uint16_t)next_hop; next_hop = next_hop >> 16; next0 = (uint16_t)next_hop; diff --git a/lib/node/ip4_lookup_sse.h b/lib/node/ip4_lookup_sse.h index 74dbf97533..a38131e629 100644 --- a/lib/node/ip4_lookup_sse.h +++ b/lib/node/ip4_lookup_sse.h @@ -115,6 +115,11 @@ ip4_lookup_node_process_vec(struct rte_graph *graph, struct rte_node *node, /* Perform LPM lookup to get NH and next node */ rte_lpm_lookupx4(lpm, dip, dst.u32, drop_nh); + NODE_INCREMENT_ERROR_ID(node, 0, dst.u16[1] == (drop_nh >> 16), 1); + NODE_INCREMENT_ERROR_ID(node, 0, dst.u16[3] == (drop_nh >> 16), 1); + NODE_INCREMENT_ERROR_ID(node, 0, dst.u16[5] == (drop_nh >> 16), 1); + NODE_INCREMENT_ERROR_ID(node, 0, dst.u16[7] == (drop_nh >> 16), 1); + /* Extract next node id and NH */ node_mbuf_priv1(mbuf0, dyn)->nh = dst.u32[0] & 0xFFFF; next0 = (dst.u32[0] >> 16); @@ -206,6 +211,7 @@ ip4_lookup_node_process_vec(struct rte_graph *graph, struct rte_node *node, rc = rte_lpm_lookup(lpm, rte_be_to_cpu_32(ipv4_hdr->dst_addr), &next_hop); next_hop = (rc == 0) ? next_hop : drop_nh; + NODE_INCREMENT_ERROR_ID(node, 0, rc != 0, 1); node_mbuf_priv1(mbuf0, dyn)->nh = next_hop & 0xFFFF; next0 = (next_hop >> 16); diff --git a/lib/node/node_private.h b/lib/node/node_private.h index 2b9bad1a11..25870f97fe 100644 --- a/lib/node/node_private.h +++ b/lib/node/node_private.h @@ -12,6 +12,8 @@ #include #include +#include + extern int rte_node_logtype; #define RTE_LOGTYPE_NODE rte_node_logtype @@ -89,4 +91,10 @@ node_mbuf_priv2(struct rte_mbuf *m) return (struct node_mbuf_priv2 *)rte_mbuf_to_priv(m); } +#define NODE_INCREMENT_ERROR_ID(node, id, cond, cnt) \ + { \ + if (unlikely(rte_graph_has_stats_feature() && (cond))) \ + ((uint64_t *)RTE_PTR_ADD(node, node->err_off))[id] += (cnt); \ + } + #endif /* __NODE_PRIVATE_H__ */ From patchwork Thu Feb 22 05:36:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 136991 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DD6C43B68; Thu, 22 Feb 2024 06:37:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 567DF40691; Thu, 22 Feb 2024 06:37:26 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 47A8C40281 for ; Thu, 22 Feb 2024 06:37:24 +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 41LNpFnM007495; Wed, 21 Feb 2024 21:37:23 -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=4Gx7EwSY8dqKnylcO/r/ruLOGqB4mZauqKrDRdZnYR4=; b=UDd 1FmhruBhVuyCRShyE7Wyh3qNNnyrE86YJqTxqAbpR4HkPtjVDjH9Du0HqT/4WtHU E/CFaB3HZ9gh1+kW6upPLKB7xRlQOqx4gjfpXDfhWz1aIgWkC4K/EMnhaeojY50m 1h/NKt7SdGlz8x/oESTbVq9qnK0TQgX3ZuB5uSZ0Mp2yKkQ3RSWhjGJk4gOpQaRk RUC5YyNASmC2tZDqPcT2awteXsU23bYBsv3jrgJE0/SCwm+DIo466TpWTHCTh7u1 Bq3geeMNlXw+OnGvRqpue9D9gbiRiWLpjIVmQ52Gj5rl+aqkIz+3tOfD1Ewb/kba mzLTCfShOur5+Lb/r9w== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3wd21kf9q0-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 21 Feb 2024 21:37:23 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 21 Feb 2024 21:37:02 -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 21:37:02 -0800 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.8.42]) by maili.marvell.com (Postfix) with ESMTP id 847A93F70AA; Wed, 21 Feb 2024 21:37:00 -0800 (PST) From: To: , , , , Pavan Nikhilesh CC: Subject: [24.11 PATCH v2 5/5] node: add error stats for ip4 reassembly node Date: Thu, 22 Feb 2024 11:06:39 +0530 Message-ID: <20240222053639.15057-5-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240222053639.15057-1-pbhagavatula@marvell.com> References: <20240221162608.10412-1-pbhagavatula@marvell.com> <20240222053639.15057-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: WRmldedmUzpCPVT87E8k-zgx6O3uZCOY X-Proofpoint-ORIG-GUID: WRmldedmUzpCPVT87E8k-zgx6O3uZCOY 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-22_03,2024-02-22_01,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 reassembly failure error counter for ip4 reassembly node. Signed-off-by: Pavan Nikhilesh --- lib/node/ip4_reassembly.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/node/ip4_reassembly.c b/lib/node/ip4_reassembly.c index 04823cc596..ab71ef1331 100644 --- a/lib/node/ip4_reassembly.c +++ b/lib/node/ip4_reassembly.c @@ -120,6 +120,7 @@ ip4_reassembly_node_process(struct rte_graph *graph, struct rte_node *node, void rte_node_next_stream_put(graph, node, RTE_NODE_IP4_REASSEMBLY_NEXT_PKT_DROP, dr->cnt); idx += dr->cnt; + NODE_INCREMENT_ERROR_ID(node, 0, dr->cnt, dr->cnt); dr->cnt = 0; } @@ -165,11 +166,19 @@ ip4_reassembly_node_init(const struct rte_graph *graph, struct rte_node *node) return 0; } +static struct rte_node_errors ip4_reassembly_errors = { + .nb_errors = 1, + .err_desc = { + [0] = "ip4_reassembly_error", + }, +}; + static struct rte_node_register ip4_reassembly_node = { .process = ip4_reassembly_node_process, .name = "ip4_reassembly", .init = ip4_reassembly_node_init, + .errs = &ip4_reassembly_errors, .nb_edges = RTE_NODE_IP4_REASSEMBLY_NEXT_PKT_DROP + 1, .next_nodes = {