> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Thursday, February 22, 2024 8:24 PM
> To: [email protected]; [email protected]; [email protected];
> Yan, Zhirun <[email protected]>; Pavan Nikhilesh
> <[email protected]>; Ruifeng Wang <[email protected]>;
> Richardson, Bruce <[email protected]>; Konstantin Ananyev
> <[email protected]>
> Cc: [email protected]
> Subject: [24.11 PATCH v3 4/5] node: add error stats for ip4 lookup node
> 
> From: Pavan Nikhilesh <[email protected]>
> 
> Add error counters for ip4 LPM lookup failures in ip4_lookup node.
> 
> Signed-off-by: Pavan Nikhilesh <[email protected]>
> ---
>  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