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 0F6E145B34; Mon, 14 Oct 2024 09:13:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91DCD40273; Mon, 14 Oct 2024 09:13:21 +0200 (CEST) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by mails.dpdk.org (Postfix) with ESMTP id 0B2F340151 for ; Mon, 14 Oct 2024 09:13:21 +0200 (CEST) Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4603ce01023so34508041cf.1 for ; Mon, 14 Oct 2024 00:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728890000; x=1729494800; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wij7kxAj0D4AlQhR48zBD1oqvLAZ3Oxon7ykxmn5XWY=; b=JEPc/0N/vtT2Q4Lku8YM/v7eXClMg9IYySxwDAZcLe7zKlvL9ynGS6U/DzETvVWb5d ItYe8XQRB7eco+BK8gUx7x6ziTMsa4psomQRAXdw+e2zAAn4Z0vxi5nExu92VhBIbYLm IjaH1jKcNAxR0baWH31qBWuJyHa2lFaAiS3IPOKKkVuKENbyiwY7/QC61+P36Q8RMt3o WPVVqzc5Nz+MGiM7d8R9ZPCk72KfIbiOnDXnL2xHoNNwViDWgpbTKeXcFh4Lc+GSzmFg JTxeZIdrKgU2zn1haIZbCP7veCSFdVmsr4xGg6L41FCYbeLDXuZDh8odlR2zuuqegiad ivHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728890000; x=1729494800; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wij7kxAj0D4AlQhR48zBD1oqvLAZ3Oxon7ykxmn5XWY=; b=cqZuThA46nbj+Zc41dxk71BAynA7FmDBc8RVuBc0vvxXoxaTzECK3UTnFcOBWiA6BV nsrUxyOb5uPEITwSsmR/dfD+kfFbhMT7hYyZrTtGc7f8waouXS7NnPORZpv/L7jWK5KE k42Y5uIOTLqikFKXXOSwuREra5QSf1hrEpH041YrvyURznoHe6tv+fRFZmc17Cgmvjs1 gPUTExYKsl0kRf1eQ8ZzUNQfI34vsZgLm+33g4Ohd/0BYZ/tZ9sMByXj9x1K2ypYKpgX 9N2T6WXUx9j4iy234SrmlVwSrBRKYtrnaybxe3JVuGZKLZf2T3nyXLUGzH1QWk0Z91Wk GjiQ== X-Forwarded-Encrypted: i=1; AJvYcCVzb7bYyUkpGmatE44Tca/vEYmBLVCPZ6Gt0unvYfxq3j3SdTjTs1BP2z9CmcJmAN4vGS4=@dpdk.org X-Gm-Message-State: AOJu0YwAWD30hMEc0pk4VO1GOu+B1vo0VOauU7RU7oV0V4PADmSZ0Nnl d5r85EiP+7H3MkmCLN6KdV5kZu2HCESfTMIWOQiBuWVVTwg9Q3ftPrQ2ZObSwNt8O6sr4YVJJLm XDeou9/pY9bxYcVXVamEWGktfI8g= X-Google-Smtp-Source: AGHT+IHGSwO+rzOyhZoEpAEMdUeoki2BHKL3bLx3YKFn7AHVOaYKoLab8JsCnWZtpxKO1n+Od3E58HzBLoTQr8UoiQg= X-Received: by 2002:a05:622a:1989:b0:45d:9525:42ff with SMTP id d75a77b69052e-4604bca79a3mr152209451cf.54.1728890000008; Mon, 14 Oct 2024 00:13:20 -0700 (PDT) MIME-Version: 1.0 References: <20240222122342.16375-1-pbhagavatula@marvell.com> <20240816150926.5789-1-pbhagavatula@marvell.com> <20240816150926.5789-4-pbhagavatula@marvell.com> In-Reply-To: From: Jerin Jacob Date: Mon, 14 Oct 2024 12:42:52 +0530 Message-ID: Subject: Re: [EXTERNAL] Re: [PATCH v4 4/5] node: add error stats for ip4 lookup node To: Pavan Nikhilesh Bhagavatula Cc: Robin Jarry , Jerin Jacob , Nithin Kumar Dabilpuram , Kiran Kumar Kokkilagadda , "zhirun.yan@intel.com" , Wathsala Vithanage , Bruce Richardson , Konstantin Ananyev , "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Fri, Oct 11, 2024 at 10:51=E2=80=AFPM Pavan Nikhilesh Bhagavatula wrote: > > > > > -----Original Message----- > > From: Robin Jarry > > Sent: Friday, October 11, 2024 3:19 PM > > To: Pavan Nikhilesh Bhagavatula ; Jerin Jacob > > ; Nithin Kumar Dabilpuram > > ; Kiran Kumar Kokkilagadda > > ; zhirun.yan@intel.com; Wathsala Vithanage > > ; Bruce Richardson > > ; Konstantin Ananyev > > > > Cc: dev@dpdk.org > > Subject: [EXTERNAL] Re: [PATCH v4 4/5] node: add error stats for ip4 lo= okup > > node > > > > Hi Pavan, , Aug 16, 2024 at 17:=E2=80=8A09: > From: Pavan Nikhilesh > > > > Add error counters for= ip4 LPM lookup > > failures in > ip4_lookup node. > > Signed-off-by: Pavan Nikhilesh > > > > > > 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 > > > > > > +#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= ] > > +=3D (cnt); \ > > > + } > > > > This is private API which is not usable with out-of-tree nodes. Could > > you expose a way to increment a given error stat that does not involve > > a hacky macro? > > > > How about something like this in rte_graph_worker_common.h: > > > > I would prefer nodes having their own error increment implementation, lea= ves room > for optimization rather than forcing all the nodes to use a single implem= entation. > > Some nodes might also be able to use SIMD to increment error count at onc= e. > > Also, I really hate doing > if (error) > rte_node_increment_error() > > The macro really looks really clean atleast for inbuild nodes. > We can still have this additional inline function as a utility function. > > I will leave it upto the maintainers to decide. IMO, it is OK to expose a version of rte_node_increment_error() as Robin suggested. Application is free to use public or more optimized version based on the ne= eded. Prefers rte_node_error_increment() (Keeping action/verb as last) though.