From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F2584A0352; Mon, 23 Dec 2019 06:04:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B06BF1C01; Mon, 23 Dec 2019 06:04:24 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140075.outbound.protection.outlook.com [40.107.14.75]) by dpdk.org (Postfix) with ESMTP id 01EFA1252 for ; Mon, 23 Dec 2019 06:04:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wDT3SEGFRu+vmIJizeVLhYmm8QOlhk2dckdwsLAiwmY=; b=7Vsqb/p16dIyBZqGCLNpgd2pAwvRiEbtQrcEX8+BZMbbRKLkZ0elNi0FEo+P2btcExnl9osyPzRnd/3uKEQsPbSC6pX1ayD4QL/9ks2s0D2jrXMcSqrVf9djKUUhMshpauL8JAFjVGdA+hPPUmuR47txGVvLdRxfmCN5DbUEirk= Received: from VI1PR08CA0122.eurprd08.prod.outlook.com (2603:10a6:800:d4::24) by AM6PR08MB5205.eurprd08.prod.outlook.com (2603:10a6:20b:ee::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.16; Mon, 23 Dec 2019 05:04:22 +0000 Received: from DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::200) by VI1PR08CA0122.outlook.office365.com (2603:10a6:800:d4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14 via Frontend Transport; Mon, 23 Dec 2019 05:04:22 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT050.mail.protection.outlook.com (10.152.21.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14 via Frontend Transport; Mon, 23 Dec 2019 05:04:22 +0000 Received: ("Tessian outbound ba41a0333779:v40"); Mon, 23 Dec 2019 05:04:22 +0000 X-CR-MTA-TID: 64aa7808 Received: from 139f45f8f7d6.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E4F3F081-4402-49F0-AAC9-9249B9908472.1; Mon, 23 Dec 2019 05:04:17 +0000 Received: from EUR01-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 139f45f8f7d6.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 23 Dec 2019 05:04:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IaT2pY+tWGx+FGz6pZQW08k2TW90k8qSuiaFtAFyQxanvnX10tgruQNXAIEQTIGvEXNc8XNic2M/IlCFKW3TSqVwvb8n0vakE8dNH4yqTTglqMsKPYlQ5nQ+1C2E6wswlQIdsKqVkYtDJRk01YV2YyvJLMDDREAYIVg8RrYCQeR3oMDpk4DA2OlCKlNwfjnHt6Jglj1A4Cz0NZtcqRSwZuFCeTCM496Gu3/svvJHf3aXvpprql1DFJCrWLmVc183tmBglzIB/zkTBfQmQYdf2Q4IOGASIEcLqBO9piHCuUSVl9EohzWX3V/UdGumBo8YNx4GGVRliljCAPnp8o4X1w== 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-SenderADCheck; bh=wDT3SEGFRu+vmIJizeVLhYmm8QOlhk2dckdwsLAiwmY=; b=n0ufRb0tcMSliOQv9q/HG/WpC11OwkyWvUYi0XIsXxbvZVs19RInyZW40QRiK98rbIVvukTZbgbchoSF5/6s/+cjbB2CVvY62LkyMQy1sfJ9yqxv0r8UWqOHdGEgQSHlVW/ZWomZzAZ+nTStyR2mjcD10AWjBbSkfNvqcQBurEdoIYpfBzaUT9N1DjjVEhGTtTXg0n7Uk34hcf3g9v69Rq8MwtZD17sGeNCr95pKKSPDzUXqW7Asm4roqR2zCsXJ3p7XjCiHd7eoR9IUX//L/NYiEwNcLvtvkoNJh08PXFW/G9a4rzkpSS55ye99WmF79qEXzuZmPRvc4PhuyjS8dQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wDT3SEGFRu+vmIJizeVLhYmm8QOlhk2dckdwsLAiwmY=; b=7Vsqb/p16dIyBZqGCLNpgd2pAwvRiEbtQrcEX8+BZMbbRKLkZ0elNi0FEo+P2btcExnl9osyPzRnd/3uKEQsPbSC6pX1ayD4QL/9ks2s0D2jrXMcSqrVf9djKUUhMshpauL8JAFjVGdA+hPPUmuR47txGVvLdRxfmCN5DbUEirk= Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.27) by VE1PR08MB4670.eurprd08.prod.outlook.com (10.255.114.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2559.14; Mon, 23 Dec 2019 05:04:12 +0000 Received: from VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::9df4:7af6:b62d:f94e]) by VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::9df4:7af6:b62d:f94e%7]) with mapi id 15.20.2559.017; Mon, 23 Dec 2019 05:04:12 +0000 From: Honnappa Nagarahalli To: Stephen Hemminger CC: Joyce Kong , "thomas@monjalon.net" , "david.marchand@redhat.com" , "mb@smartsharesystems.com" , "jerinj@marvell.com" , "bruce.richardson@intel.com" , "ravi1.kumar@amd.com" , "rmody@marvell.com" , "shshaikh@marvell.com" , "xuanziyang2@huawei.com" , "cloud.wangxiaoyun@huawei.com" , "zhouguoyang@huawei.com" , Phil Yang , Gavin Hu , nd , "dev@dpdk.org" , Honnappa Nagarahalli , nd Thread-Topic: [PATCH v6 1/6] lib/eal: implement the family of rte bit operation APIs Thread-Index: AQHVtWiBQ1n0Dk5tDEKroTViQBZDeKfCfMMAgAJBDyCAACp8AIACRrEg Date: Mon, 23 Dec 2019 05:04:12 +0000 Message-ID: References: <1571125801-45773-1-git-send-email-joyce.kong@arm.com> <1576648808-24765-2-git-send-email-joyce.kong@arm.com> <20191221100752.04838f7a@hermes.lan> In-Reply-To: <20191221100752.04838f7a@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 40a480d4-3a06-4e1c-8ae0-a5b3de9f3f43.0 x-checkrecipientchecked: true Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5463b067-2f4f-46ce-20fb-08d787659304 X-MS-TrafficTypeDiagnostic: VE1PR08MB4670:|VE1PR08MB4670:|AM6PR08MB5205: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:8273;OLM:8273; x-forefront-prvs: 0260457E99 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(136003)(366004)(396003)(39860400002)(199004)(189003)(81166006)(6506007)(81156014)(8676002)(66556008)(66946007)(66476007)(66446008)(64756008)(7416002)(186003)(26005)(478600001)(4326008)(33656002)(8936002)(71200400001)(2906002)(55016002)(9686003)(54906003)(7696005)(316002)(76116006)(4744005)(5660300002)(6916009)(86362001)(52536014); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB4670; H:VE1PR08MB5149.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 6wtvALlDboizuSSWfz1dS9CkHtOLI5RE4jGkciZmjLFnI4JI+DIjlwRavCBXw9AMvy/nmbk9qeZ2bKqJ4B9+/1HbA7dXCqPca/12SJANXJ371CUG3oVFCbHvI6oQmzpZUQBnEnQkGHr4vtKtemlDhGmycqzhvGPNX+UWSblR8x4XraxBlzUXZDt27/h8fnY/B2qQRcaIw9E6WTSBum6fSNNd20bmXG43K92y1b2ueedpzwY1m72WYmD2HsU3oM0l6W5zxsY5ECr9X75yDBfnSfooahYwrSATg26RTXikOB6HJfLxNrqnDhG3Es9H7v3JVYdV7bfp6nXm8zkYsuj4gba+Jv8GdjWDL8EJ4/z7Y3i751AWk5Wvvv+PJIgKD22KDIfOgpsffDdpk/YKdAVjosnUOrf0nKoflZ4RjJBwFf4UHkaZlVZtZ5dybvSdlUiB Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4670 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(39860400002)(396003)(136003)(199004)(189003)(186003)(6506007)(26005)(6862004)(9686003)(55016002)(81166006)(8676002)(81156014)(336012)(54906003)(2906002)(478600001)(26826003)(316002)(8936002)(7696005)(4326008)(76130400001)(33656002)(70206006)(52536014)(356004)(70586007)(4744005)(5660300002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB5205; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Pass; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; A:1; MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: 550601cd-aad7-4542-2248-08d787658d28 NoDisclaimer: True X-Forefront-PRVS: 0260457E99 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ccYd45nLp36STBWD6gqZEhli8ItOLEBNZCoFtyvFJ8RgWbBQdYL2KIJ2ostBgSViFBX6rYU65RWsDgWpUy3HQKJA23x6Nf/0OXw416AM6mvziLK8k1Fi2mrzPpXQrlu7mWPegMd4/q/SRkfOK5eYGD+WBo6hRXj0HRJYDSRMczUWtN3OPWvKutSpGouadVboLyNe9itgjzJ92Xfmk45DvoTXtJxXIImEvKOV0A1loYrvKVtGhwZAdH4sN7X/oRvUBoPkxd5KlMZROd1Ng4MTN3LOWpOJ3XNCzvtZ+J6IlmiA6ERLWrHNvoWHL0Rwa42MbkMNkTRDNsjU4uGnZXz75dLGrWciScy/DUcKWdjctnh2SkXDNYTWGwAq4baDnsVR8BKnWYAk7tCb6c25W7oQd3AvYCsNDHEYfEEtFERg4A6KSdpM525ijtdZxv6j+YlV X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2019 05:04:22.3642 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5463b067-2f4f-46ce-20fb-08d787659304 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5205 Subject: Re: [dpdk-dev] [PATCH v6 1/6] lib/eal: implement the family of rte bit operation APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" >=20 > On Sat, 21 Dec 2019 16:07:23 +0000 > Honnappa Nagarahalli wrote: >=20 > > Converting these into macros will help remove the size based duplicatio= n of > APIs. I came up with the following macro: > > > > #define RTE_GET_BIT(nr, var, ret, memorder) \ ({ \ > > if (sizeof(var) =3D=3D sizeof(uint32_t)) { \ > > uint32_t mask1 =3D 1U << (nr)%32; \ > > ret =3D __atomic_load_n(&var, (memorder)) & mask1;\ > > } \ > > else {\ > > uint64_t mask2 =3D 1UL << (nr)%64;\ > > ret =3D __atomic_load_n(&var, (memorder)) & mask2;\ > > } \ > > }) >=20 > Macros are more error prone. Especially because this is in exposed header= file That's another question I have. Why do we need to have these APIs in a publ= ic header file? These will add to the ABI burden as well. These APIs should= be in a common-but-not-public header file. I am also not sure how helpful = these APIs are for applications as these APIs seem to have considered requi= rements only from the PMDs.