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 CE120A00C2; Tue, 8 Mar 2022 14:26:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A5704068E; Tue, 8 Mar 2022 14:26:16 +0100 (CET) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 24D754068B; Tue, 8 Mar 2022 14:26:15 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id EB37B3201E00; Tue, 8 Mar 2022 08:26:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 08 Mar 2022 08:26:14 -0500 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=fm1; bh=e8+cTKLVR40Evm 9rYMYLcF/p8ylVbJwgPMaSHp8oyTk=; b=drk9YFx639ilZHidb6JcIteIgCb2+M rJXuZQVlvbEY+uJN7h2x+gbeGb1YjZiyNN4nHkXIa1a0bNzVxgmfn5FRrKjTfKVN iHe0jIsxOBxaFmpqWf4DT+mGMVIZRbcj5+qGYEaeKRJyap3b2gKdU+WzSqvMezUo YuaWza8k1HBJHWXnV9QsCahMYzDJgPVK6I+ipqqaA7W8PTz/RAaYWt1+NfdluZZW am/Pv27rJ5aeUaPFXQKfnKNcyCbXpVp2jznolUMuONYqSO1fyxzP/S9F8yLNR2yl oajJI8ATJeu9cPJz/79Ey3dKwMPEQKMw7p1ohrmgcwfOdPxSPJgXRWCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; 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:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=e8+cTKLVR40Evm9rYMYLcF/p8ylVbJwgPMaSHp8oy Tk=; b=YB9YzZ/Tersq2M8ltt6eCBNnYoNlD+83JiMSgOmPWs6kBW/5UtO9h2XzP eh8QRnRBo+2uuNjouy8MxmKzwqvNHI3QTo9L3YmIP59pEponltuXKKBNJ+WUN+9n FBIBzbk+Bxm7fiyBzBlCcTwBPCGfJOQcK6u7lKQgus1hb+58k7v259o3z3DdmT7o xrD1g+5bqC2tWk7WNFw5rCONDUCVCt7CetKOrY2G/IRHDZ8UX2DyjFga6ktiS6HE K4cqTdKJ0TJO7UaOIajJDO0flmcdr98TMC7JQ+vQIt111eWlL1rry8b2XnoSZCG2 7H3/a9/nYU1mr8SBxeTJSEgIfnaYg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudduiedghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Mar 2022 08:26:12 -0500 (EST) From: Thomas Monjalon To: Shibin Koikkara Reeny Cc: david.hunt@intel.com, dev@dpdk.org, stable@dpdk.org Subject: Re: [PATCH] examples/vm_power: replace list foreach with while loop Date: Tue, 08 Mar 2022 14:26:10 +0100 Message-ID: <4112658.kXSN5OTJKJ@thomas> In-Reply-To: <20220301145313.560577-1-shibin.koikkara.reeny@intel.com> References: <20220301145313.560577-1-shibin.koikkara.reeny@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/03/2022 15:53, Shibin Koikkara Reeny: > Linux header files don't support LIST_FOREACH_SAFE so replacing > LIST_FOREACH with while loop. What is the original issue you are trying to solve? > - struct virtual_machine_info *vm_info; > - > - LIST_FOREACH(vm_info, &vm_list_head, vms_info) { > + struct virtual_machine_info *vm_info = LIST_FIRST(&vm_list_head); > > + /* No LIST_FOREACH_SAFE, using while instead. */ > + while (vm_info) { > rte_spinlock_lock(&(vm_info->config_spinlock)); > > memcpy(mask, (char *)vm_info->channel_mask, RTE_MAX_LCORE); > @@ -1024,6 +1024,8 @@ channel_manager_exit(void) > > LIST_REMOVE(vm_info, vms_info); > rte_free(vm_info); > + > + vm_info = LIST_NEXT((vm_info), vms_info); > }