From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 266F3A0C43; Thu, 23 Sep 2021 10:12:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0D3A41241; Thu, 23 Sep 2021 10:12:05 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2065.outbound.protection.outlook.com [40.107.237.65]) by mails.dpdk.org (Postfix) with ESMTP id 60C3541241; Thu, 23 Sep 2021 10:12:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jXxMG7Ko00FMTN3eNT1B/87cDVBntF+pi1pu3VZ248VK2m8Cl9sB8Nz0VeltX1XNXDx/eLf/MIacx5NWEvorto9Ob2u9qy5tilhB68Hk250dljeVcCaYKpeCOkRi+sP5BCSGPI4khegj1F6Qzhaw6J6IXqxlcoLGDGGsZ5tcuoZV4e2hjcK/3Bjze3Dq7FOtzk1t0il63LysaZMcG3Tr9DQgV5Grx45DE+nRRMMv1rAUKmvpt/N9UE3GCzUHdkjdzR/rffe2zK5tCSs/SUtbr08grCjKzrqOrokeBeCW23k+M8iCRxc+kaE4dW8zSTUVQlyZnnSraAqF7M3i92ld4A== 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; bh=5acei6VVKZ6zcTLWwMt8/6+pARUfkDvm775rHLGm5ZU=; b=cv+djd4mJyGOIJSSowQP7NTuEkwBYC0Zuicw2XAUAcug7cdpP+oTRvKUJibGX76hoP84AA0xEU+XIkYOxhK/UWkzDKa3YMr2DWlte4ex/LiprlzEmIFbgwO7G3mD1ZILNhKErN682AN78OmMvOIhNYxeVCS4pgYMopjYIwW5otokZY1ydC0FXFdeyKYlAzxysCqyO2A+WdMiXSn3ynueujL/gQqcarrGx2SKEReqUmUTT24w4KWEuPgfkJxRtZvbdOzyCReXOwnBiqtgeEuBMBTVFx111VG2BzW26uxsxFn9oNQTeFqxVfYOGqZ9xbQBzvTvHmIfD3GpzFy0MnH/3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=redhat.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5acei6VVKZ6zcTLWwMt8/6+pARUfkDvm775rHLGm5ZU=; b=FgYsE8L6nbUKvTn1TYWPIdUIX75jes7jMO3JAgQPq7Y1Z1IKr/qCEAiZ93XsY0YUnf03RQeAyYmLprFAKfj6weinqzC8ErlBFu0CDRkr+kie6YIRdXowF4wYccNIxATPl1km/AveFrFqo9+R7fKBHPvDFu7EkOeXBw0mWsU4E+Hwm4n2Vfy2ig0lgjWz80NN9maZm5XZlnuhmlAirUzUD4/fsmwmCJWxBYRmRfn4HgDulG89Acjv2XAwYjABLc97hRTrkIPRrhwL0D3sgiide9375QEyblswPENlZA6Q9iQRT/M9VMQyZnjo/Udqt8+3ju5C/cXwHpflma4CGB8z/A== Received: from DM5PR21CA0005.namprd21.prod.outlook.com (2603:10b6:3:ac::15) by BN8PR12MB2900.namprd12.prod.outlook.com (2603:10b6:408:69::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Thu, 23 Sep 2021 08:12:01 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:3:ac:cafe::29) by DM5PR21CA0005.outlook.office365.com (2603:10b6:3:ac::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.4 via Frontend Transport; Thu, 23 Sep 2021 08:12:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) smtp.mailfrom=nvidia.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4544.13 via Frontend Transport; Thu, 23 Sep 2021 08:12:00 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 23 Sep 2021 01:11:59 -0700 Received: from nvidia.com (172.20.187.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 23 Sep 2021 08:11:56 +0000 From: Xueming Li To: Matan Azrad , CC: , Kevin Traynor , , Cristian Dumitrescu , Jasvinder Singh Date: Thu, 23 Sep 2021 16:11:21 +0800 Message-ID: <20210923081122.176735-2-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210923081122.176735-1-xuemingl@nvidia.com> References: <32dc9e20-86dc-a0a6-74a2-9894cb680170@redhat.com> <20210923081122.176735-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c88528a-2bba-49e0-7455-08d97e69d1dc X-MS-TrafficTypeDiagnostic: BN8PR12MB2900: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1201; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2CODZs2ugHsCjPlZJkh3a35OIXEQwJyRuu8FGqjMpeJaXsHICZy+9beTdcEjajzTwHPFz9S2CZnFQXFcAiZmu9j+7J/mrOdjx1YhF+MedsS9Te9CDXglVbi8huPiAdUwUSFkLl4jjTeDmaGf+OfqUATZf0E+sPEhYAo23rGGG8Ks9bSjpD46JNFsbQfQGHK23vBKK3VXoPgi3OTNf9CY3deSule5Cn8AWoj8zTpgLRTEeOrrW+eakJr9JXBZ2rMz2X+ijxSxJK6I1fM3AXxYo2lYjmxBH6a4T9X58llYH78wYVz8xZSVY1m9B+EATUjjgdExTdVWf358Egi/l6mvNd/hc1Wg/PLqWcMQW1Qx6X5KulO0C2ONthXN6KTmAbOOsqpGaZm0ZG7yoEx3eATnl8b2GcauESzZuOg/72/9pDextBjt0QNcAfzdKnfoxNbe0FeSnfsAjdIW/vqnOJgilTDgH138jmliVGrgwp4horM9qDnBDS9JJOk7fUNi2s+CSXrQpVXsoYLMaLfmuQaYsetxPEFUfNligQay2U6BNBTvwaGN8oneTq6nkkUOufg/I1LXigo+VktPupBCkKDE6HXUPTjFsf5NxKjK2RlRzxEy1vMgEfSTronmLxO+H/af4Or8OrAY7WynrNnf5rmOJ/J6+UM3x4+vgICYDn4gZtLXQLEoKnd5U36So/Cm5mcDLuPCZ3KUl7gVd++g0aUBeA== X-Forefront-Antispam-Report: CIP:216.228.112.32; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid01.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(4326008)(6666004)(47076005)(36756003)(70206006)(83380400001)(70586007)(26005)(1076003)(2906002)(7636003)(6286002)(508600001)(2616005)(8676002)(316002)(54906003)(110136005)(7696005)(82310400003)(356005)(36860700001)(5660300002)(336012)(86362001)(55016002)(186003)(16526019)(426003)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2021 08:12:00.6088 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c88528a-2bba-49e0-7455-08d97e69d1dc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.32]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2900 Subject: [dpdk-dev] [PATCH v2 1/2] sched: adds function to get 64 bits greatest common divisor X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" This patch adds new function that compute the greatest common divisor of 64 bits, also changes the original 32 bits function to call this new 64 bits version. Signed-off-by: Xueming Li Cc: stable@dpdk.org --- lib/sched/rte_sched_common.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/sched/rte_sched_common.h b/lib/sched/rte_sched_common.h index 96706df7bd..340a0df312 100644 --- a/lib/sched/rte_sched_common.h +++ b/lib/sched/rte_sched_common.h @@ -51,10 +51,10 @@ rte_min_pos_4_u16(uint16_t *x) * gcd(a, b) = gcd(b, a mod b) * */ -static inline uint32_t -rte_get_gcd(uint32_t a, uint32_t b) +static inline uint64_t +rte_get_gcd64(uint64_t a, uint64_t b) { - uint32_t c; + uint64_t c; if (a == 0) return b; @@ -76,6 +76,15 @@ rte_get_gcd(uint32_t a, uint32_t b) return a; } +/* + * 32bit version of Compute the Greatest Common Divisor (GCD). + */ +static inline uint32_t +rte_get_gcd(uint32_t a, uint32_t b) +{ + return rte_get_gcd64(a, b); +} + /* * Compute the Lowest Common Denominator (LCD) of two numbers. * This implementation computes GCD first: -- 2.33.0