[dpdk-stable] patch 'sched: get 64-bit greatest common divisor' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:29:10 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/bb7f3bc24ba6023e9bd5782ac68bc433c3e7a005

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From bb7f3bc24ba6023e9bd5782ac68bc433c3e7a005 Mon Sep 17 00:00:00 2001
From: Xueming Li <xuemingl at nvidia.com>
Date: Thu, 23 Sep 2021 16:11:21 +0800
Subject: [PATCH] sched: get 64-bit greatest common divisor
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit eb5636e879a568a323cbed4c356162011e7312be ]

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-bit version.

Signed-off-by: Xueming Li <xuemingl at nvidia.com>
Acked-by: Kevin Traynor <ktraynor at redhat.com>
---
 lib/librte_sched/rte_sched_common.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/lib/librte_sched/rte_sched_common.h b/lib/librte_sched/rte_sched_common.h
index 96706df7bd..e4cbbd9077 100644
--- a/lib/librte_sched/rte_sched_common.h
+++ b/lib/librte_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;
 }
 
+/*
+ * 32-bit version of 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

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:05.019503122 +0800
+++ 0066-sched-get-64-bit-greatest-common-divisor.patch	2021-11-10 14:17:01.824079806 +0800
@@ -1 +1 @@
-From eb5636e879a568a323cbed4c356162011e7312be Mon Sep 17 00:00:00 2001
+From bb7f3bc24ba6023e9bd5782ac68bc433c3e7a005 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit eb5636e879a568a323cbed4c356162011e7312be ]
@@ -10,2 +12,0 @@
-Cc: stable at dpdk.org
-
@@ -15 +16 @@
- lib/sched/rte_sched_common.h | 15 ++++++++++++---
+ lib/librte_sched/rte_sched_common.h | 15 ++++++++++++---
@@ -18 +19 @@
-diff --git a/lib/sched/rte_sched_common.h b/lib/sched/rte_sched_common.h
+diff --git a/lib/librte_sched/rte_sched_common.h b/lib/librte_sched/rte_sched_common.h
@@ -20,2 +21,2 @@
---- a/lib/sched/rte_sched_common.h
-+++ b/lib/sched/rte_sched_common.h
+--- a/lib/librte_sched/rte_sched_common.h
++++ b/lib/librte_sched/rte_sched_common.h


More information about the stable mailing list