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 D0D3AA0524; Sun, 26 Jul 2020 16:56:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 52CEB1C029; Sun, 26 Jul 2020 16:55:53 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2049.outbound.protection.outlook.com [40.107.21.49]) by dpdk.org (Postfix) with ESMTP id 194431BFF2 for ; Sun, 26 Jul 2020 16:55:50 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hNJbsqqOL/yU8wUAV7tbEFhBTwGq10bbRE8Y3ZmeGM7I9v8wmeUaZLX3jYrhf8C1oovGRPw7Qcr8hCvGCXFYSg/UcvwhkEr+Gs3J6troCDUP8blebV1w9gsyJj+zbNDUNReTWkAJaGYtvar+Bh/JvdgOj8gAx7jRS1y91a/0ZLePu60ra+nyq1dHOAE+u4/fAmMYfwvG/O/twCPDrSNMk26wgHJJ1HISa8dd5bJbEgE06AITkAhZk7s6YPuPoZuqphvtIu3ffjGUsGzdHb3MFX1u5ACeRoxvRgnYGo2J0aDb8jCYn3q6shTI8S5cDUUNY2c0xO/VdzMgoaooc7+zNA== 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=NjkD7KeaSTyB/9vudwLx6Kng+Sb0nxyVR9gXTBcmSg+TZJkiqOuEN90NeiQcsf6faHDlGUUoguEQYcJJmXZnY5toX139H+FBay+E4ziaAC7m0WLgKJv656UD7ka3QnENfN0Wu/9DtC0O9yInxH+5+7IktIKN3G77mtcTZbZ62KwsVyBpos3LvksPcVwL9qATOp6ARdYHVHFZQ4J//d1dELVpd25+4Yc7sWrRQMNlXvMaP7xiyUirxV/NKGF5+mU0M8hhpfN+RBESJlRN7f8DsYJzlnAITsnwM8HN6MCSmrZ+2tjF/8zdXEQorxZFBHKvdPjLwL5eHqm/6qfWcrsgUw== 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=M5O3j9mxmsVd/gOScSI6Nw9bypU3nyJ+i8z8sortGcferxiE77kGBkWFWOm/wSs2ZgokhynhwxH+m2Edq1T+OSNPsQjxuxK95cloydpsrOSkJfxYR/wrdvCNCaDIojtW7R7kF/DbtYbqzgs9oo909xCpIfEGIhOXFXSCyg6NnXY= 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 AM0PR05MB6225.eurprd05.prod.outlook.com (2603:10a6:208:117::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.27; Sun, 26 Jul 2020 14:55:46 +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.031; Sun, 26 Jul 2020 14:55:46 +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: Sun, 26 Jul 2020 17:55:15 +0300 Message-Id: <20200726145524.149355-2-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200726145524.149355-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200726145524.149355-1-parav@mellanox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DM5PR04CA0045.namprd04.prod.outlook.com (2603:10b6:3:12b::31) 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 DM5PR04CA0045.namprd04.prod.outlook.com (2603:10b6:3:12b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Sun, 26 Jul 2020 14:55:44 +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: 204f30d0-caac-440c-acd2-08d83173fa16 X-MS-TrafficTypeDiagnostic: AM0PR05MB6225: 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: azDye7kheDzo0VlAUe9nKzptnAXMFke3DAkWJVXY8v7jRNBNJskOPOh6Bs28AyzcaTVyFUpup+0w/SNoObHyGme+v6N2hvwSMOvwKomHoEU352S0CNRLrirzBjgmkSmkVymwjdpQ7dHANmd6HcC7zl8xPMaI2AFMyQ47ExJlOtomCUzutLCkyTtzNn82TESbNfeKCLxSB3Ajz8zMKIYN7zMyJWaqmhRUmuIwRTBmttiGYD87SaR6nG0Nyvi94RHjEFblrpGxxHlVTr/pbk2duIkD5GIobuXu7p4dbhlCp/baWELztJ8PjVggJbAL2zSuVsSZUs2uP8VyHUgB/H6SNQ== 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)(366004)(396003)(346002)(39860400002)(136003)(376002)(6486002)(66476007)(8936002)(66556008)(6512007)(2616005)(956004)(186003)(66946007)(26005)(16526019)(8676002)(1076003)(6666004)(316002)(54906003)(6506007)(4326008)(36756003)(478600001)(2906002)(86362001)(52116002)(5660300002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: kA/v+IbVlpxH4h7AKAFmdpV6eDFRUshwwburCNFFGb0Ip07NA6DaRx2j6vONMnry89GcMeFjykYBk/KGtr5/MgraevnK6AGPCzkk9ItOZ2WwRcsFAdA57OnLhyP8m4cKOEGshtGfT6OK0mi6j4jBLfGxjfAtHOgRKF1oMr8cRfqkFzRUr5BwmeysraJzdFJF9ANSPMPGNDjWq9cA1USqLOlxtGV7mKRfAO4D1FKXp74+mjl4eDNnaK9En1giDjY21NG4ATFVQTVmt65zXsdt96CAF6xnwZhSqwTVkOtyfAmFGj/LkAwjtu3s9XnFZmb6dl0LVYe6DoGJN8LhgOb8eGNh2vV9TjSLUewrxEOCTcfrk4uoQJi0hXd6ImyWUWUfkijmLDFcS7e4Hi804i1dk/8eY7Hy1FMCrRz0DlhVPgm+lYUrXqRn/34V7IvM431R/Z3DeRtra3idC+DFWUi17TWXkCI63i6zcq3XIpN9nD5vtMKGNl7+sEkZIxXhm6pd X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 204f30d0-caac-440c-acd2-08d83173fa16 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2020 14:55:46.2153 (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: 0gTDei0lCt5Jrq6p0QDgf8xyH7tXrhdY/IhD3nrJTUSKvqIiBLe1To7vGztFJ6hfDYsU8XEbEiLv4xObzLz+bQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6225 Subject: [dpdk-dev] [PATCH v11 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