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 37037A0542; Tue, 5 Jul 2022 18:16:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15A1A4021D; Tue, 5 Jul 2022 18:16:23 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 29290400D7 for ; Tue, 5 Jul 2022 18:16:21 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 70F7F5C010D; Tue, 5 Jul 2022 12:16:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 05 Jul 2022 12:16:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1657037780; x= 1657124180; bh=FNOjKNk46HArp0ZYcBTrIOt5lEWVxRKN4PwDODxM8/8=; b=L st+tsasY3i0mMJ/Z9H9sFDTkKdW9qWbCiURo6E0rbdr8Tnau/ELETmgpgqL+buCn jldjbCEN9Styb9Jdw/1YgOb04eZ9Q7SkVpCczFgMVlJybTKoy6H63aaig2gGlV8Y ze8/4qu9Zy7vMauO3xvDekJcBW/o0trcRPhkqzzc+p4QPIg0hJnBJAgCfNd27Zgn m1gtgxH+ytc+I45mzU45I7LJ7qQqdSgOp0IhSmY7dKxdRqjjd3Mzz4X3tytLEXBN U/KJysodYAyCgdKUG85NK/f4URn1pFT+wk+tMjodLcnKINtrCCIrklioop+v+RXG H4HtVfnQj5OF/2A8lXsrw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1657037780; x= 1657124180; bh=FNOjKNk46HArp0ZYcBTrIOt5lEWVxRKN4PwDODxM8/8=; b=n V72TKOWeU+8//Ai3rMPtERYVXpkzk9eO6QYSK5LPAujxDz22H7o3ECNrkY2mW/76 uk6UnULwZNCm2av6XtgfDpsBRvSdkJiJcJ6SM+wzITx/dk57dpU9M1zo8yEuMWo/ y09MLnOEMeLsyviDARczxwH3xclPuSELYtujYyJXczkT77CDOJUkEadp69okKGBY pWL1/nf/kwPnLR/k3eoVKOeAXW9a4FaOGgZR7a24C0YbVSw1AZKgBkxHPXUErX2H zSwur53pPRn+JULJbAlmagz15mJGnGrD2aP/jW3ykFiH4wn0QBWCkHHSq2oAEoqK kBAH0Jzlxbc2+dO1zHSRA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeiuddguddtvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddt ieekgfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Jul 2022 12:16:19 -0400 (EDT) From: Thomas Monjalon To: Hamza Khan Cc: dev@dpdk.org Subject: Re: [PATCH 1/2] common: add safe version of foreach-list to Linux Date: Tue, 05 Jul 2022 18:16:18 +0200 Message-ID: <14252746.lhuNh5TYOU@thomas> In-Reply-To: <20220601105455.166505-1-hamza.khan@intel.com> References: <20220601105455.166505-1-hamza.khan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 01/06/2022 12:54, Hamza Khan: > Linux EAL does not have the LIST_FOREACH_SAFE version of the > iterator macros. Add it. > > Signed-off-by: Hamza Khan > --- > lib/eal/linux/include/rte_os.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lib/eal/linux/include/rte_os.h b/lib/eal/linux/include/rte_os.h > index c72bf5b7e6..00d7714181 100644 > --- a/lib/eal/linux/include/rte_os.h > +++ b/lib/eal/linux/include/rte_os.h > @@ -26,6 +26,13 @@ extern "C" { > #define RTE_STAILQ_HEAD(name, type) STAILQ_HEAD(name, type) > #define RTE_STAILQ_ENTRY(type) STAILQ_ENTRY(type) > > +#ifndef LIST_FOREACH_SAFE > +#define LIST_FOREACH_SAFE(var, head, field, tvar) \ > + for ((var) = LIST_FIRST((head)); \ > + (var) && ((tvar) = LIST_NEXT((var), field), 1); \ > + (var) = (tvar)) > +#endif I'm not sure we want to add such thing without a RTE_ prefix. And we should not need LIST_*, we have RTE_TAILQ_*.