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 D1898A0350; Sun, 21 Jun 2020 21:12:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A76731C194; Sun, 21 Jun 2020 21:12:24 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2043.outbound.protection.outlook.com [40.107.22.43]) by dpdk.org (Postfix) with ESMTP id AD5291C136 for ; Sun, 21 Jun 2020 21:12:20 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FK2BrPj4J+WdoVq37ihSdqXPBKxSnQqbQmCupCBstQZGQVQwir7dJ19Th35AiSQoDRHrgOio3bHx69xiKtB6U5C9I1EBvhD4yUyVor26OMvb+1dav2Nhg9nvZxyBU+CMuc3TF8VPyjweKfu5nRNKTKFbkDtlb3BSi5kRlYh68cnSrBp7YKHPVKbx9yxYUxXGE5iRsWiYlFszl/te1/xFcn55xrknOM4lIVjKF0w07WKAZho44LwIYNufiXfhaXyNejh9ZLPRFjpTv/D3u8jfsSfcDPvZB8imp0iPFV59UBXf5ivKR0BCyhPYRd7n+8i/bF52c4i+ziBEUpLbset/mA== 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=nOeGiwxZxGFqhyCOTyzvoqfvcGJy53n62bRMWX5hIlA=; b=Zf1qpogrSQNQoUudELtqoAP/nsxwWKH0m49zTOTnUR1aHk2Kp9EcpTfQ6w+I6tKEYxVGMgPc13tDou9v9SYzkxtq3s3IT6Gfo8ZWgGirE6YWh2WcOxvkShQXT8OtWlxN11Hll49OklbqpXScPZTXab8p3Vbte51r2EN2RvlWOJd5KRHc5toaLbek87XZi+h0B/ZuWDIF3k0MsRZjkebIlhXx7OXAmFAQmpk0yjs03ixFLsupOH/T5NYUA9DymzkK3MT6DkWtPHZ3XYFoHL64zgB0So13vWNoHAePiqaeZ8/u/SOwHWnEk+uhVEK+APhjx/0j7/v6w/pfBOJpkEqQjw== 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=nOeGiwxZxGFqhyCOTyzvoqfvcGJy53n62bRMWX5hIlA=; b=Xgctldwjv0ZkpQuRNTGji1K8EdR6JvHdEzD14Sf+EBKS+GEFlrqra/WRMK7OeLN8MxmtW+yjSbqaPLP282CMnlOXP+HEg13Id9rZ23JzFHuCNo6hbroJ+qQci3sZLBynLSv1LMZbfJDut2oFOV3/ypr8nAQG1zJ8kDox2KTq1bg= Authentication-Results: u256.net; dkim=none (message not signed) header.d=none;u256.net; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB4866.eurprd05.prod.outlook.com (2603:10a6:208:c0::32) by AM0PR05MB6307.eurprd05.prod.outlook.com (2603:10a6:208:145::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Sun, 21 Jun 2020 19:12:19 +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.3109.026; Sun, 21 Jun 2020 19:12:19 +0000 From: Parav Pandit To: grive@u256.net, ferruh.yigit@intel.com, thomas@monjalon.net, dev@dpdk.org Cc: orika@mellanox.com, matan@mellanox.com, Parav Pandit Date: Sun, 21 Jun 2020 19:11:55 +0000 Message-Id: <20200621191200.28120-2-parav@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200621191200.28120-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200621191200.28120-1-parav@mellanox.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: DM6PR02CA0105.namprd02.prod.outlook.com (2603:10b6:5:1f4::46) 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 DM6PR02CA0105.namprd02.prod.outlook.com (2603:10b6:5:1f4::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Sun, 21 Jun 2020 19:12:18 +0000 X-Mailer: git-send-email 2.25.4 X-Originating-IP: [208.176.44.194] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 033b6d54-71b6-451b-125c-08d8161704cf X-MS-TrafficTypeDiagnostic: AM0PR05MB6307: 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: 04410E544A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gi2AbOZAGv7ds7BQS+3g9r41x6YtSrLHFEBnqlXwHuTtoY8c+uHQlMy2xa5dAt0/1QknqYby7u7Bm/2RM16Ezjb/Ux76TGqImL7ovWOZsy9aaE9oYey86dvbHeo+o/83FxI1peYc0sCChlbfMpN4fwg6jSJmJrMGLA/yHcU/Q1ABhPC7sd/3Pl68l4cztjLBrWHVg2ndm8DBNL4qjlGVi9Yem6J+w1UYKbvYWLBPevBlspmhtViOTpSboy35geu7Utw/zQHJRzOwqX4op++uEc3y+7GLzZunCxlsmvXRVe5m3aft01HR0mfS+rVMcgCL1Pi/lR0n5ZndtPB0X3sdSQ== 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)(376002)(366004)(39860400002)(396003)(346002)(136003)(36756003)(66556008)(66476007)(6506007)(4326008)(5660300002)(6486002)(66946007)(26005)(186003)(107886003)(16526019)(316002)(86362001)(6512007)(1076003)(4744005)(478600001)(2616005)(6666004)(8676002)(956004)(52116002)(2906002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 5B3sA/nGWxNHctobDhYo6AGt31BPnxXdi+FVoGYSC75cAev+Y9Cp8Cp0bF+Lb2k8/D36sAC0Md2k52Mpb/8NEZeFzlJk0jQMQs3ZOM4b71IQX/YuaMOg8/NfhUr4IXWo6rt4CtEieSkL5iLrItboY46/+8vyMqEbzHoRmBvK6nJ1Q+gDYAjYCN3a6HEat8jEBaqT8/AY4bMeJieCw8sJiIl3XxuAy1bW4lXSkFDUo01GPcGokyFk0SfKMEVqq0/de2PACZ6s9DoFX869cGkla/lRIFXA3IzyQoRJIGBWHsfh6mN9r44mY8CiRgUZMUnhsVoBsY5eou423SZuPJv/FKagss3ymUUWRAnjIhP2TXnUaebZZbgSjuKWUoDooKTCvp6Iw2CblOVpcgMgjUec3TM40Nc/jfmCB/hFRI+1Zc4TEDa91oU7KcihSPy/k/f/kuHvkKAFBLLkYcXlYhIgaTHu7CuTvzCgUPIFauW5FJ6J7ENm41odZdkLBzpDz8uO X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 033b6d54-71b6-451b-125c-08d8161704cf X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2020 19:12:19.6572 (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: VDk8ixWFVacXYidsUqQlZXOrbDzniaC+x1dUdvx72csu9YEs0o6JQyplYcdeMOiTcUj8haGlB8ES5UtGRoWD+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6307 Subject: [dpdk-dev] [PATCH v2 1/6] 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 --- 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.25.4