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 C311D42C05; Thu, 1 Jun 2023 17:26:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B60EE40EF0; Thu, 1 Jun 2023 17:26:29 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 9139F40DDC for ; Thu, 1 Jun 2023 17:26:28 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D77995C01D3; Thu, 1 Jun 2023 11:26:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 01 Jun 2023 11:26:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type: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; t= 1685633187; x=1685719587; bh=StKypYFp911BZWr4gkEHB3dOYZP7HYLSydq KVtoBzGE=; b=e9pEvl8N52XIgBDsrxgX9wy3WJoFlPBcYaxblBNcUqM8ouZUK/w uwp6200vRH65+3f0sS3q4NBkHR8kKY5Id4GFAt/BJGQc0JHWTblgv9AwHYnFa1Qq t2AW7MqO6pOy85rqR/NM2Ddqu2uNLikUmpUxSCzFT+2wUPqXpd4pqMT+6p3NjQ46 Pz43Zd9mrvn2JX5WwzjafyKh/IoVaWE++byckskqkDffIEZbkjOzQC2y3o3yLdEe Kmm89Ee7hVnvgJKUKtpYfFJXgbRPWcLL9Hou+CeHZZNOafr9CORfziFJe6ANkABv Te0/Zw7fffFzPftFurI3taQTFSLuQxTe9YQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=fm1; t= 1685633187; x=1685719587; bh=StKypYFp911BZWr4gkEHB3dOYZP7HYLSydq KVtoBzGE=; b=KlhEW4fS/tFawm0mrmT3K4pTJn0WTDm6EC7r1HlUvNWiBzh64sv dE5fBe5Jk1hmdNaY3hkUa4kHtYCNA2onN/al5PGaJ8SjH/xs8FJ8GECAxW01h/OE qSRYyxk6ysEV+UHjOAZYkTEHCuH4jLOAztsUn1N032B0Xf1En90wVxEpNRIxe+3w m6QqG8O3cm3yLwJcdYQRE9qSn/Me+Y8DGUJIN9lvBHxnS7/aVG4dRi6X0wZ8YjzO mustMJv+lEu6QF3UjpJWJLrh1+6DNBxqfcAZBBMjK6X2356EdeNDk9LLJRhc0M3C qIeofUdIla8YV1TYOUNkhdOBTcfPYYSju5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeluddgkeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdei kefgkeduhedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 1 Jun 2023 11:26:26 -0400 (EDT) From: Thomas Monjalon To: Cristian Dumitrescu , Volodymyr Fialko Cc: dev@dpdk.org, jerinj@marvell.com, anoobj@marvell.com Subject: Re: [PATCH] bitmap: add scan init at given position Date: Thu, 01 Jun 2023 17:26:24 +0200 Message-ID: <8347303.5OynTdThKG@thomas> In-Reply-To: <20230414083943.270651-1-vfialko@marvell.com> References: <20230414083943.270651-1-vfialko@marvell.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 Cristian, please could you review this patch? 14/04/2023 10:39, Volodymyr Fialko: > Currently, in the case when we search for a bit set after a particular > value, the bitmap has to be scanned from the beginning and > rte_bitmap_scan() has to be called multiple times until we hit the value. > > Add a new __rte_bitmap_scan_init_at() function to initialize scan state at > the given position, this will allow getting the next bit set after some > value within one rte_bitmap_scan() call. > > Signed-off-by: Volodymyr Fialko [...] > +__rte_experimental > +static inline void > +__rte_bitmap_scan_init_at(struct rte_bitmap *bmp, uint32_t pos) > +{ > + bmp->index1 = pos >> (RTE_BITMAP_SLAB_BIT_SIZE_LOG2 + RTE_BITMAP_CL_BIT_SIZE_LOG2); > + bmp->offset1 = (pos >> RTE_BITMAP_CL_BIT_SIZE_LOG2) & RTE_BITMAP_SLAB_BIT_MASK; > + bmp->index2 = pos >> RTE_BITMAP_SLAB_BIT_SIZE_LOG2; > + bmp->go2 = 1; > +} It is supposed to be an internal (inlined) function but it is not used.