> -----Original Message-----
> From: pbhagavat...@marvell.com <pbhagavat...@marvell.com>
> Sent: Thursday, February 22, 2024 8:24 PM
> To: jer...@marvell.com; ndabilpu...@marvell.com; kirankum...@marvell.com;
> Yan, Zhirun <zhirun....@intel.com>; Pavan Nikhilesh
> <pbhagavat...@marvell.com>; Ruifeng Wang <ruifeng.w...@arm.com>;
> Richardson, Bruce <bruce.richard...@intel.com>; Konstantin Ananyev
> <konstantin.v.anan...@yandex.ru>
> Cc: dev@dpdk.org
> Subject: [24.11 PATCH v3 4/5] node: add error stats for ip4 lookup node
> 
> From: Pavan Nikhilesh <pbhagavat...@marvell.com>
> 
> Add error counters for ip4 LPM lookup failures in ip4_lookup node.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavat...@marvell.com>
> ---
>  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",

Here, if one node has a list of err_desc, should we add a table for counting?
like: 
  err_type  count 
  type_a        1
  type_b        2
  type_c        3

or we can report the total number of failed pkts for one node only.

Reply via email to