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 AFCF2A318B for ; Fri, 18 Oct 2019 11:01:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 607EE1C0BF; Fri, 18 Oct 2019 11:01:25 +0200 (CEST) Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by dpdk.org (Postfix) with ESMTP id 0E3091C0BE for ; Fri, 18 Oct 2019 11:01:24 +0200 (CEST) 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=3QYCXgY7+4EvbWNG+B0e3R7/NpdXvhb8HYQCJ7Xsckc=; b=ABf/6hRReQ5qaz+aMq4YUn1AKRc9jp1DW+RPfkClS3WzORHQ15EiNA3LRh1VG7kkcT3zflU5bOP3UJ2PUVpzxjm7JUqyJRgZyeeVM7BbGFXjWvKB5Q5sDirY0f/YcolGGON60HkCcxTkF/4y3hZTcotTYicETr5sQ2Mn97vPNRE= Received: from VI1PR08CA0116.eurprd08.prod.outlook.com (2603:10a6:800:d4::18) by AM6PR08MB4818.eurprd08.prod.outlook.com (2603:10a6:20b:cb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Fri, 18 Oct 2019 09:01:22 +0000 Received: from AM5EUR03FT064.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::207) by VI1PR08CA0116.outlook.office365.com (2603:10a6:800:d4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2347.16 via Frontend Transport; Fri, 18 Oct 2019 09:01:21 +0000 Authentication-Results: spf=temperror (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=none action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT064.mail.protection.outlook.com (10.152.17.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2305.15 via Frontend Transport; Fri, 18 Oct 2019 09:01:20 +0000 Received: ("Tessian outbound 0939a6bab6b1:v33"); Fri, 18 Oct 2019 09:00:47 +0000 X-CR-MTA-TID: 64aa7808 Received: from 40f8e485d397.2 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.10.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id B28A4E88-9253-44D4-A4C7-6FF8A5FB1BC9.1; Fri, 18 Oct 2019 09:00:42 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03lp2055.outbound.protection.outlook.com [104.47.10.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 40f8e485d397.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 18 Oct 2019 09:00:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e23IJE6mqWhuIJkpHQ+46nPJEOBn6StBRG5IHMCfiQRtTLP5uRz9oEizZR5Wxwut8vTT9yLelNX47mjLMqk0Q1sgPUCVZL9p46nQPInUzzHctZHRqhuZAjlevR3or6Vde/wOTMQJFwLYhy0f2LdtpqyAjV0paiXzmwW7JcbPDpIAQQGMAVbH2L2f19r0GrPrRifpDALL2sIxdv2JOObkA/jWb0pwxOcMyzgNht3vg9MU2L042uXOHr1LEzfoi/ITCjrTmxvXbeiXjeb8Z2x4+M1Tu2gpaqKhguzPGsQ2ywYB65YGDSpy+EOHzFLxwQUid70nvSGsosQTRgNr5RUDPg== 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=3QYCXgY7+4EvbWNG+B0e3R7/NpdXvhb8HYQCJ7Xsckc=; b=m3BJcS7vWRF2S4OfYlEWs+NwaRiNC5GJgOlA2DQy8ojQCA5Zl+MyIBr/YhCUVVw7xVGX3QrMD98FtvuozQgyMn4HnQm44pGIcwcLNf0D3dQ+In9khGFY9LGHcnz1D7xa1Uo15da9G2LpLG3YQ2Vavoa0Cq/aWTSbWuOkBV7i6ugmGs7pEgt3mLgj99+9Rb9TvW413y7+jTlhDqiE4D6uxYCE0NVV/+rel0urU9FiZwGRv8Mmufti2Jyimlx/GON5MtoYDM5fmWFsdYgZXcPHCX9Edw/ChF3Yok4fsOad/Snp5IgaC0jE5vg6dznEqnxb5nQIiNf5zaFDyQbdntnGLg== 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=3QYCXgY7+4EvbWNG+B0e3R7/NpdXvhb8HYQCJ7Xsckc=; b=ABf/6hRReQ5qaz+aMq4YUn1AKRc9jp1DW+RPfkClS3WzORHQ15EiNA3LRh1VG7kkcT3zflU5bOP3UJ2PUVpzxjm7JUqyJRgZyeeVM7BbGFXjWvKB5Q5sDirY0f/YcolGGON60HkCcxTkF/4y3hZTcotTYicETr5sQ2Mn97vPNRE= Received: from VI1PR08MB3981.eurprd08.prod.outlook.com (20.178.126.10) by VI1PR08MB4334.eurprd08.prod.outlook.com (20.179.27.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.21; Fri, 18 Oct 2019 09:00:39 +0000 Received: from VI1PR08MB3981.eurprd08.prod.outlook.com ([fe80::6054:666f:997c:1a68]) by VI1PR08MB3981.eurprd08.prod.outlook.com ([fe80::6054:666f:997c:1a68%5]) with mapi id 15.20.2347.024; Fri, 18 Oct 2019 09:00:39 +0000 From: "Joyce Kong (Arm Technology China)" To: Stephen Hemminger CC: "dev@dpdk.org" , nd , "thomas@monjalon.net" , "jerinj@marvell.com" , "ravi1.kumar@amd.com" , "xuanziyang2@huawei.com" , "cloud.wangxiaoyun@huawei.com" , "zhouguoyang@huawei.com" , "rmody@marvell.com" , "shshaikh@marvell.com" , Honnappa Nagarahalli , "Gavin Hu (Arm Technology China)" Thread-Topic: [dpdk-dev] [PATCH v1 1/5] lib/eal: implement the family of rte bit operation APIs Thread-Index: AQHVg3kZUGNdDqM0K0e4sfDNqObe/qdgHeUA Date: Fri, 18 Oct 2019 09:00:39 +0000 Message-ID: References: <1571125801-45773-1-git-send-email-joyce.kong@arm.com> <1571125801-45773-2-git-send-email-joyce.kong@arm.com> <20191015095332.6c4934eb@hermes.lan> In-Reply-To: <20191015095332.6c4934eb@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 7de844b1-ef2c-4edc-9779-53a0212e5105.0 x-checkrecipientchecked: true Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Joyce.Kong@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email X-MS-Office365-Filtering-Correlation-Id: b78f2cf7-1c1f-4980-9075-08d753a9be36 X-MS-Office365-Filtering-HT: Tenant X-MS-TrafficTypeDiagnostic: VI1PR08MB4334:|VI1PR08MB4334:|AM6PR08MB4818: 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:2331;OLM:2331; x-forefront-prvs: 01949FE337 X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(366004)(136003)(346002)(396003)(39860400002)(376002)(13464003)(199004)(189003)(54906003)(64756008)(26005)(76116006)(102836004)(66066001)(8676002)(7416002)(7736002)(4326008)(66946007)(71200400001)(71190400001)(74316002)(66476007)(9686003)(229853002)(256004)(478600001)(55236004)(2906002)(66556008)(86362001)(66446008)(5660300002)(6506007)(52536014)(53546011)(6916009)(11346002)(7696005)(446003)(186003)(14454004)(25786009)(76176011)(33656002)(3846002)(55016002)(99286004)(8936002)(6246003)(305945005)(6436002)(316002)(81156014)(6116002)(486006)(81166006)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB4334; H:VI1PR08MB3981.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: jFPo/FucW7U2q5iUk4v3JTcN8NCkeFST9sveboG1weRtfewG5Svb50jnnALNMfTmkbJ9+euinwT/VTPpCYuCxicymhp6iWuoHDE2kabKFhecKWqX/BNnG+JvFTxyLzNjDmeLJBpOiW8EriMKICjd7xQyt4BvndaOJ6s0NmbdjHzk07X4D4zRQDkTP3/W+enY1GMMzROGeyoCPx0yo/Wdf7h+ATHk6Af/9p6exhq7dKCuxKxU5VngbETp83xoChPzyDOdv9uPzHuAdxddViti3QeZhPrd+hpWetx3jEedpcm6QtOmIuTMftPuWqkG8ac5NvbGBVcXMlVT8t54zyw6PTYsRr6NliJH+MpZoH1ceHU9AJlalMw24a/s+SFOB/9bnPYMC6y9vPZom9RNMmCJZ1BA5EzXJrDQI/Gdg0aslaw= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4334 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Joyce.Kong@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT064.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)(376002)(136003)(396003)(39860400002)(346002)(13464003)(189003)(199004)(5660300002)(126002)(33656002)(63350400001)(54906003)(26826003)(25786009)(336012)(9686003)(36906005)(52536014)(86362001)(47776003)(50466002)(22756006)(66066001)(97756001)(11346002)(99286004)(229853002)(316002)(446003)(7696005)(486006)(55016002)(476003)(14454004)(478600001)(74316002)(305945005)(7736002)(102836004)(70206006)(356004)(26005)(3846002)(6246003)(76130400001)(6116002)(23726003)(81156014)(81166006)(70586007)(8936002)(8676002)(186003)(6862004)(53546011)(6506007)(46406003)(4326008)(76176011)(2906002)(8746002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB4818; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:TempError; 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: 20db184a-09c2-4066-563d-08d753a9a5e3 NoDisclaimer: True X-Forefront-PRVS: 01949FE337 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WWJuURY7jd7/M7jvxzOJ5afLCaA9DvqK9wQ3tQI96dNAo2WUhfHL/Wsik4kWv/QDx4LzSvJ47vYk31Mbt1duu/4sZjklO1qqGEkm29WLh8ILE1lkzMFBBKrul/QodIq7rgrVznZGTI3Epzy1UJ88gIDuMKH8wzSzXXvGnYPLM3hfJCWGTB3u7Aw3hDyzAZGTpxkQX4j5iKbhLG0Pfx4j6r1M2sGZprvNGJUZvejWmfh75/MeyPRnEC0fmArWYLzZuX8Y8v2fDEMFNoKh8j9SQElgBwWtVn8NZeP7qKQMcxH8qCT6sqcZXn172nUYVIPJeJd622oC87lDChJyoFAJwQ1X0MO6y3OJZlIl5B7qe5NcOYh2cGCR3MZqmeb9ApWTV3bQsW4N5WhGY1mQtay+wNw7RvJ8w5g38ydGB3pBnfM= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2019 09:01:20.1189 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b78f2cf7-1c1f-4980-9075-08d753a9be36 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: AM6PR08MB4818 Subject: Re: [dpdk-dev] [PATCH v1 1/5] 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" > -----Original Message----- > From: Stephen Hemminger > Sent: Wednesday, October 16, 2019 12:54 AM > To: Joyce Kong (Arm Technology China) > Cc: dev@dpdk.org; nd ; thomas@monjalon.net; > jerinj@marvell.com; ravi1.kumar@amd.com; xuanziyang2@huawei.com; > cloud.wangxiaoyun@huawei.com; zhouguoyang@huawei.com; > rmody@marvell.com; shshaikh@marvell.com; Honnappa Nagarahalli > ; Gavin Hu (Arm Technology China) > > Subject: Re: [dpdk-dev] [PATCH v1 1/5] lib/eal: implement the family of r= te > bit operation APIs >=20 > On Tue, 15 Oct 2019 15:49:57 +0800 > Joyce Kong wrote: >=20 > > +static inline void > > +rte_set_bit(unsigned int nr, unsigned long *addr) { > > + __atomic_fetch_or(addr, (1UL << nr), __ATOMIC_ACQ_REL); } > > + > > +static inline void > > +rte_clear_bit(int nr, unsigned long *addr) { > > + __atomic_fetch_and(addr, ~(1UL << nr), __ATOMIC_ACQ_REL); } > > + > > +static inline int > > +rte_test_bit(int nr, unsigned long *addr) { > > + int res; > > + rte_mb(); > > + res =3D ((*addr) & (1UL << nr)) !=3D 0; > > + rte_mb(); > > + > > + return res; > > +} > > + > > +static inline int > > +rte_test_and_set_bit(int nr, unsigned long *addr) { > > + unsigned long mask =3D (1UL << nr); > > + > > + return __atomic_fetch_or(addr, mask, __ATOMIC_ACQ_REL) & > mask; } > > + > > +static inline int > > +rte_test_and_clear_bit(int nr, unsigned long *addr) { > > + unsigned long mask =3D (1UL << nr); > > + > > + return __atomic_fetch_and(addr, ~mask, __ATOMIC_ACQ_REL) & > mask; } >=20 > These functions need to be part of API, and have doxygen comments? Will add doxygen comments in next version.