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 F1F5E45B37; Mon, 14 Oct 2024 13:58:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAA0D4065D; Mon, 14 Oct 2024 13:58:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 4A00240395 for ; Mon, 14 Oct 2024 13:58:46 +0200 (CEST) Received: from pps.filterd (m0431383.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49EBIv26029688; Mon, 14 Oct 2024 04:58:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=6 PgKpP3Cuq6RA65321lAweQTXtwuICi2VVAgJzlMLPw=; b=cwnf7U+d0vp407/Gw M6iCJI50AAwtoM/lEMmyvlMska19OkQIkNjY4qIUMLsU+h/T4NAVN2PbeeE83VRM uM0UUaiIzAQZrOe8TLZwMUOkpu+Af30PKjm9VNh87nxMso9a9+h9hH/cCe+1Uidk rCQ3lLYxS9mlCW14aMDpxDZzeNvPvUlF3w8V2QAKrcYztQ5awPRbHphZPCEBI/m+ S31WRiXfILFE/Jm3qUT9gIPzxSqd+luHhvXHmw3P0xoq1ghPNENb3MDSYTtN7XFm hczgNdS4YSZLX3Myf8XocvNYx2EfWfvux2F2mENpvDi9TRXlF7KP1g4NiBHJYTgl BjDxg== Received: from dc6wp-exch02.marvell.com ([4.21.29.225]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 4292aq01ku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Oct 2024 04:58:43 -0700 (PDT) Received: from DC6WP-EXCH02.marvell.com (10.76.176.209) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Mon, 14 Oct 2024 04:58:42 -0700 Received: from maili.marvell.com (10.69.176.80) by DC6WP-EXCH02.marvell.com (10.76.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Mon, 14 Oct 2024 04:58:42 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id A523C5B6924; Mon, 14 Oct 2024 04:58:38 -0700 (PDT) From: To: , , , , , , Pavan Nikhilesh , Wathsala Vithanage , Bruce Richardson , Konstantin Ananyev CC: Subject: [PATCH v5 3/3] node: add error stats for ip4 nodes Date: Mon, 14 Oct 2024 17:28:21 +0530 Message-ID: <20241014115821.4204-4-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241014115821.4204-1-pbhagavatula@marvell.com> References: <20240816150926.5789-1-pbhagavatula@marvell.com> <20241014115821.4204-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: qXA640RXZk9ip6IMS21rqdIltmNFvTdm X-Proofpoint-ORIG-GUID: qXA640RXZk9ip6IMS21rqdIltmNFvTdm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.687,Hydra:6.0.235,FMLib:17.0.607.475 definitions=2020-10-13_15,2020-10-13_02,2020-04-07_01 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. Add reassembly failure error counter for ip4 reassembly node. Signed-off-by: Pavan Nikhilesh Acked-by: Kiran Kumar K --- lib/node/ip4_lookup.c | 9 +++++++++ lib/node/ip4_lookup_neon.h | 5 +++++ lib/node/ip4_lookup_sse.h | 6 ++++++ lib/node/ip4_reassembly.c | 9 +++++++++ lib/node/node_private.h | 8 ++++++++ 5 files changed, 37 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/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 = { diff --git a/lib/node/node_private.h b/lib/node/node_private.h index 1de7306792..36b2a733db 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 @@ -88,4 +90,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__ */ -- 2.25.1