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 C28BDA053B; Fri, 17 Jul 2020 15:49:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9949A1C192; Fri, 17 Jul 2020 15:49:52 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2080.outbound.protection.outlook.com [40.107.20.80]) by dpdk.org (Postfix) with ESMTP id EC5221C127 for ; Fri, 17 Jul 2020 15:49:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dMAYqG0bellnb9aMlmA1/fluLhQM33mh9wKjODWxvh3Z4og2uR1IPj12FWH5Q+89CaljwdHR5iPzudtFCC+0NmFfr9ocexRtZcKw3MCPV0fpdxrVZPFF7X4ovTPPCzhDFtgb6HgdD3nBxTNEPpkFZrWmHVbVQ9zQAgZiakkydJSNpEloQ9rCsiVuXJca3yERH3HCDbiuSzOJ4my+fPMp58zALaogDgD59gPFAfkQkzwuxrW4Q1iDAlwlwne0nt8iRfNbJXdt4lKkcmijEHA/J1xOPJ7O8ltkbccUwIVNWasP57P3UByiLEAs/kxJ9fzMv652TL8xcb4Kipg3XHMGKQ== 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=oEgJ1Rms5qRxr5kLPbGF0ON69sxzvhM5xavNSKN39Zw6NCN9tsABQvXMGNz2Y/6fj+9XRFUf1CuWKPPQ2ue3Id4Gt+a/kkMUvKwEEqbzrBoqBTzNDAR1/qGBidDm9Obu3H1bm5mFmFVdnhCrNUUizIe0eaQz4USWIw5hyWwf+BUhryIZd48PPHyRjV8aQal9izGK2p0T7cWOm66LoB2xMS2dx+hdP515EFrS10ocDHhuuNAWlrQenw+/xQ9M98gyA/6k+4+LG/K5AhTklAtzRmX7dAdMM0Ja0DaYYpq8f3S+Q2eVY+EGwjdaIYZoEmpp9655uYOtrNTYZWwRenxs8A== 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=OKI/y3ku+QlMaD9iEtq9QTpyMvXy5+6i8iSimOxGbpgq9IAhI8ggsIMuiGstbOjkv85wR5veA9SNytWlkwv+v/JF7lqtS7O1nwdfWflG7o8NaQKAtYohyw87hVu/Q60cK2sfI+jIkBbKLSaHAFNyTRodnu97CQc97GwYax0Ia04= 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 AM0PR05MB4355.eurprd05.prod.outlook.com (2603:10a6:208:59::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Fri, 17 Jul 2020 13:49:48 +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.3174.026; Fri, 17 Jul 2020 13:49:48 +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, 17 Jul 2020 16:49:16 +0300 Message-Id: <20200717134924.922390-2-parav@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200717134924.922390-1-parav@mellanox.com> References: <20200610171728.89-2-parav@mellanox.com> <20200717134924.922390-1-parav@mellanox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DM3PR03CA0013.namprd03.prod.outlook.com (2603:10b6:0:50::23) 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 DM3PR03CA0013.namprd03.prod.outlook.com (2603:10b6:0:50::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.19 via Frontend Transport; Fri, 17 Jul 2020 13:49:46 +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: 2e5e7539-cd44-4864-cfe5-08d82a584542 X-MS-TrafficTypeDiagnostic: AM0PR05MB4355: 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: qd1ag7RpMTAkufzCSGv1G93bS9A78neNrQ/c3Ahy2WiTaIUNjK/wdaPsHYGCb904dTqN8zxv4BIielPnxtX6AUf7M5NVH7lP9tFxWIgk4sSH0Q0a4JUrYY5fPVdwOsyX17pHhP3rSPYxEUkyVCb06GJCuQqpP8gUyRkmQt8MPffKr6krkNI8LFfvDn0HpAATVZmtG0LPGyrvvFP/SnwLUtnKa7REQHiwSUgI6wGcubhJQPjAI/vyOKMYgYH8nSSzrl5z0SBXyp0CkC2pvRYvWjQda3xSjdIIPYGG7dIbIwf6a6kJiXBZVrnE46+eeo94lPYYqRK8g7afWz6VAcfypA== 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)(136003)(346002)(396003)(39860400002)(376002)(366004)(8936002)(6666004)(2616005)(956004)(86362001)(478600001)(4326008)(16526019)(186003)(26005)(6512007)(52116002)(1076003)(6506007)(66476007)(66946007)(5660300002)(2906002)(8676002)(54906003)(66556008)(316002)(36756003)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ln5lfBEM5p9V5L0doEnmzI1hjuVNgg1tDiqKcEIMGLWEygwD1Tf4G8GCjzmx9TShHdWAWttagNyq+LCvYgwG2fRs33IgT7Ab8Ypf3trrCyradr8kLbmSjVSM+7gaDeUQjiaxC1FQhLS0feRwXOHg/DysTcCs7YLtcZllGXuUPdqWItkABUgR7KZtKHsaTNXU96B3tGwz7rkMUDQHUMMfdpudXSJ7Pe4iMF2tlcbMOocgYh9Me2TidOAPJ+vzueBoko7b3k8vSrFyR4KL7Ol/rjcTgxKHgOFJvIR+CD8dKYnKPFrQaspA3l1j6KdV9BU2jsJtPAVqvQWQRUrXw/k3dOTKlW2G6t7XRdFsp9ocM7n89v/Gra0GcuQXkhg3kAaryj0+9up1nGWV5sE7WsQ44bVBfOyPpYoZpsA4FpOFMF9fnTqTmgHfQ/fPwAlfsbqVeJ8006SvuahFS7YRHP8cSoMJrpGNN4CjvdGy7oaH7stNCrqtl7f0P3n2hL+PBrlh X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e5e7539-cd44-4864-cfe5-08d82a584542 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB4866.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2020 13:49:48.3478 (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: Honcl0oItBdPJ/wrlTshYj407qRFBMsRSij/DhgS2+kaPBVdhcj+hks1Q3kzVe18IUOIGn8bmOWFqlWCoOmq3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4355 Subject: [dpdk-dev] [PATCH v7 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