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 07433458E9; Mon, 2 Sep 2024 16:47:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91E2D4042C; Mon, 2 Sep 2024 16:47:05 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 467AF40150 for ; Mon, 2 Sep 2024 16:47:04 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 70840188EB for ; Mon, 2 Sep 2024 16:47:03 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 648A2188EA; Mon, 2 Sep 2024 16:47:03 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.2 Received: from [192.168.1.86] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 32985187EF; Mon, 2 Sep 2024 16:46:59 +0200 (CEST) Message-ID: <18494d5f-9a30-4d28-8c06-7b794f11b22d@lysator.liu.se> Date: Mon, 2 Sep 2024 16:46:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/6] eal: add bitset type To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , dev@dpdk.org Cc: Tyler Retzlaff , Stephen Hemminger , Harry van Haaren , "david.marchand@redhat.com" , Thomas Monjalon References: <20240505073313.118515-1-mattias.ronnblom@ericsson.com> <20240809201440.590464-1-mattias.ronnblom@ericsson.com> <98CBD80474FA8B44BF855DF32C47DC35E9F68D@smartserver.smartshare.dk> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F68D@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP 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 2024-09-02 15:55, Morten Brørup wrote: >> From: Mattias Rönnblom [mailto:mattias.ronnblom@ericsson.com] >> Sent: Friday, 9 August 2024 22.15 >> >> Introduce a set of functions and macros that operate on sets of bits, >> kept in arrays of 64-bit words. > > This could be 32-bit words on 32 bit architectures. Just an idea. > The use of "unsigned long" instead of "uint64_t" as the type has been discussed before on the list. I prefer uint64_t because it's less to type and the performance benefits of using "unsigned long" on 32-bit ISAs likely are small. That said, I have no strong opinion on the subject. >> >> RTE bitset is designed for bitsets which are larger than what fits in >> a single machine word (i.e., 64 bits). For very large bitsets, the >> API may be a more appropriate choice. > > RTE bitset uses size_t to index the bits. > This means that it supports very large bitsets. > Yes, it does, although I can't say I see a use case for enormous bitsets. But, who knows. I used size_t in an attempt to slightly improve readability. Performance wise, it does not matter, at least in the tests I did. I don't know if it ever could, considering these functions will pretty much always be inlined. > If it is not supposed to support more than 2^32 bits, it could use uint32_t for indexing. > I don't know if it make any practical difference. > >> >> Depends-on: series-32740 ("Improve EAL bit operations API") >> >> Signed-off-by: Mattias Rönnblom >> >> -- > > With or without considering the above ideas, this library is a good addition to DPDK. > > For the series, > Acked-by: Morten Brørup >