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 A17D8A0526; Fri, 24 Jul 2020 16:24:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C0DF1C027; Fri, 24 Jul 2020 16:24:29 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20064.outbound.protection.outlook.com [40.107.2.64]) by dpdk.org (Postfix) with ESMTP id 9EE9311A2 for ; Fri, 24 Jul 2020 16:24:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H5gCFTCKW4LUL8Lu5PDYYcyPpmiHBqwAQDmsbVB82/YjI6rgsI3d8OfRCDaKCzOEQtkCKN9jd/nIjJQVd6fsFncrBdPJgKbXwWBGkRfFKWfWlwxgQv9nV4QNW8pwnKqQ5YlHSU7tetY8xlNY+NgU78VnLiS/o0g+zgU2j6QPotLLRTC4eFexfvNLnFCcyIP+loODHkwqHLpPZ8ZTqyo4poCzCXCrBqY5n2Hm8K4y0yUJ1IXdND9kmYOsA7C4ne7mC3tCB3djW1nw0jpJKEfEjZI2aLHAmRH6MEIDdKdI3RUoppGfuEQaFtUmaFZ6FSgVdwA3NTXr8flUqeJL32WbHQ== 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=OPOoruGqQgLH79o/tvUtruux8+w9ancVJ2Q1Eq5eWazoiS0+pDPgCWRaVByzDYa9O4gHDH3Y1BH/4u2+9vpJ4rLHVuevrjqDKg+QEF+xw6OFziszf9YKNheuaLV57eCeVAJa0yKkJ0mOgkg5fVeumlQNzZ2CPo1hkAvRwE1dW8lsQoiu+V+MzSODoTHKQ2H1yLzEr2rFTiCA//a7FOl1PE1GmvqLp91v4DQV02HBqKITygmvis8O4CNB2ruvtRCjc5DmWgK+lIspFxRnH8O3w7tDo6pg88VhUNBwKn3PLghj0NPgrBJCK6hY70EOnRKYF4FG+YQSdmbzMWrw1IJJvQ== 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=CzszHOK5YFnyILs8VhVb1bN03sX7vvb4nVs4t1IahO6lGRta9iLZpunqiAXNXMogeNCJcCDin+NWJiMj3tGz2nkN23ql9a2XOPvqKSxZKJvFQBlHrBtd6cGSuW9uX29lntHCZYh9V0yG6vlVh9dEEdvopU2cFw3iJ6d2JaH7VhM= 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 AM4PR05MB3203.eurprd05.prod.outlook.com (2603:10a6:205:6::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.20; Fri, 24 Jul 2020 14:24:25 +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:24:25 +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:23:54 +0300 Message-Id: <20200724142403.6132-2-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200724142403.6132-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200724142403.6132-1-parav@mellanox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DM6PR02CA0136.namprd02.prod.outlook.com (2603:10b6:5:1b4::38) 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 DM6PR02CA0136.namprd02.prod.outlook.com (2603:10b6:5:1b4::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.21 via Frontend Transport; Fri, 24 Jul 2020 14:24:23 +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: d8e6d5e9-1628-4ad8-eed0-08d82fdd446c X-MS-TrafficTypeDiagnostic: AM4PR05MB3203: 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: Ap8P8MMZrbPdwjxXtxhSSWMPfUkQ/CM96fuSkRmq3vWC5d4wNj0tncY43bmbLsIHRnmhkqCg7lQF9ck7hhVOqktnNLyzk/Jm3vqtxAzXd1eBhcaNbimFYCLX9U07IVXnluVelKOG6VTmwuKJuZgWVmfIs/UU4eCqoX6MAryMI5YrMDGi8ADjn2IesI2yVwBUnb+BvO1/McUD1o5t0CUa0x7yHHw0N0PHoTfeokpm98cbqGrOsTp+HRgqUxXDVS6KpXN1W/5B5+63vTJvaWL4toCz9gwClDQMZGlPqcCHYxVFb123lDjXRhH2l0E8gD45Nly343iI34Zbvfq3fP5gMA== 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)(39860400002)(366004)(396003)(136003)(346002)(376002)(6666004)(52116002)(8936002)(478600001)(8676002)(54906003)(36756003)(6486002)(1076003)(2906002)(6512007)(316002)(66556008)(66946007)(66476007)(5660300002)(86362001)(2616005)(956004)(6506007)(4326008)(186003)(26005)(16526019); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Adr1o9b4hhAxb5SB+VCpSD4oKhSabw0YUpIKowzH8MO96ECxinZQ2yx2uHx5g2+rpgTfdj7jyfmrV3Vlezu7/qrpcNyq01CVf2tdeIY0eTTS0s5T2+I739kNBTql98a4h0d5raFEGapWyXkXMTwFSAVYnWENE6ZGCCcJInSS7jL/pwGKng5Ap8IW52Ezxe4sHkRPIg9Uu0onamFg8XEtjLhOgPYef5ahAJ8NCvaudvrkPdCa1Ky9bvVyDW3XljUlbh+B7EP9lPsjVJbWVuzXQ73gyOhq4UH6Gvf+aJ0uPbFvGDIhazI45kbPGvHI1xmqX9G0uAP7xi/d1cYHQlq9s6gtQPkF9ZyC4H70VGu7I2DlQPRiwxll8rggMA5HOqg/uMPzKyW9WG2qO2QqX97H+0Y/tKKcx41HKfX1h/c9TUXws37G/e1U9Z89yd+WrIpOXiBTStjCV2iprqBOvao3KTn3xSboJ+C0tOzXaZs9rRgOUOSzZwBzWho3MEluqPrb X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8e6d5e9-1628-4ad8-eed0-08d82fdd446c 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:24:25.8270 (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: ISa8XcVXhMML1sRpcCF6ux5cG7RW2IOyrRgQllbJ9GvE5zqEJIYn1GpF8rVrNotCnymTeY68BGQwuib0v+hwKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3203 Subject: [dpdk-dev] [PATCH v9 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