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 344E1A0526; Thu, 9 Jul 2020 09:35:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 188041DC57; Thu, 9 Jul 2020 09:35:41 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2071.outbound.protection.outlook.com [40.107.20.71]) by dpdk.org (Postfix) with ESMTP id DFD381DC56 for ; Thu, 9 Jul 2020 09:35:39 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m4lS0TUgA083PCrmUnNwlbT6pJn3oAjJONYSjdvHK6ci5V1UzTdfbhhDat9ZtG0CwuKsRFkdXu3AbNtDq6FeeBBaLKojORcxhiTboi1laSZuNBav2/QpB/baBWBdQgY9iBGP2IGnHW9W+Z4qeQ7cXIh5ZvOL09FqeO0eum9K30Wahe5J80hQ5SQBLzCBzWEt6dCAO83un0Meo6mLYp+eRuLAD8MKev9jL4rMbmHVv7qS59xOLNbiO2uaLEkz3xhFgCoP6ta6bRsfp/v+9xGRQXBrhhrBQHUD4eEvFBHnc0BptReC3A72au0bT9GlQGqlyZwCAjEGD02/sp2pb68MOg== 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=WHCqbbGm43jH38kupEli7i8FWJi4rHH6xNftJk5Qnd9KZoHoDidGMdYuDkpjKFIx6x9ICAfahbulcaP5jiVntax7hZ8vXQLUMJazo0I+ngTAjNOYELgVJqKjtpOC9RqVvd90c3kniZ+e2CermdG5RhtgggkcqAnqicHV6l5cLxcytJiG9M/VFz1u86LEJkJLEP4C4YqNX6YxBOda8opGtnE0OCTvrkPgp9ttfNZWW77XaV7Xcn6GipuQCs8ktMsSuWmXtgvMwjCVwwJh448g6lpux3mVXTlwWYn//WqBo3fKYUiQhNbiolwxo9k0BXwSpZIU0+HW0P3hf4dWO/lV1g== 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=EDfVvzAQCosSGXANKg+HMr/PR4Z795udPslTomRaYP/W/4FJOxc0TaVe5PhY7RPHa8xAWdOH4QgCjVXI0+DDmBYbmdCvlpfXYinYdLqCzRvTZf5pFyz2b96x1vjZsIiig10wGZClm26PRmVy0MWP7pLgji33kgDVO88vDUhQVvo= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from DB7PR05MB4876.eurprd05.prod.outlook.com (2603:10a6:10:1d::32) by DBAPR05MB6936.eurprd05.prod.outlook.com (2603:10a6:10:18f::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23; Thu, 9 Jul 2020 07:35:38 +0000 Received: from DB7PR05MB4876.eurprd05.prod.outlook.com ([fe80::8cb3:93cb:c3ef:4293]) by DB7PR05MB4876.eurprd05.prod.outlook.com ([fe80::8cb3:93cb:c3ef:4293%5]) with mapi id 15.20.3174.022; Thu, 9 Jul 2020 07:35:38 +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, 9 Jul 2020 10:34:44 +0300 Message-Id: <20200709073452.948894-2-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200709073452.948894-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200709073452.948894-1-parav@mellanox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SN4PR0501CA0104.namprd05.prod.outlook.com (2603:10b6:803:42::21) To DB7PR05MB4876.eurprd05.prod.outlook.com (2603:10a6:10:1d::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sw-mtx-036.mtx.labs.mlnx (208.176.44.194) by SN4PR0501CA0104.namprd05.prod.outlook.com (2603:10b6:803:42::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Thu, 9 Jul 2020 07:35:18 +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: 8ea3900b-bdb0-4efc-7ac8-08d823daa1bb X-MS-TrafficTypeDiagnostic: DBAPR05MB6936: 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-Forefront-PRVS: 04599F3534 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: idgvu0LLYXvrJ4iwuEUwRypKa7yMFIJ0Uhav/Zdm7XZRao6NOh1jKeAjIJ6+I7ip8zMmOpW6540LiecUOZSqb/hlAkoIJeC8zwQ/IMmkUmC41aX4gpp22fPU6nx/EVP+/uD7zA6JK6C0b7AQ+uzh+v63GByLSAWhUGFxTrbYqbax9FCytLg674tKrhepbyLgLnXoMlQU32bZnSRJv95EcLWUiXwOocqDgzSDO5docOlwCDh195lpfYnt9YyAxp2sIrrUDgGrFIHHI2QSqlunRzbZ/cgUFYKcksfoz+zXez8jB9ofpcTD5HCflMEQEMaJbo5hYaXstNcW6irkxn849w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR05MB4876.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(136003)(396003)(39860400002)(346002)(376002)(66476007)(36756003)(4326008)(66556008)(1076003)(6486002)(6506007)(66946007)(6666004)(16526019)(186003)(26005)(52116002)(5660300002)(2906002)(478600001)(8936002)(8676002)(956004)(54906003)(2616005)(6512007)(86362001)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: JXS7c087OdVgVSgJ4uAUExF0je6Sggp0qtVWudREkfcYbs+SkaGfGQSdqtlXUrFW7jfEvvA/5phLZ8zN+rZbHWvQC17KdI1tRH8cMPo5rTej5280+43PvHPqusWDQBTj1Vj31wch9g+eYgj2ZJ95rfqouxaJR0KMZxLNOUOuMb599NGjfJuMulxAtWWueFiV8tBVLjZjVqBfcOKw77moSojhf7Xh8r12ioraWUCoKwccTUNHCpLuEZ32sDDm+OCZ1Y+SR79d/PENN1Cmk5BpDKWOhuH9Date0zJeUwMNbp0pF8NjvHlB31LacfoNDLwc4wK+TyWZqEjrzR44mCpw+ku/8FeqKnr/X28u7KvxSqOL1zn7zI3jqV4caix2z7TZXHZSf7gH5iRB7v0EMSWo3imbYFU7vd4olxxNBLQ150gAIuaqDHdWV5eqC7iV56v55Z65uVMCQntOy60sIGaFxi0xn0Cby6iR9vAgRf12ySpMPjicUjTXZ0KEo3EJC+xU X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ea3900b-bdb0-4efc-7ac8-08d823daa1bb X-MS-Exchange-CrossTenant-AuthSource: DB7PR05MB4876.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2020 07:35:38.6397 (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: aT5eGiutWDc7fjt2nkl5R4IyiBu27RNpYY0tlUNkzcKhh883dMqvcrKXe/IG7CUWRxLTrpGJ21GQhR+pvOHMiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR05MB6936 Subject: [dpdk-dev] [PATCH v5 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