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 DE60EA0518 for ; Fri, 24 Jul 2020 14:09:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D702A1C1C7; Fri, 24 Jul 2020 14:09:09 +0200 (CEST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by dpdk.org (Postfix) with ESMTP id 7DA7F1C1D9 for ; Fri, 24 Jul 2020 14:09:08 +0200 (CEST) Received: by mail-wm1-f46.google.com with SMTP id 184so8064239wmb.0 for ; Fri, 24 Jul 2020 05:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DBEd2Ap/thA7dTJT+2gC6cicVE9hRWvCFuSe3KAY+l0=; b=IDn6n4q3OCyoBptAwFo8ehp98Ri87YvxEtCDC/T/Ykel0xhaUBZQ74uuQI/PDWKjZP JHnXzK9N+Z4xfJYi57Xi/bnj4gUN9pUFLIxlhzwgC26/msG4a2WWymcKiS6TvyO4x65P WPALL9QQc/curQyDK123K/lYvcmc7IpQD+S+dFZE0W/G9lYtM8GbZm+W4YASlmWXKAxq NQ4tAcZtbAJS7/Z4Davz6Ks7XVjTmP+YUWLaSjJ4tPAGp9Xhnipr7IIXz+GWtFYCmhl+ KqF4YFy2fge4qnvVh/uT2fN8sfnJ95spudK71yLWBvrDLsjrxCSpm/lPU7qw6N7llYxg Wclg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DBEd2Ap/thA7dTJT+2gC6cicVE9hRWvCFuSe3KAY+l0=; b=i1IM7y3ZO6VO6dL93vwMfpX0UOmlmR+PPQWheFvaGd5a8JEB+yVU1cfLjKDZO9Ay4Y qIkYm7r3EAEf6tQoqtZgyEGwZB9Be/AJjwbvwo1TS7QFdUF6nCPQ01zqbYiyhT12d4C8 EgtJOlhhCL8kibFV3JsTLqM2TI7AXxU59PnlIjQpwkOmvyL4IyxUZ7PvhuTE3bRFMb4I /7inBRD2x3XKUb1BczjhJsZ69Pn8gmPJuZphUF4vXEr6ZI30jpM2gXu0EfJemV0egbP9 HKLIO8V84/KsyNMdG+y9GXk0LiqJvstDb1iXUixWXUIdY4LMr4XHyuChMU2uzmcKhmaW PZfw== X-Gm-Message-State: AOAM533AGweKk6DIHG6YxwzDPQS2mhy+RZV7wQC6XRlXETqQPDh5QCoQ wIRturF49tUeJKBYHA/aVb/MTrhe/40cXg== X-Google-Smtp-Source: ABdhPJzbDULOGYhI9oNN18S2VmCJ7LtTLTubVIow9bYEdb0otnLOMv28yoZIWfD+OsG2cCDZeO1WTQ== X-Received: by 2002:a7b:ce04:: with SMTP id m4mr8358491wmc.1.1595592548205; Fri, 24 Jul 2020 05:09:08 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id g126sm7019001wme.16.2020.07.24.05.09.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:09:07 -0700 (PDT) From: luca.boccassi@gmail.com To: Harman Kalra Cc: dpdk stable Date: Fri, 24 Jul 2020 12:59:26 +0100 Message-Id: <20200724120030.1863487-128-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'eal: fix parentheses in alignment macros' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.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 07/26/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. Thanks. Luca Boccassi --- >From f5f37e8889243b92cc325817c7f72849b37f818a Mon Sep 17 00:00:00 2001 From: Harman Kalra 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 --- lib/librte_eal/common/include/rte_common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h index 41e2778ec..fe7539af2 100644 --- a/lib/librte_eal/common/include/rte_common.h +++ b/lib/librte_eal/common/include/rte_common.h @@ -245,7 +245,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) * than the first parameter. */ #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)) /** * Macro to align a value to the multiple of given value. The resultant @@ -253,7 +253,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) * than the first parameter. */ #define RTE_ALIGN_MUL_FLOOR(v, mul) \ - ((v / ((typeof(v))(mul))) * (typeof(v))(mul)) + (((v) / ((typeof(v))(mul))) * (typeof(v))(mul)) /** * Macro to align value to the nearest multiple of the given value. @@ -264,7 +264,7 @@ 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; \ }) /** -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:53.467756775 +0100 +++ 0128-eal-fix-parentheses-in-alignment-macros.patch 2020-07-24 12:53:48.423008994 +0100 @@ -1,26 +1,27 @@ -From 3596a037ab44a1ad588fb388d5d4ee8f3d2a1ca7 Mon Sep 17 00:00:00 2001 +From f5f37e8889243b92cc325817c7f72849b37f818a Mon Sep 17 00:00:00 2001 From: Harman Kalra 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") -Cc: stable@dpdk.org Signed-off-by: Harman Kalra --- - lib/librte_eal/include/rte_common.h | 6 +++--- + lib/librte_eal/common/include/rte_common.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h -index 586f815c5..8f487a563 100644 ---- a/lib/librte_eal/include/rte_common.h -+++ b/lib/librte_eal/include/rte_common.h -@@ -304,7 +304,7 @@ 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 41e2778ec..fe7539af2 100644 +--- a/lib/librte_eal/common/include/rte_common.h ++++ b/lib/librte_eal/common/include/rte_common.h +@@ -245,7 +245,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) * than the first parameter. */ #define RTE_ALIGN_MUL_CEIL(v, mul) \ @@ -29,7 +30,7 @@ /** * Macro to align a value to the multiple of given value. The resultant -@@ -312,7 +312,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) +@@ -253,7 +253,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) * than the first parameter. */ #define RTE_ALIGN_MUL_FLOOR(v, mul) \ @@ -38,7 +39,7 @@ /** * Macro to align value to the nearest multiple of the given value. -@@ -323,7 +323,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) +@@ -264,7 +264,7 @@ 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); \