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 9EF4442C61; Thu, 8 Jun 2023 16:51:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 934B9427F2; Thu, 8 Jun 2023 16:51:03 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 7192A40A84 for ; Thu, 8 Jun 2023 16:51:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686235861; x=1717771861; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=rZ1qMLMjKZLbn+UjLILwZKqvtlTbb66JruKn7uk7BWE=; b=XnvWEjqq6pS6tzMU1Jcjw9+f0mg0wcbbgHZ1NMwoiFjS/9N6QquK3uZw ntTdsaY5RnElYJuCzaIotWD/x5s/1vOFdqVxfLKkPUxzXWEj7cC94id0W eW2OjmfdZ3twY+w1svY+xfgeWM7FUAHQtNF1vifJLndLKPXI0rO6XMBC7 u66Y4+uEAWWKnFxkPAipioejxVTTjEWDlJ8yIhurkwiGkhP4GOV1NOT7+ NlO9XJw4yx//suX7edheyVPdwgUB9Y+gGNOr0WfKg2IrC4Zpo16agZka9 XfwUni3VIfsKJ8/XbwR3QIxAiU0ak6BRjtNMuCG+8h8GOQzr9lKwKWDZo w==; X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="337682197" X-IronPort-AV: E=Sophos;i="6.00,227,1681196400"; d="scan'208";a="337682197" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 07:50:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="854377873" X-IronPort-AV: E=Sophos;i="6.00,227,1681196400"; d="scan'208";a="854377873" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga001.fm.intel.com with ESMTP; 08 Jun 2023 07:50:55 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 8 Jun 2023 07:50:54 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 8 Jun 2023 07:50:54 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Thu, 8 Jun 2023 07:50:54 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.174) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Thu, 8 Jun 2023 07:50:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=er6WeBeX2CUnoAi+jeGvcgbWHEGu4SY31nGVKIGJCFNEfdnRTwI/WvdjpHysRLCnlhjaXF6oo4qaBEeq/smyQtcefEEWw+MbOrIsngyrlVpRaK4gzxwMRNeK9T2HFWKWG9AgkMGk0+8TiYOUB/kuyCc9WcnpDZGpycgIgjOngpS6/t2Nu7yeXBGBQxbnt6NCHipP+XBJbtHWqcTXxAfvvkzk8/NbyTLhFw2WPqzCQNlcNkka9miNlFJsFfQR69IXXXZy4C4MaAFzHXDrsV8DudtE7KapWLiqrmbTaYHa8HTBO3CJO03kY04/PJ8k8S6EDhYLAcoEz99bzEh02GYXFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4HgRNFBeuQE81lZ+6iYKRevTM0b0SAPR/4htChY//1c=; b=cDUyOVr+Ub2riGXQ2q47w2sPOAxxrHoY3w1E+e+bu/MviFWMqLZqOahIqaozIkD466S/jda9tKYEOj7wOGJ+eb3f9DDMGvnZ8NJkp5w+mbRb6nzHjNQJBfb/ge5LJSvNIJJWCbvLhQrNsw8h874FSwFKt78DHRGrp9hxf9yTzNc/nb/4YsXzhCWuEUgcDTVB/6f2VZ/wzo84lLgb33Ok7jbanzur3jl5RG55aMXPNkF0O66hi4SNvALGsl8wq9l/6guTNq557BGNFLnD98QubwcOiKQQsp7y0MT8uclVhe8dVQeiXGX0M5ycT66s32clya8vnhgo9nNHRqgMAWmPRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by CH0PR11MB8168.namprd11.prod.outlook.com (2603:10b6:610:186::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Thu, 8 Jun 2023 14:50:54 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::b8f3:958:d2c5:2232]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::b8f3:958:d2c5:2232%3]) with mapi id 15.20.6455.030; Thu, 8 Jun 2023 14:50:49 +0000 Date: Thu, 8 Jun 2023 15:50:45 +0100 From: Bruce Richardson To: "Dumitrescu, Cristian" CC: Thomas Monjalon , Volodymyr Fialko , "dev@dpdk.org" , "jerinj@marvell.com" , "anoobj@marvell.com" Subject: Re: [PATCH] bitmap: add scan init at given position Message-ID: References: <20230414083943.270651-1-vfialko@marvell.com> <8347303.5OynTdThKG@thomas> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LNXP265CA0063.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::27) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CH0PR11MB8168:EE_ X-MS-Office365-Filtering-Correlation-Id: 296f8a79-9433-442c-b9f6-08db682fbff7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TEttq9dNOvvagpQ/4wjfYw2Hq2sdWm0Jpu+5eLlh0GpMbpuKvAHFe+NlrDKqczqWcJ49NGNWUPrvsknmpTyOT8rvkEDi7IR8x1HmlNwPZhD26hQynn79pP0K2FuCPoMDP4/0ZowPBpyXe7mhU179Sicv0sBgwoC9O1kEK7rK4r1KSu93c2FYho42SXosEYXDZ97pQQz9E+fgy8k4QRQGu2nBy7zT8LmsKoYvb6Jc3RXlYRHzyHK4KjLI1fo/2WcqcwShLYDxGtBI6iPfVQTIGI2iIDiTz6eDEqYGGW8j89hPXPWWl4EoD56+mXBkbL6P9gYjarLielJNxCRfsV7DZCwjcpT1/XCkwbfOGxCvIjUezYppT/aNU84gIzEzYkw9Dccb4jWeB27iLREsjalfgzUtNCFPBiJdp41bY/W8KomywaPTPdJNW+SVY0pkKH60kol5QnTUm09jeuHZQ8bVAvufglCX0ihAIwdyDdaqY2NIcAfMAdg4LNPl5lNtRyp08GJnJDkUNJ20huLg6Na7J9whVjM+U9J+xQMJPcFpSw5MpKgioiOLEfXsPjX1tNm0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(376002)(396003)(136003)(346002)(366004)(39860400002)(451199021)(5660300002)(2906002)(86362001)(44832011)(66899021)(6666004)(6486002)(83380400001)(53546011)(6512007)(26005)(6506007)(82960400001)(316002)(478600001)(54906003)(66946007)(38100700002)(4326008)(41300700001)(6636002)(186003)(66556008)(66476007)(6862004)(8936002)(8676002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nyI8WoERTHJQ1qKw11ztHJvxfMaKHUuKlxPGOKI573PMido5rArNlp1ZRmvw?= =?us-ascii?Q?mdpABGxWqx1FE9/MRY5BYbw/mwGp7ly3tb7UcYeFa/3wqgS77br6nhzUaqF4?= =?us-ascii?Q?FGZ5ZhpXfWSSue9+VqUcevDAG4upJL0h1GC3pjWmjeq/3XW/XTSaFhLC3pQQ?= =?us-ascii?Q?s2FRA9pVXxux5+CS+tLE9PiyvZBa3rvtq51xou/fXqa8KZkOePA9jBxzrXVD?= =?us-ascii?Q?tnWOOxq+ie7oS9bOiJcaQABQ+h1w8MHc2KI1HgMH6rAY7K9JLnaVRYR8BTGb?= =?us-ascii?Q?itKPuK7w2fY6YRkYB/6tkKwGbWT63pYSrAg8mREflJoiA79al4wandmnBrhp?= =?us-ascii?Q?MBvxNki+art2mmKTEOKXNLbNT8zD2c/g4EekAMG3JZIIREJNZ4I1REzocL5d?= =?us-ascii?Q?W4vYfVy3iLUxagHVomo0fiXvPPD1TshHD/lcCtM27kFxdPNkzFGXRiWpmve/?= =?us-ascii?Q?zViI36jG9OX58ElBSelTfPRhL1hS01P4IWJ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J0FoN?= =?us-ascii?Q?91xm50K1ana7y3R10Q/CPEwUAN9GDLhKvq//ta0gm+k/T42jGiJukqOoUnH3?= =?us-ascii?Q?YiWofOsOadfPrz9FYDmhr3PEuWBiNbExjVGik61Ic4IbiqD/5g6GS9kNGsHq?= =?us-ascii?Q?A18am4zSI8kPH01tWQjP1htKI/33Si3NF9Jn+Pdwc9FYx12pzGf+uglYHzTZ?= =?us-ascii?Q?h839UxP5/oYBIF34n/gFaLsCkIRA7GcEZQSL6yFV2/yTBNNi4WnDIU6OVOo1?= =?us-ascii?Q?Lw=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 296f8a79-9433-442c-b9f6-08db682fbff7 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2023 14:50:49.8008 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ae7G4D8RBBzhjV+HL/VXORWcCgWEczafCwTjXRXtw21bOxd/01kqVoW5jWJcK8F/wHyIddgRDrwfzUNAehbTY/PHT+hj443go2E+V7C2wHk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB8168 X-OriginatorOrg: intel.com 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 Thu, Jun 08, 2023 at 02:20:13PM +0000, Dumitrescu, Cristian wrote: > Hi Volodymyr, > > Thanks for your patch, comments below under your code: > > > -----Original Message----- > > From: Thomas Monjalon > > Sent: Thursday, June 1, 2023 4:26 PM > > To: Dumitrescu, Cristian ; Volodymyr Fialko > > > > Cc: dev@dpdk.org; jerinj@marvell.com; anoobj@marvell.com > > Subject: Re: [PATCH] bitmap: add scan init at given position > > > > 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. > > > > My understanding is your proposed procedure for scanning starting at an offset is: > 1. Call the new function: __rte_bitmap_scan_init_at() > 2. Call the regular function: rte_bitmap_scan() > > I think this procedure is not ideal, therefore I suggest we create a new API function which has an additional offset argument: > > rte_bitmap_scan_from_offset(struct rte_bitmap *bmp, uint32_t offset, uint32_t *pos, uint64_t *slab). > > Under the hood, the new API should call an internal function similar to yours to start the scan at a given offset (while aborting any scan that might be in progress). Makes sense? > > BTW, do we need to declare the experimental functions defined in a header file to the library map file? I don't see this in the patch, but the patch seems to compile and link fine ... > Inline functions in headers are not real "functions" in the output code, as they get inlined into the caller. Therefore, they have no entries in the version.map file, since they don't exist in the compiled object code. /Bruce