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 469E945A6D; Fri, 11 Oct 2024 11:48:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F3A904028B; Fri, 11 Oct 2024 11:48:45 +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 1435640150 for ; Fri, 11 Oct 2024 11:48:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728640123; 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=WvEFOxX3TAADe8UqzyHSU8jq13+qgcbLRdlKAEvK37E=; b=M8ijks1LHeDF+G/hmykGMlEX2YxasTtoWbfTOKrerd6aau79Q0/ORvelPZrdLUk2jIUi6c 3UU99i7TKS0MMTna/G4Wf8zoZ5jMWGC6gM2WlG8RTxkCeZuCr3gQzBk2yTy6X7q4OVkNVm ihXS+yhKElqK2vqF3+/6aXTkOwJQj7w= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-323-61YukVPXPxift0_MPXvD2Q-1; Fri, 11 Oct 2024 05:48:42 -0400 X-MC-Unique: 61YukVPXPxift0_MPXvD2Q-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4311c5e8c02so4868775e9.2 for ; Fri, 11 Oct 2024 02:48:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728640121; x=1729244921; 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=fsI+ercVCc4tyxjEvWxmUn0Iq+Wn0g9g0V2l0HBB8uo=; b=mZ+WHk1nT/xvAnI38zdXXFl7AsP6Nt/9b/6RR3Z+lalVGKPeb9GHTpMrX3H7zXBxAx Oesf0ovnAaEN29O5DTxXfSMdpj3IDLgBSImWCUnXJfYZKFwIxO734Jqz5g9dS+TZwuhe cOaTBuR2HY0bLa6uTNzlj6zz90OBHO4HycekFHVWz7wVPlZojZgdDfCDrZkJngNuK/CS 2rCjoOWysKM9xdaUjTyPiF7+MYZ1gKVy28K7s+foGAjZ8xwRPRjliyzuLBUAPEBLFSi7 Ge5fUOW3uCXCvEx9ltYkZMBxm1KsE9jcEo7LiHQ1tBNwhdRohecKs8y6phMXSU1E+CCI OKFw== X-Gm-Message-State: AOJu0Yxfyd/1bZpher53U9y54lWC5EHaknblK8sAc7jgjuEtwgZqvFje TDj+oT3yKG4BEr+jSXqSPLHftgcskhqt+tUXxs2iIk+Y3aWVlLZP3LAezZTnHFSXKvOMs1xROu1 HlzI31S8j8kxUneoVxgYC3S/OwuvQrPjdNWAzfijr X-Received: by 2002:a05:600c:1d97:b0:42c:b1ee:4b04 with SMTP id 5b1f17b1804b1-4311df1e4f7mr15496225e9.28.1728640121364; Fri, 11 Oct 2024 02:48:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEBWaymDmRXLSPbjRfUlUBWYwzMWBJ7mDMVkZ5zU12VkiCezp2478+xPABHVYN87TkwzoX9w== X-Received: by 2002:a05:600c:1d97:b0:42c:b1ee:4b04 with SMTP id 5b1f17b1804b1-4311df1e4f7mr15495975e9.28.1728640120854; Fri, 11 Oct 2024 02:48:40 -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-431182ffca7sm37185425e9.20.2024.10.11.02.48.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Oct 2024 02:48:40 -0700 (PDT) Mime-Version: 1.0 Date: Fri, 11 Oct 2024 11:48:40 +0200 Message-Id: Cc: From: "Robin Jarry" To: , , , , , "Wathsala Vithanage" , "Bruce Richardson" , "Konstantin Ananyev" Subject: Re: [PATCH v4 4/5] node: add error stats for ip4 lookup node User-Agent: aerc/0.18.2-74-g7e4ac1a5f54c References: <20240222122342.16375-1-pbhagavatula@marvell.com> <20240816150926.5789-1-pbhagavatula@marvell.com> <20240816150926.5789-4-pbhagavatula@marvell.com> In-Reply-To: <20240816150926.5789-4-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 error counters for ip4 LPM lookup failures in > ip4_lookup node. > > Signed-off-by: Pavan Nikhilesh [snip] > 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 > =20 > +#include > + > extern int rte_node_logtype; > #define RTE_LOGTYPE_NODE rte_node_logtype > =20 > @@ -88,4 +90,10 @@ node_mbuf_priv2(struct rte_mbuf *m) > =09return (struct node_mbuf_priv2 *)rte_mbuf_to_priv(m); > } > =20 > +#define NODE_INCREMENT_ERROR_ID(node, id, cond, cnt) = \ > +=09{ = \ > +=09=09if (unlikely(rte_graph_has_stats_feature() && (cond))) = \ > +=09=09=09((uint64_t *)RTE_PTR_ADD(node, node->err_off))[id] +=3D (cnt); = \ > +=09} This is private API which is not usable with out-of-tree nodes. Could=20 you expose a way to increment a given error stat that does not involve=20 a hacky macro? How about something like this in rte_graph_worker_common.h: static inline void rte_node_increment_error(struct rte_node *node, uint16_t err_id, uint64_t v= alue) { #ifdef RTE_LIBRTE_GRAPH_STATS uint64_t *errors =3D RTE_PTR_ADD(node, node->err_off); errors[err_id] +=3D value; #else RTE_SET_USED(node); RTE_SET_USED(err_id); RTE_SET_USED(value); #endif } NB: do *not* include a condition in that function. The decision whether=20 to increment an error stat or not should remain in the nodes.