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 06FF2439F8; Mon, 29 Jan 2024 07:43:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E678E40A89; Mon, 29 Jan 2024 07:43:02 +0100 (CET) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 33FD540A6F; Mon, 29 Jan 2024 07:43:02 +0100 (CET) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id B6F11B2E0; Mon, 29 Jan 2024 07:43:01 +0100 (CET) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 9B316B2DE; Mon, 29 Jan 2024 07:43:01 +0100 (CET) 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.4 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.4 Received: from [192.168.1.59] (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 CE378B3BC; Mon, 29 Jan 2024 07:42:59 +0100 (CET) Message-ID: Date: Mon, 29 Jan 2024 07:42:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Potential RTE bitset RFC To: fengchengwen , =?UTF-8?Q?Morten_Br=C3=B8rup?= , dev@dpdk.org Cc: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= , techboard@dpdk.org References: <01427f5d-a297-4ca5-b5e3-5a10bf83cd36@lysator.liu.se> <98CBD80474FA8B44BF855DF32C47DC35E9F1AC@smartserver.smartshare.dk> <6a15248e-120b-2f56-719c-1df9992769e9@huawei.com> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: <6a15248e-120b-2f56-719c-1df9992769e9@huawei.com> 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-01-29 04:02, fengchengwen wrote: > Hi, > > On 2024/1/28 21:52, Morten Brørup wrote: >>> From: Mattias Rönnblom [mailto:hofors@lysator.liu.se] >>> Sent: Saturday, 27 January 2024 19.32 >>> >>> Hi. >>> >>> The new timer RFC ("htimer") I submitted last year also included a new >>> bitset API. >>> >>> https://patchwork.dpdk.org/project/dpdk/patch/20230315170342.214127-2- >>> mattias.ronnblom@ericsson.com/ >>> >>> My experience is that multi-word bitsets are often useful. Examples >>> from >>> DPDK are rte_service.c and DSW its "service ports" bitset (both have 64 >>> as a hard upper limit). Small, but multi-word, bitsets are not >>> particularly hard to open-code, but then you end up with a lot of >>> duplication. >>> >>> I wanted to ask if there is an interest in seeing a bitset API (as per >>> my patchset) in DPDK. >> >> Absolutely! >> Your bitset patch seems very complete, with test cases and all. >> Let's standardize on this, so we can avoid variants of similar code all over the place. > > The bitmap (lib/eal/include/rte_bitmap.h) provides a subset of this bitset library. > Maybe it's better to extend the bitmap library. > > Thanks. RTE bitmap is for large bitsets. This library is for small bitsets where performance is crucial (i.e., you can't live with the "extra" spacial and/or temporal overhead of rte_bitmap.h). Stephen Hemminger suggested supporting atomic operations in this API. The would make sense to me as well. void rte_bitset_atomic_set(uint64_t *bitset, size_t bit_num, int memory_model); or, alternatively, you only provided a get/set with a relaxed memory model, and you could loose the memory model parameter. > >> >>> >>> Upstreaming htimer, including having it replace today's rte_timer is >>> more work than I can commit to, so I think you won't get RTE bitset >>> that >>> way any time soon. >> >> Thanks for the update regarding the htimer progress. :-) >> >> I certainly don't object to a dedicated fast path library for high-volume timers, such as those in a TCP/IP (or QUIC/IP) stack. >> >> In my opinion, the existing rte_timer library can be improved at a later stage, if anybody cares. It's a shame if that requirement is holding back the addition of a new and useful library. >> >> -Morten >>