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 6C079A04F6; Tue, 7 Jan 2020 01:42:10 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B2EC31D732; Tue, 7 Jan 2020 01:42:09 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60083.outbound.protection.outlook.com [40.107.6.83]) by dpdk.org (Postfix) with ESMTP id 37F8D1D726 for ; Tue, 7 Jan 2020 01:42:08 +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=NB0Ub6h/y6C0N+l9nCXtwUmFvNDrjCHVjwnPK4AVNag=; b=rPdjbE9IdwEkbsOKNw0riMTqzw0cigjoFIzhO0GKsMoejutvK9suSOTPG3ez22vZjeICjp6vh4+Af02m4DcKpVgbZdfX0/JMckziwQZP5oIxnorRgs+f94MFcDO6Sltz2Ef8WzVLaOVFd838fd9kDksAKveNSrTGfLXQXoNr9M4= Received: from VI1PR0802CA0026.eurprd08.prod.outlook.com (2603:10a6:800:a9::12) by VE1PR08MB5087.eurprd08.prod.outlook.com (2603:10a6:803:114::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.13; Tue, 7 Jan 2020 00:42:06 +0000 Received: from AM5EUR03FT055.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::201) by VI1PR0802CA0026.outlook.office365.com (2603:10a6:800:a9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Tue, 7 Jan 2020 00:42:06 +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 AM5EUR03FT055.mail.protection.outlook.com (10.152.17.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Tue, 7 Jan 2020 00:42:05 +0000 Received: ("Tessian outbound 121a58c8f9bf:v40"); Tue, 07 Jan 2020 00:42:05 +0000 X-CR-MTA-TID: 64aa7808 Received: from de732f88c5d7.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C36C11B3-2484-484E-BF82-B3019A5EE54F.1; Tue, 07 Jan 2020 00:42:00 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id de732f88c5d7.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 07 Jan 2020 00:42:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oh8FaW7y2EsHaO2h1NTSp/IsbrK7ylPX5SI4eWUVxSyP0nxfueIrtVfq5yMoGuiEZqkjvHwl9rUaHMcCOHARPiEQYw29YroR/eaEYu83Y6k3jU1COPVRfl3le92CSyYZ+B77AtE+7K8BRvB9TwVzFV9RtETR1UvOCt9Y6V3FIsoLwIzlZMWBQGg+n6VVC4IglQt0wgxHRkQ6r7rI+uCjDmYUDXyYJn8NmcQCl6nJ9IRObGZ9B+di0fxv4cQaJIg+CFGHbCP+u30iG5mJA+5DLlivuRZYHgdLSAITl+YZ+chbgMaG5sS1QfmiFBea1xqYWP1mtXBnWUlslVqHr6UcVQ== 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=NB0Ub6h/y6C0N+l9nCXtwUmFvNDrjCHVjwnPK4AVNag=; b=eC85uIJMKFuVn1Hz5Bv07tRygaupZZmZ07he6g86i+6BtiK0Q4yjXuxZ1+2WnGFvIZB2PDXo4/98zqzNM44/QPGYXPRInrAZlKgRatOhLRC6Uct38xzF/k9QCW8q6MH1xnYyFsY4AnHRBFStv5Anz5tqkvOSv5T/YS1rrkoJlXpT8MGVuXhtFe4lPuVC+qExXY6wc1+55NqRfj81cOo65Ppqh+LWSEgq/DrSP86jutSY8MslBiOoJAtBuYFLc9nynha1dTYsBPSh9OHjeXzJnucafOP4YRjnZb+3N+lR9T9H6Tz+Ue/wC4CqWc1+iGtgDOTbfz0bM70dbIYU8JlREg== 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=NB0Ub6h/y6C0N+l9nCXtwUmFvNDrjCHVjwnPK4AVNag=; b=rPdjbE9IdwEkbsOKNw0riMTqzw0cigjoFIzhO0GKsMoejutvK9suSOTPG3ez22vZjeICjp6vh4+Af02m4DcKpVgbZdfX0/JMckziwQZP5oIxnorRgs+f94MFcDO6Sltz2Ef8WzVLaOVFd838fd9kDksAKveNSrTGfLXQXoNr9M4= Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.27) by VE1PR08MB5039.eurprd08.prod.outlook.com (10.255.159.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11; Tue, 7 Jan 2020 00:41:57 +0000 Received: from VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::29eb:a1be:8f8f:fae2]) by VE1PR08MB5149.eurprd08.prod.outlook.com ([fe80::29eb:a1be:8f8f:fae2%7]) with mapi id 15.20.2602.015; Tue, 7 Jan 2020 00:41:57 +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: AQHVtWiBQ1n0Dk5tDEKroTViQBZDeKfCfMMAgAJBDyCAACp8AIACRrEggADEggCAFoeUYA== Date: Tue, 7 Jan 2020 00:41:57 +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> <20191223083644.4de8e184@hermes.lan> In-Reply-To: <20191223083644.4de8e184@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 68c9850d-5678-4008-b942-f200a52368e9.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: cd429d84-e3ca-43c3-a426-08d7930a6b98 X-MS-TrafficTypeDiagnostic: VE1PR08MB5039:|VE1PR08MB5039:|VE1PR08MB5087: 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:8882;OLM:8882; x-forefront-prvs: 027578BB13 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(186003)(8936002)(71200400001)(478600001)(52536014)(33656002)(76116006)(7416002)(86362001)(8676002)(81156014)(26005)(66476007)(81166006)(66946007)(66556008)(64756008)(66446008)(7696005)(55016002)(9686003)(2906002)(5660300002)(316002)(6916009)(6506007)(54906003)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5039; H:VE1PR08MB5149.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: TEfoHzPBK4hm2Uy/csO/4CR3rbchgDpEEx6tHf5P1CeZou7RDBgDRNyzCk3ctVQDU8edzeQfDnoY3+Tj79i1sgTGllc1JFtFN7BvCHKp9cFka9lTJJ7uyOU+g0RF76/seHylGY+acmG1I9qEjRy7Ic5F1yi71zIfgsvoyhH/xOwvCeSsvYi6pW4UDSk5Qu7Dsz1Xlz/klLQDyAEHqIt8Y+yTSPffQ08nS/zxwoWsUlAZZ9Q7j5cEFe0VXXhWaloBuMiHzVA5CutKSt6Ye22U4SdjoGbEqlF9v/q9RpSuFegI52QvqKuKYW/EElTIwCXHI4yQG2D3q8qZG2+Bw1PnED2QX64pORJ+7A+vIYFTi9D5F1CTtgdvZYTJUT6o5UuZjjH4M9usHqGAunBQ8KATWMl2u1ZnqFCht3LYFc1eOvDoTe4+QCkS6egcNZ1vvqme Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5039 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT055.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)(39860400002)(376002)(396003)(346002)(136003)(189003)(199004)(33656002)(86362001)(8676002)(26005)(8936002)(336012)(81156014)(54906003)(2906002)(81166006)(5660300002)(316002)(6862004)(478600001)(6506007)(356004)(52536014)(4326008)(26826003)(7696005)(36906005)(55016002)(70206006)(70586007)(9686003)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR08MB5087; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Pass; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: aaae6eb1-4fb4-451e-b509-08d7930a66b0 NoDisclaimer: True X-Forefront-PRVS: 027578BB13 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LTzJORmIy1bn0lweisMX3rYLkVUVQUH8zTBVtdGwZGJ7VhPvBChUFcexC2rVJnoeNS6wLX/+8o36RkHM+Whaj8RrurJCKx1r+4oYgfk4vQkJDjik5Q7U1Dvb2xUaLIC2mjxptwM9Tsz05oqeEqScAcKovwVvnpQ+ZttJZNBWxuLy0P+aS5ddrT7nQGSIkFGwqIJPPJjv3erHZsrEXA0PtqWlaaPMIBSuauwmGuKx1lQ2IrnejBQL1p6i38blBA8elibz33wgwbUAyCvBNrn4SnGWqJW4rdu4wpOd2wu3GGbZRV+O8Yl4GXcjSOZzi+UqsVzixkFro+g3ktmQZFP7WtP1cSD6yjhpoQCxWV8xQry8uS1FTQcDNeYCTAWwgkNhgvV9/rTjHC+nskAgKY0g2SCcxzuxGp4ABRx+iIVnMMKImRGea4dwa01KlPrPQIH3 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2020 00:42:05.9595 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd429d84-e3ca-43c3-a426-08d7930a6b98 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: VE1PR08MB5087 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" > > > > > > > > On Sat, 21 Dec 2019 16:07:23 +0000 > > > Honnappa Nagarahalli wrote: > > > > > > > Converting these into macros will help remove the size based > duplication 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;\ > > > > } \ > > > > }) > > > > > > Macros are more error prone. Especially because this is in exposed he= ader > file > > That's another question I have. Why do we need to have these APIs in a > public 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 consid= ered > requirements only from the PMDs. >=20 > Why do we have to wrap every C atomic builtin? What value is there in tha= t? As long as we stick to requirements from PMD we do not need to worry about = every atomic builtin. We seem to be making these APIs public, which require= s us to keep these APIs generic considering possible future requirements.