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 4234D45B02; Fri, 11 Oct 2024 12:03:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C69824028B; Fri, 11 Oct 2024 12:03:04 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 8ECB340150 for ; Fri, 11 Oct 2024 12:03:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728640983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e4MwLM8uW8GZrd2ISrM3XOtWxWiqcYZmYPvF3qAUTe8=; b=RJChJBPoLOZksZ0LHF68B2jg1UqObIrP56gZl1sOLOYVz3hU1+hroNPUMvN2nXqT/MUl3n jp9fT2oCDf1J3czQD19v3Zj5ZUsGFdUW7nAcSruZOtkCfnImhX2UMHNzb7NkigCNL0ppOP hAxksTm2xFI8DZoe7k4bseERSaUCBAw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-379-YtTxvRnuPIeWWZvjhLC4Pw-1; Fri, 11 Oct 2024 06:03:02 -0400 X-MC-Unique: YtTxvRnuPIeWWZvjhLC4Pw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-43117570814so8762835e9.1 for ; Fri, 11 Oct 2024 03:03:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728640981; x=1729245781; h=in-reply-to:references:user-agent:subject:to:from:cc:message-id :date:content-transfer-encoding:mime-version:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eUOGlv8aezuplfmx9WVdLav2vVuFeDCynK2rYUe9VCM=; b=pwXYeVCvw7GW5e70SW1cUv+xN72WIaaVxTUpaY/gqJh1wVmYL9XOeGO4X5kbJdhSRo Yik/Ef6BMmrONm9pJ5iX+neiN+tpns/bbwUEo1vy874gazvyqOjCKXdLmSExz4Zqo2CH U3GWtkh/cpyQbeX912ZAgLNQ8kMm23e0Cw5oQRfwVfI9ide5U61tTSjHvZh89W6URQ2D tAt/Jg7zbI8D3rSy7X3sB9cKSLlOl1TIqUzhvPQCGH9ZhwS6eebwIrvlZ87hbmHNI9M/ z7tVC8TXtdwS3iqjFKiMxIhMb9hEXYR3YWF5p1CGhdpq5uckdwjwlySCIp15FJ1dWeEf ZzJg== X-Gm-Message-State: AOJu0YwKS99vTZ/kb9K2rfIoyXaCgG7IBuIv9mAZby4B5F8Tl6psnxed iQos6Xkldlbk7z1J0xXwmPKxMqRujKpZnIOuH9q9xbndFuWkRn+s7Qg9kNJ1IFp3qCHfRiuK0dl XxTZDywho6Nci6geFW18NVq34ywivW0qWBkI+nADa X-Received: by 2002:a05:600c:3b9f:b0:426:593c:935d with SMTP id 5b1f17b1804b1-4311dea41bemr15761215e9.5.1728640980679; Fri, 11 Oct 2024 03:03:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEX1umfi0HbeSBmLWqkwPMf6EtJlGrZkE/9T6wSbLyIWxcz8rKRTlVlNCZF+NN90EaBkTncHA== X-Received: by 2002:a05:600c:3b9f:b0:426:593c:935d with SMTP id 5b1f17b1804b1-4311dea41bemr15760925e9.5.1728640980278; Fri, 11 Oct 2024 03:03:00 -0700 (PDT) Received: from localhost (2a01cb00025433006239e1f47a0b2371.ipv6.abo.wanadoo.fr. [2a01:cb00:254:3300:6239:e1f4:7a0b:2371]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-431183565b9sm37736405e9.29.2024.10.11.03.02.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Oct 2024 03:02:59 -0700 (PDT) Mime-Version: 1.0 Date: Fri, 11 Oct 2024 12:02:59 +0200 Message-Id: Cc: From: "Robin Jarry" To: , , , , , "Zhirun Yan" Subject: Re: [PATCH v4 1/5] graph: add support for node specific errors User-Agent: aerc/0.18.2-74-g7e4ac1a5f54c References: <20240222122342.16375-1-pbhagavatula@marvell.com> <20240816150926.5789-1-pbhagavatula@marvell.com> In-Reply-To: <20240816150926.5789-1-pbhagavatula@marvell.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed 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 Hi Pavan, , Aug 16, 2024 at 17:09: > From: Pavan Nikhilesh > > Add ability for Nodes to advertise error counters > during registration. > > Signed-off-by: Pavan Nikhilesh > --- > v2 Changes: > - Fix compilation. > v3 Changes: > - Resend as 1/5 didn't make it through. > v4 Changes: > - Address review comments. > - Rebase on main branch. > > 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(-) > > 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_NO= DE_REGISTER`` by passing > While performing the graph walk, the ``process()`` function of all the s= ource > nodes will be called first. So that these nodes can be used as input nod= es for a graph. > > +nb_errors: > +^^^^^^^^^^ > + > +The number of errors that this node can report. The ``err_desc[]`` store= s 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. This feature could be useful to store detailed statistics per node, not=20 only for errors. It would be better to rename "errors" to "stats" or=20 "xstats". See below for a concrete suggestion. > diff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h > index d557d55f2d..e663b04d8b 100644 > --- a/lib/graph/graph_private.h > +++ b/lib/graph/graph_private.h > @@ -61,6 +61,7 @@ struct node { > =09rte_node_t id;=09=09 /**< Allocated identifier for the node. */ > =09rte_node_t parent_id;=09 /**< Parent node identifier. */ > =09rte_edge_t nb_edges;=09 /**< Number of edges from this node. */ > +=09struct rte_node_errors *errs; /**< Node specific errors. */ How about: struct rte_node_xstats *xstats; /**< Node specific extra statistics. */ And maybe const? I didn't check if you make a full copy, or if you only=20 copy the pointer. > diff --git a/lib/graph/rte_graph.h b/lib/graph/rte_graph.h > index ecfec2068a..b28143d737 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_NODE_XSTATS_DESC_SIZE 64 /**< Max length of node xstats names. = */ > #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_cl= uster_stats *stat, > */ > void rte_graph_cluster_stats_reset(struct rte_graph_cluster_stats *stat)= ; > > +struct rte_node_errors { > +=09uint16_t nb_errors;=09=09=09=09 /**< Number of errors. */ > +=09char err_desc[][RTE_NODE_ERROR_DESC_SIZE];=09 /**< Names of errors. *= / > +}; struct rte_node_xstats { uint16_t xstats_num; /**< Number of xstats. */ char xstats_desc[RTE_NODE_XSTATS_DESC_SIZE]; /**< Names of xstats. */ }; > + > /** > * Structure defines the node registration parameters. > * > @@ -472,6 +478,7 @@ struct rte_node_register { > =09rte_node_process_t process; /**< Node process function. */ > =09rte_node_init_t init; /**< Node init function. */ > =09rte_node_fini_t fini; /**< Node fini function. */ > +=09struct rte_node_errors *errs; /**< Node specific errors. */ struct rte_node_xstats *xstats; /**< Node specific extra statistics. */ Cheers!