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 946A6A0527; Fri, 24 Jul 2020 16:39:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 96B5D1C037; Fri, 24 Jul 2020 16:39:31 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80079.outbound.protection.outlook.com [40.107.8.79]) by dpdk.org (Postfix) with ESMTP id 5D30F1C033 for ; Fri, 24 Jul 2020 16:39:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mi9xpEd3wP0kIC2iUOcgigAicb6SegdBDW6Owi3BKiu90GZnphmRdWCTMWXtrcpT6ZkfWYCFKxFjd8qsPvwoNwS7KtK+t0sCJdBBrkFZcKO19aHTRPFfCjKoP6dc2H9bKmKnH/o4WtsueBSBFNMZbN01ouR3MTRHhS3YyEaKUh2Kx1Ko5ymrxeeVTjEmHhOM+qcPJWNDUk9Sox6Cl7iC4PorYONjCrOAvf72U0msm9qtJQIjVeY3ppeVVqcZ7J5HLwnmFYiis5wQNYOoYmY5az/dZHSqw54KDCOQjxIKru3rqFvP6w6bZR+on6+CwPfMASZnsNK0Ef9NgjmLsy+lGg== 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=HVdT7FWfBU7Zwqo1GXdjMnWB7oxQed1a+FNVniNqrFwI1vMZJoqMffZlxRO3u2ETxT2CwfSEaP65YVp5jecGNAeFOwyKMuHfyDkJAEvKG9lEXasYg1JE2oT0GUif6Nkhz3f3dF2iMPFXmk2+o7Ca+h5GoTPOUmX9O8icRFI3H8uDARsxLGCFaLTU4PQO42pz2QP14ADuaHTXBcUqs92/FdhqdSIdQpFq/zEHtfzkc5/nF1pZIiWGLIpC34KbxHbvCfuamFlifWIdAFYB/WetqJJW0UlBE2E6v7kcCcJkJRjX+SSZRuIiFHlFcjNfHf5w3K449k48sdu9geDF52h+kQ== 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=eVUJ10lkYy8WsbfLYf3o8Il1uwQH0deDBVixy5/Eo/MZflso6axni5WvRPmbXntklcTOQ6sS+M2N7ygLIdirKpotE6Nr0xB5m0qTY0S6Xz/WzbHp8AGxTRbsWDyuPzsobHxX+Z+RZAmOvyv4uDQ0cQyQ28x5E3/wLMMjQCgdYmM= 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 AM0PR05MB4962.eurprd05.prod.outlook.com (2603:10a6:208:c3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17; Fri, 24 Jul 2020 14:39:26 +0000 Received: from AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::eccf:72b3:bacb:f09d]) by AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::eccf:72b3:bacb:f09d%5]) with mapi id 15.20.3216.024; Fri, 24 Jul 2020 14:39:26 +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: Fri, 24 Jul 2020 17:38:57 +0300 Message-Id: <20200724143906.7453-2-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200724143906.7453-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200724143906.7453-1-parav@mellanox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SA9PR10CA0025.namprd10.prod.outlook.com (2603:10b6:806:a7::30) 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 SA9PR10CA0025.namprd10.prod.outlook.com (2603:10b6:806:a7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 14:39:24 +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: d09f02aa-dca0-4627-ead7-08d82fdf5d34 X-MS-TrafficTypeDiagnostic: AM0PR05MB4962: 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: GuTO/qnQLerfw1CloT9xyhO12kpyJG7FNmQMwkq3icBnGZgdMUC2byrtbAu5XWQnYoSRkUEHZdbalpZI4AEOPamDF27b6C/+rStzmz8FHfxknyUOZxBHCnF7XkGfQrZ2aMMl/0rmm9M7yYXQnVC/Nuddoc8th/llk+HynvFejvPD4wq5kodA53m+gALzXFmXTtAgG55viO01+BqXA9elVTxCs6/Fau0DopcA1Y/jRiW5GXu/1sg0qVdMz8dzD0PwFbdn9Ao4MgxnfhEjZDqsOazICTZWJ7+VuPhnLSf3XE7Rpxrr8X0JBonetEqXdwCPjgTNou/g71aGXK1IiS1hMQ== 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)(396003)(39860400002)(346002)(136003)(376002)(366004)(8936002)(36756003)(1076003)(54906003)(4326008)(26005)(52116002)(2616005)(956004)(316002)(6506007)(478600001)(16526019)(66946007)(86362001)(6512007)(8676002)(66476007)(66556008)(186003)(6486002)(5660300002)(2906002)(6666004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: EH1kwSzeebfMYMr1GjMrv/viAmNSNz+ounCT1VJPB0RNsYYa7oSmoZbtntPaGKd4xNFWt1J8IJUevKU7xZn/RxB0zwYESuWgzSJn7l4q9sdavecailnkPEgxRe0xkQW5lo0OJThEhtYUK7YiPysZI9qnm4n2ouzlCB4IzsgONAy9iph/Ghe8t+WIfge3h9qLXsjdy2irZp23fvD8wbJd5WvP5RohsUefyD80m98Pv/X/cMTLJIL/ruLD1mgQGSXCluFSdOt+hNKOqYlj0qV5Da+qPjG5CtrcRL3e8FBN+0/Jio4P6vQWwTOeAbnvKBn+JSYtCRVr3pbls1cEvJ34ymlVTgjyVEDeo6Xs/fGK4PDs6t5hjq071Hjc/ogeyvO9w1saelqGrcPFFDNE3WC53LdydmuYUKkCdKrIFl88OIf7q1vU8L7q0d8blXVbNkIo7/e1cxMXDbLvXcyrhuRnzeBCIendVjstiXr838n2/SttzM/w7CsdyEpe3djpDNBs X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d09f02aa-dca0-4627-ead7-08d82fdf5d34 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 14:39:26.5784 (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: MX8NYIkbqzBf8Bv8njvrRKTmG8hwav7U+d7asVU98jYcyPI3aproKiMHUEY8kiXG8FOoE/C/89umea2bB1u4Ag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4962 Subject: [dpdk-dev] [PATCH v10 01/10] eal: introduce macro for bit definition 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