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 8AB3642C5E; Thu, 8 Jun 2023 16:20:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C8DA41153; Thu, 8 Jun 2023 16:20:41 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id C3C9541148 for ; Thu, 8 Jun 2023 16:20:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686234039; x=1717770039; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Cx9bXTWfA5t7MwS2D1AuYVjyG1WtifVWDuaJB5hz7kM=; b=E0Iei4CPbTaHGchGPxB/gtR0tM4fu0IGCxyy2O32RKtAYAjwnmD7zS1T LNZQNd0EQawdqO+baUyLWcCUoIrjuP/YF0BW/9JcUQMloo3GOzQzfNX3l ynTPbZfPzTBLvgrUuyRaHvhx0CwHOkhgANgt9Uap8ZLzsca+2U0OCe2Y8 Fuws3Glxb0b9JcapKvGG8LbIRk4q/FZeVIpbaFyZqUIz80V7ZS7AsMs1S imIfcj74swgEvndHiAi+0GqudNxAXGevnhBIs/X3yyuA9UvlMaxwL08yP oI+/rTKhjnx7wHg0mH7jpYrVIAxdp0if0bRe6sk9Qvm34EjcRgo0oMsEO A==; X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="356175803" X-IronPort-AV: E=Sophos;i="6.00,227,1681196400"; d="scan'208";a="356175803" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 07:20:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="1040123194" X-IronPort-AV: E=Sophos;i="6.00,227,1681196400"; d="scan'208";a="1040123194" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga005.fm.intel.com with ESMTP; 08 Jun 2023 07:20:14 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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:20:14 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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 via Frontend Transport; Thu, 8 Jun 2023 07:20:14 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) 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:20:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NUq5AKR4Yvxcm2EkVRXlbIzBo9emlsbOo0ikuqY7kRnAZ51ISzzi/QtuI0kRlHQ+qdVvIVmf6ZwsPV7yNO54tUUHV9j7ANBpoMYPHKwAFQnA+f1ub/8uJ3OyO8dYJB3/CUG1NWyEs0Xq/0wgtrbAU63khtfj028c7o7g4MLCH0marAjViII7MTMlR3s+TGuCAaOeWpRe/xbmmEJmliRelpzovQoMsuAVWJJPM00jMJA0pNM8E22wJDVaSObiKoq4lL3ygKMgfyQ9omA2BNiYUPdg+EVkT/fO0ZfPjNg5lUWRAA43/Q46B2oDCyLbRPGcxUhgYWPpslSCaM/SFLZ+9w== 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=XLkrB8anF1QQf4mx9q7mOIkjw2IEyP96M7xsEv2CL3o=; b=OI20DFEO74YDsj98TpNKqrZRzD66JFX3NtvZHNHkea5QmnoWXYy8T681cwqWdWyC1rvBYBI1pJ2nXUaiQg0Cg6CnEI8NvyBO5Iauv3P5eBUB1ijzIDxBLPDDirRQhbA9IFaIYPxX7kXdjAoEFC6vEsOju3umk/DodiPlk1VWKA1fOAAFH0ASp8qo7fBQ6u39FF3AnJWAnnBQ3OKI19RtWQbBSufNHQCCZP6n3SjWwYufN6rN5jF4QrYEyN5IAnBvh3IbQ1R+6RBECRzqvr4P9MI0BrhoBhpFiWy9WRDax/aRFM6AWeEu3JkmV3hgJLzLBRoF8gwxFe+GLanPVZHLqQ== 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 Received: from DS0PR11MB7442.namprd11.prod.outlook.com (2603:10b6:8:14d::22) by CY8PR11MB6841.namprd11.prod.outlook.com (2603:10b6:930:62::11) 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:20:13 +0000 Received: from DS0PR11MB7442.namprd11.prod.outlook.com ([fe80::2bac:af97:3153:4e7f]) by DS0PR11MB7442.namprd11.prod.outlook.com ([fe80::2bac:af97:3153:4e7f%6]) with mapi id 15.20.6455.030; Thu, 8 Jun 2023 14:20:13 +0000 From: "Dumitrescu, Cristian" To: Thomas Monjalon , Volodymyr Fialko CC: "dev@dpdk.org" , "jerinj@marvell.com" , "anoobj@marvell.com" Subject: RE: [PATCH] bitmap: add scan init at given position Thread-Topic: [PATCH] bitmap: add scan init at given position Thread-Index: AQHZbqzeSEKeWXb+6ESFlA8ibx77Ta92XX8AgArp0bA= Date: Thu, 8 Jun 2023 14:20:13 +0000 Message-ID: References: <20230414083943.270651-1-vfialko@marvell.com> <8347303.5OynTdThKG@thomas> In-Reply-To: <8347303.5OynTdThKG@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DS0PR11MB7442:EE_|CY8PR11MB6841:EE_ x-ms-office365-filtering-correlation-id: b6b18689-140e-406b-d5a1-08db682b7986 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gHScyP451Cyfg7nDFc+3PfjBpcI4l6BtBiyaHMaiq8dHdoWLJ5378gBPuyPmPXCk7KqP+96ne83VmYkk+691IQNByIptUVlO5vqSg1Bbr0xDsw/xh0BrlTkWKYPMtVwmOMeeZ4lPT4CcfT8truwDjpl8CiQIhaT9RNxNQukrZqGCbh0sTRZPZUZ+Wk+S01pa90eaHneIGLfYYDrsgKzFa1jPJz9o46760s9oLoFkaNJ/WD6aOOBEdmT63obKaTX+b0E6OY2QjV51iTQHWUGgqOE6WeaXnAYBfi23sMvP0SlKoJGqQCuZIlCOpkBKq6aoOw0WxVFcn0q+KPLMa5BtruRtpv8apbAQZ+ij/6YPgQSzKXapJTzvc33J8wA4AiwpCBdxZfT8lgw+Hn0vqXEUoibFZsWA2bnB8bKitjutEbUodD17+nc0X91giTEvv7jCYvsYPoqcrdYzZZXHuHwnjz/eYlbSUtJxqdhWEM7dmGyZNaeokK3eDn9DKR26MX+HC1ZGaK0b3UP8LF5i49J0BjtZPcx8AfyQgG3Tnongg+Lq1AdCyvHXCaRsCxZta2yK3bzErncCvU415QJ4dM1Cx1O9eGmP+3qCqvoRp0q/19nxF3QFH9FgWGZBrpAFx376 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7442.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(39860400002)(376002)(346002)(136003)(366004)(396003)(451199021)(41300700001)(38070700005)(66899021)(316002)(478600001)(8676002)(66556008)(33656002)(55016003)(2906002)(76116006)(66946007)(66446008)(8936002)(64756008)(86362001)(5660300002)(52536014)(66476007)(38100700002)(82960400001)(4326008)(122000001)(7696005)(110136005)(54906003)(186003)(83380400001)(71200400001)(53546011)(26005)(9686003)(6506007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?elQD7Ebgxiii1YmxVKcLD+BOisxYqkwvFuvmUEAVoNx9ujNMzN3p6UiLdBDn?= =?us-ascii?Q?kMUiqJyHiTjKV/LC0dhavxjk8+MO5ij1d6XEjlTiFEVgA5skGaaS1Ix1rus9?= =?us-ascii?Q?s26ilULDnFnoHeOQPDkRiurA+pj492I7Ip1BbzJWuVvqq+3xhStFGENksfis?= =?us-ascii?Q?gT2xO+sbuSd085VGf/eyZT9F82F+OpqqCxDBCGXG3iBGPVRACeSRU8UqH1DG?= =?us-ascii?Q?ekCZM11Pc7q/JsFBbGrCgWIK0uIWW0WuEjs6MqN602BFQyYeFqvJVnvccWtU?= =?us-ascii?Q?xsPZt0JOnJtJpCiypv5UlO2UDvNCgcr9KlLzhoLFZWlALVI+2ryR9a0CATab?= =?us-ascii?Q?2G2hsA+kZbm+93UkQDqxnmHZ9DEkWFJnTTce5wTBY6Q+cSyDIPYpo9ZPUP6f?= =?us-ascii?Q?+41UHCPVYw0Um24L4aC90iDGR4vd+8nS5+yxIe6TNIgGV9DTSVGO2Pe5kyv8?= =?us-ascii?Q?XoUhdtQGIq0FHeP9RQLzjxLjF/rTqwhD8w63BwO74li4E+2eJMb+a3W5N0Eh?= =?us-ascii?Q?gAZko1+LHlflPnOpE7LNzFPwrCg27d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q?xqz53WRT1fNHYOFmRcrx64sxOGotedL/nmCapgd+c3O4i4rYlzrfelSoUfXe?= =?us-ascii?Q?LR08so+TrLKI0dLA6m9cJH+Bo8LzI/R7rQoiiE7H9T2G4UXiLvdCzucLhkcC?= =?us-ascii?Q?DN6iYKNuYbGuvc/RH4hhG7pKtrkX8cHfl46fmnWqOfiU3p+9A6nfMJTy3ZMU?= =?us-ascii?Q?+A=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7442.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6b18689-140e-406b-d5a1-08db682b7986 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jun 2023 14:20:13.4372 (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: u8lPBgL79vR3xlpKvRcfQfc+olbajvdwXSV2lSRmuashS5+3fUlMFCpWRvC9maOK8OS3n6fGuU2o8ML9fgP2UCX+mhUqtuTL98h8AIVhCeo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB6841 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 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 Fialk= o > > Cc: dev@dpdk.org; jerinj@marvell.com; anoobj@marvell.com > Subject: Re: [PATCH] bitmap: add scan init at given position >=20 > Cristian, please could you review this patch? >=20 > 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 valu= e. > > > > 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 =3D pos >> (RTE_BITMAP_SLAB_BIT_SIZE_LOG2 + > RTE_BITMAP_CL_BIT_SIZE_LOG2); > > + bmp->offset1 =3D (pos >> RTE_BITMAP_CL_BIT_SIZE_LOG2) & > RTE_BITMAP_SLAB_BIT_MASK; > > + bmp->index2 =3D pos >> RTE_BITMAP_SLAB_BIT_SIZE_LOG2; > > + bmp->go2 =3D 1; > > +} >=20 > It is supposed to be an internal (inlined) function > but it is not used. >=20 My understanding is your proposed procedure for scanning starting at an off= set 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 AP= I function which has an additional offset argument: rte_bitmap_scan_from_offset(struct rte_bitmap *bmp, uint32_t offset, uint3= 2_t *pos, uint64_t *slab). Under the hood, the new API should call an internal function similar to you= rs 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 f= ile to the library map file? I don't see this in the patch, but the patch s= eems to compile and link fine ... Regards, Cristian=20