[24.11 PATCH v3 4/5] node: add error stats for ip4 lookup node

Yan, Zhirun zhirun.yan at intel.com
Fri Feb 23 08:18:32 CET 2024



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



More information about the dev mailing list