[dpdk-stable] patch 'eal: fix parentheses in alignment macros' has been queued to LTS release 18.11.10

Kevin Traynor ktraynor at redhat.com
Thu Aug 20 17:33:26 CEST 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/25/20. 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/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/53d8ebacc1392439d183de6dd65ca8bee7ce16c5

Thanks.

Kevin.

---
>From 53d8ebacc1392439d183de6dd65ca8bee7ce16c5 Mon Sep 17 00:00:00 2001
From: Harman Kalra <hkalra at marvell.com>
Date: Wed, 24 Jun 2020 15:50:47 +0530
Subject: [PATCH] eal: fix parentheses in alignment macros

[ upstream commit 3596a037ab44a1ad588fb388d5d4ee8f3d2a1ca7 ]

Found an issue while using RTE_ALIGN_MUL_NEAR with an
expression, like as passed in estimate_tsc_freq().
RTE_ALIGN_MUL_FLOOR resulted in unexpected value as
parathesis are required to evaluate an expression.

Fixes: 5120203d753f ("eal: add macros to align value to multiple")

Signed-off-by: Harman Kalra <hkalra at marvell.com>
---
 lib/librte_eal/common/include/rte_common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index 5006ba8cad..a9d617482a 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -239,5 +239,5 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
  */
 #define RTE_ALIGN_MUL_CEIL(v, mul) \
-	(((v + (typeof(v))(mul) - 1) / ((typeof(v))(mul))) * (typeof(v))(mul))
+	((((v) + (typeof(v))(mul) - 1) / ((typeof(v))(mul))) * (typeof(v))(mul))
 
 /**
@@ -247,5 +247,5 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
  */
 #define RTE_ALIGN_MUL_FLOOR(v, mul) \
-	((v / ((typeof(v))(mul))) * (typeof(v))(mul))
+	(((v) / ((typeof(v))(mul))) * (typeof(v))(mul))
 
 /**
-- 
2.26.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-08-20 16:26:16.615867793 +0100
+++ 0021-eal-fix-parentheses-in-alignment-macros.patch	2020-08-20 16:26:15.806324161 +0100
@@ -1 +1 @@
-From 3596a037ab44a1ad588fb388d5d4ee8f3d2a1ca7 Mon Sep 17 00:00:00 2001
+From 53d8ebacc1392439d183de6dd65ca8bee7ce16c5 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3596a037ab44a1ad588fb388d5d4ee8f3d2a1ca7 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -16,2 +17,2 @@
- lib/librte_eal/include/rte_common.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ lib/librte_eal/common/include/rte_common.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
@@ -19,5 +20,5 @@
-diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h
-index 586f815c54..8f487a563d 100644
---- a/lib/librte_eal/include/rte_common.h
-+++ b/lib/librte_eal/include/rte_common.h
-@@ -305,5 +305,5 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
+diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
+index 5006ba8cad..a9d617482a 100644
+--- a/lib/librte_eal/common/include/rte_common.h
++++ b/lib/librte_eal/common/include/rte_common.h
+@@ -239,5 +239,5 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
@@ -30 +31 @@
-@@ -313,5 +313,5 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
+@@ -247,5 +247,5 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
@@ -37,7 +37,0 @@
-@@ -324,5 +324,5 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
- 		typeof(v) ceil = RTE_ALIGN_MUL_CEIL(v, mul);	\
- 		typeof(v) floor = RTE_ALIGN_MUL_FLOOR(v, mul);	\
--		(ceil - v) > (v - floor) ? floor : ceil;	\
-+		(ceil - (v)) > ((v) - floor) ? floor : ceil;	\
- 	})
- 



More information about the stable mailing list