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 11505A0519; Fri, 3 Jul 2020 11:13:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1BC981DAA1; Fri, 3 Jul 2020 11:13:22 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00057.outbound.protection.outlook.com [40.107.0.57]) by dpdk.org (Postfix) with ESMTP id 9CD6C1DA84 for ; Fri, 3 Jul 2020 11:13:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ag9wEB9caFzJMKY/Fq1Ex/vXzUAixX1u+qa8ySh/P9zqI/0HtQeVnwS5dYQj+/M1zzgQmzb1aLdGESo/Ld/Tx9tAYWCprmHkgSXYiNxKJBFkA66U7GbgPDEyUPqsTdHT5LFFUBsCFKN1sluwBIG2+JTqQ7RifpthbZGxslBrxB6Q2ZESBxWIcJDwnlepw+uGMJ51YUaEMVZRMjION2ZteTCVaZet7WrfVYcYIaaoQNB1s/t1U7JmAHxFFw39Sb6a9WmFcShHuwNh9W0Ur9EMpHbfpjq7PP+4jXz9Dhc1NNng3mEsxgaSHgSNKjnxiPY+qnxVpxoicXKXj6qmSEpFLQ== 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=HWLKpJWeU7H+f0WP5Ic734R3aJY1CYaBZFAr0Zjimjg=; b=LpMOW8xGM/mfFqNfqM7fCYNRYMWpPaQmDNHh0ibzQdjNV5IxlWdChzcGT5kqZ6W3n6UufoHKFix9o2tMS9tPIGU3Dpvb/eqU2HNLQU+pjaOe+ToGzywSP7blL5l+g6xM7Y98fitOtTCnkAwxcYKKgcwofFGVOyswcpnWa9RzCHNoKiOTjnnAXpdCzjTbMP136VsbHyzxNFXvBaNhm8u6K85JtAs1Z97R7MKlIpNinMfAgI013EmskiNtKw12JQ4bLpoTvW+Ca34Cw3pX/cdApe0xYFmqmpn0OD6fZH7O1b5L3hwDiWAdb7WMYU7KRhhjXQ3lX3OXP2wSzfifGXsu/g== 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=HWLKpJWeU7H+f0WP5Ic734R3aJY1CYaBZFAr0Zjimjg=; b=j1oOYSRmcuqb4a6IN9WMAiVd71w7lC9zrN9bkcT4tQPmiwfy46ZB+gXWSYrRVnM4yCiYRDhR2tDAYHGl55hZAC/Uo1IhnuZeixBeyZTwYXSk7JTltgYlK+22LUAerS4Gdl2iZrI/rat/gtIzc5lpq3tCbqvxZM/LnOUPpRbvJI8= 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 AM0PR05MB4353.eurprd05.prod.outlook.com (2603:10a6:208:67::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Fri, 3 Jul 2020 09:13:18 +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.3153.024; Fri, 3 Jul 2020 09:13:18 +0000 From: Parav Pandit To: dev@dpdk.org, grive@u256.net, ferruh.yigit@intel.com Cc: thomas@monjalon.net, orika@mellanox.com, matan@mellanox.com, Parav Pandit Date: Fri, 3 Jul 2020 12:12:50 +0300 Message-Id: <20200703091259.2108996-2-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200703091259.2108996-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200703091259.2108996-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SN4PR0501CA0006.namprd05.prod.outlook.com (2603:10b6:803:40::19) 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 SN4PR0501CA0006.namprd05.prod.outlook.com (2603:10b6:803:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.8 via Frontend Transport; Fri, 3 Jul 2020 09:13:17 +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: 0f58df0e-4ff9-451f-c4ca-08d81f315343 X-MS-TrafficTypeDiagnostic: AM0PR05MB4353: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1079; X-Forefront-PRVS: 045315E1EE X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pT4bwcqizy0C8rocXo2KdJg3BVjRRNLmq/Vh0S1ztnymTs7ijwtimMzIrDXvPcj0Xt/7nTEad46OIaLm3CUwagjGxx++nYeugxC5sgsLs+nvdMd9wnNQXoE35gRQuMAeVsitly/XK1pPUYOyvW22EqM3M0SYsgRfnQtWJ63nkVy0StxrtsoOr8AQoRt0yFGp3i5OQIlewALrsfKJVl0rlgjOJgMplcbP0K5PLjlTYw/n7KCH/E9d6LT+j01ND7oIT0pEevuhE4nLmVRCzFnMXwPA/Sd7WBZWOnE5e8kedDdKSSfEZkTg6B2qMMQCi8CyJjnoRAJU5ojf+43r9K1W9A== 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)(346002)(376002)(396003)(39860400002)(136003)(66476007)(86362001)(1076003)(66946007)(4326008)(66556008)(6506007)(6666004)(2906002)(6486002)(107886003)(478600001)(6512007)(16526019)(36756003)(316002)(8676002)(186003)(956004)(52116002)(2616005)(8936002)(4744005)(5660300002)(26005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 1rWuUHssAVsO+ZIo0RQV05twfBWZ21u7RfCr2Mo2jTnLx0hT3BOeu53tMuIb0TvejiY/OAtl2UpmiUs/APWB29asy0SeEYQ93ETDOqPXEeaHnb0kgbKK9nVL8oQaX9vwjPGZRmQMTKUTMd6+FdYyYF9h5KKilxr7vGYs1uMbQW0rpXtFRFCOCbD3sYWJXgykyPvupvFYAOndmbSj3nmAobQMi1pREnOiebQVbSN+0eakpzwqsCWv4yp6GOz57uoUQWYKeDd5ik0WWGs3svgyOCjZnRLNpmKnEZcf/C0h0ws6BHSy4H0qJ3fB3QFXdrQHEtS09MnyQRVT7xKANXpWO4lBaDWKYjpgu8TLbYjKi23ADAjN9Kqd6MHPUg7p6qGp/pTkx88QJAp1sETheRqROmLn4Ceswsp65xO0P2Acfw/WbsT9pJOMCbwqhmX2AWmEKmy7FHfhufLTB2qkjzeRhSfJERGIncDaXHJ6+kj+CM6JBbYmlVByHHd8g55GeKav X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0f58df0e-4ff9-451f-c4ca-08d81f315343 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2020 09:13:18.8830 (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: kpauhvJS8hrGl8hhxurBQ/Yka/Ixg8mda3CmzdF2T8KQKU5s7hb7Vl/SPiJ4ZjcvVnLoBznmI3dWUwXAb0RqQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4353 Subject: [dpdk-dev] [PATCH v3 01/10] 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 --- Changelog: v1->v2: - Addressed comments from Thomas and Gaten. - Avoided new file, added macro to rte_bitops.h --- lib/librte_eal/include/rte_bitops.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/include/rte_bitops.h b/lib/librte_eal/include/rte_bitops.h index 740927f3b..d72c7cd93 100644 --- a/lib/librte_eal/include/rte_bitops.h +++ b/lib/librte_eal/include/rte_bitops.h @@ -17,6 +17,8 @@ #include #include +#define RTE_BIT(bit_num) (1UL << (bit_num)) + /*------------------------ 32-bit relaxed operations ------------------------*/ /** -- 2.26.2