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 5C14AA0546; Thu, 16 Jul 2020 09:30:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6EB931BEA5; Thu, 16 Jul 2020 09:30:03 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60047.outbound.protection.outlook.com [40.107.6.47]) by dpdk.org (Postfix) with ESMTP id 36E1C1BEB4 for ; Thu, 16 Jul 2020 09:30:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aIA0sK+7B5EvQZyoybw/tJr5PTr8Xj0o6SB/D2277Cp4L+AoO9KCAunGe80Yj2RabtUqbildkQpSEu177NEdZ+lNvTw8kwiKABh3o3em9o1UWRmQgu6/jcpEAHVtEsUiHtrhOKGhRrcvrtsr07MGzca3rgryoKbVE8l8ymOQAO1sj9g+gwt8e+yTaNZKnIcDSdPFEtLB2RTOHjQJKbjr+/PbAnQjzE18/MhpsfpKLMQMidi59ILFgEni7IDCTJYAi/zd4wQl3RBzlNOYUlcmzHhq51LV657ENyZWbrFzP+5reuwb243xiZigMDvOBWRK+obFC2oSD3XjcCCq3fzkoQ== 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=nhzR/Ix8+zn8zpqX1kSmulajUdj7gy1tamEBGjdwZEA=; b=BooX6vFrQaVfEHAXaVgszbiQr+hZQeNESH7zY6xpWelocE3FhrJVwQ/MKU/dLeAQpNYMQfZluUXWgY5c1lC6axfPa1npaufudOnYeZJ7d+jGOVmd+kf4ficMrqAyALUtFDGgAAtvy4bAm3QTWyjGedBUegG4JxFhLSrL+/IcQo0L2S2SiV/qEI8f0iEQJbAYOqDVhEyHttXufMn4mephDflxxniMmiVA6s5SdH9BUG0SSxvpqFx6KuG8wmRwlyXAbdWzsuTA2FaGnJdgk5pii1dIityu644onJLiBwcYs4+KmTAtj3HubnyiH+wgREfsbTRMOZoANA3N3iH2wUBtQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nhzR/Ix8+zn8zpqX1kSmulajUdj7gy1tamEBGjdwZEA=; b=GDM2wOBogLGN6iiRPjUfU3Xo0eKv3j5HYIC+JYEoFLeGSUaWFj+nzxdrr/3dR7uhlQidBrP+pj7H7qDFzEGc5vKNZ8CjjowlEm9h91OFIrUGfu4AgL58I1sSF+N/kxxLbrMMl2qGdBHqDnfJmYcMZMiUG/DPfvfxIodNukyXSos= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB4866.eurprd05.prod.outlook.com (2603:10a6:208:c0::32) by AM0PR05MB5329.eurprd05.prod.outlook.com (2603:10a6:208:ed::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.23; Thu, 16 Jul 2020 07:30:01 +0000 Received: from AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::d44d:a804:c730:d2b7]) by AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::d44d:a804:c730:d2b7%2]) with mapi id 15.20.3174.026; Thu, 16 Jul 2020 07:30:00 +0000 From: Parav Pandit To: dev@dpdk.org, grive@u256.net, ferruh.yigit@intel.com, thomas@monjalon.net Cc: rasland@mellanox.com, orika@mellanox.com, matan@mellanox.com, joyce.kong@arm.com, Parav Pandit , =?UTF-8?q?Morten=20Br=C3=B8rup?= Date: Thu, 16 Jul 2020 10:29:30 +0300 Message-Id: <20200716072938.812733-2-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200716072938.812733-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200716072938.812733-1-parav@mellanox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) To AM0PR05MB4866.eurprd05.prod.outlook.com (2603:10a6:208:c0::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sw-mtx-036.mtx.labs.mlnx (208.176.44.194) by SN6PR16CA0057.namprd16.prod.outlook.com (2603:10b6:805:ca::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18 via Frontend Transport; Thu, 16 Jul 2020 07:29:58 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [208.176.44.194] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: adab40de-0aa1-4900-8445-08d8295a0bff X-MS-TrafficTypeDiagnostic: AM0PR05MB5329: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2449; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FBHKNDlrJIL5cGobA6/Gb0xdUoqERQagR6vUZck5XLsYABVAoBhnusOy5kLHxaf/p/3wwlKfh5sRnvZ6LQt420qDsBPbB5MRhIhfyyVuJuvmat64x/pRTVp9QWwtFFti1lXYCJ0r15vRL9QvEoT9+6X0XCaHFmvygcvX8WdjTfwwz5UqWImXlPZyIfVe96cDrDAIvQXyIh9DuR/Wyf1aNGYHTrtSELqn1ofoz/921N0G7Q3yyIK07qDl5n9gf45fm22OOnuXluikCUxEiKY0CDevOfdGtEFqD6MmqJ+68zUhRtYP0dW33OpSIVE8ySkvx1nMBWQsEWRqm6uBJ+GnBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB4866.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(366004)(346002)(136003)(396003)(39860400002)(6506007)(6666004)(16526019)(186003)(66946007)(66556008)(26005)(8936002)(86362001)(6512007)(6486002)(52116002)(66476007)(5660300002)(2616005)(956004)(36756003)(8676002)(478600001)(316002)(1076003)(2906002)(54906003)(4326008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 82UPVZMjtiQ6MunBo/UWfd0byRY+BQ7XVHvm9uK4916DXJwokG8A+8K7dzXigmFjRwJimdOwg0ARDYUmhYKThpNBtvdFsryLdSP8tUyiz1e9u/bbRvkIruc6ONcZb0htPC/ZJfZuqrSR/MEH4ifZV9y2NF/IM6jBcF8GRyKKGed/H1qN+q72JzQjvjM+4uT4VPO2GUOIXgR7DggOL3MxiO/a6/HvGtQ+pINBIXColh6ubinYhDFUwJ4UGNwKEJw6D5zJiWSXfItl2D6Cu29kmbUbtIBjjQwC4KG/7xSSAsgZmmFg+KB06GYjSgIC81XejNzAQLXAUh+ddsh0rneDADp08FKNrp+Z5+aC4kMXNZMPx9DvEK0QZL9R1QVfUPba9l9CnfO+vpieSozExZjsIXyjD9OjnrwburJn2cVgknsGKuletCq3dABzlTPgsy+qPK9NteuAtd8SSfoBcIMIG4rmMFaQrSsJ7Cq/ypd+xz9Mbv6It7fhKULcFT7+m09E X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: adab40de-0aa1-4900-8445-08d8295a0bff X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2020 07:30:00.6760 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SugaqPjftCdYd4QblC7UjX4I8tZW9YmMnrQgapbY6GNAg4TpTOHxkpahbLw6eoCgNIT7orIwiYN9m4b1Nq+EFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5329 Subject: [dpdk-dev] [PATCH v6 1/9] eal: introduce macros for getting value for bit 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" There are several drivers which duplicate bit generation macro. Introduce a generic bit macros so that such drivers avoid redefining same in multiple drivers. Signed-off-by: Parav Pandit Acked-by: Matan Azrad Acked-by: Morten Brørup --- Changelog: v4->v5: - Addressed comments from Morten Brørup - Renamed newly added macro to RTE_BIT64 - Added doxygen comment section for the macro v1->v2: - Addressed comments from Thomas and Gaten. - Avoided new file, added macro to rte_bitops.h --- lib/librte_eal/include/rte_bitops.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/librte_eal/include/rte_bitops.h b/lib/librte_eal/include/rte_bitops.h index 740927f3b..ca46a110f 100644 --- a/lib/librte_eal/include/rte_bitops.h +++ b/lib/librte_eal/include/rte_bitops.h @@ -17,6 +17,14 @@ #include #include +/** + * Get the uint64_t value for a specified bit set. + * + * @param nr + * The bit number in range of 0 to 63. + */ +#define RTE_BIT64(nr) (UINT64_C(1) << (nr)) + /*------------------------ 32-bit relaxed operations ------------------------*/ /** -- 2.26.2