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 ED7B3A0547; Fri, 12 Mar 2021 07:28:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7819E16089A; Fri, 12 Mar 2021 07:28:19 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 1B5B14067E for ; Fri, 12 Mar 2021 07:28:18 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 43E8520B26C5; Thu, 11 Mar 2021 22:28:17 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 43E8520B26C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1615530497; bh=yLTzS7c2EMk5hMhhHk/bYfsXSGdaLp/xNLglVQUCeFU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=im07bLHFT3r1/nDylVPK/BEEcHGKUslmV1MVg+CgGuwTXtqL5ZjPGbCbePpsUUSSF 30O5AF0tfaTgon4G/aQ8OHu4Id7K0Fn9dv4IUtz7it7aDJAWz0y3vPxt2D5m4K90RU 9uiHe2N/vxFZVlBehDd+tsRDxAGvCKa64rTWBL8g= Date: Thu, 11 Mar 2021 22:28:17 -0800 From: Tyler Retzlaff To: Ranjit Menon Cc: dev@dpdk.org, thomas@monjalon.net Message-ID: <20210312062817.GB6784@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1615496911-7050-1-git-send-email-roretzla@linux.microsoft.com> <20210312013414.GA6784@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <7e84d8a3-45cc-4477-14cd-b595e1fdf1e9@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e84d8a3-45cc-4477-14cd-b595e1fdf1e9@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [dpdk-dev] [PATCH] eal: avoid side effects in RTE_ALIGN_MUL_NEAR(v, mul) for v and mul 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" On Thu, Mar 11, 2021 at 08:41:58PM -0800, Ranjit Menon wrote: > > On 3/11/2021 5:34 PM, Tyler Retzlaff wrote: > >On Thu, Mar 11, 2021 at 04:40:58PM -0800, Ranjit Menon wrote: > >>On 3/11/2021 1:08 PM, Tyler Retzlaff wrote: > >>>diff --git a/lib/librte_eal/include/rte_common.h b/lib/librte_eal/include/rte_common.h > >>>index 1b630baf1..640befee2 100644 > >>>--- a/lib/librte_eal/include/rte_common.h > >>>+++ b/lib/librte_eal/include/rte_common.h > >>>@@ -345,9 +345,11 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void) > >>> */ > >>> #define RTE_ALIGN_MUL_NEAR(v, mul) \ > >>> ({ \ > >>>- typeof(v) ceil = RTE_ALIGN_MUL_CEIL(v, mul); \ > >>>- typeof(v) floor = RTE_ALIGN_MUL_FLOOR(v, mul); \ > >>>- (ceil - (v)) > ((v) - floor) ? floor : ceil; \ > >>>+ typeof(v) _v = (v); \ > >>>+ typeof(v) _m = (mul); \ > >>For consistency sake, can this variable be changed to '_mul'? > >sure, i can do that. it will hit another tab stop below though. > >i'll submit a v2 with the requested change. > > Ugh! In that case, let it be. If others insist on the change, we can do it. heh, yeah painful. okay i will leave the patch as it is and wait a bit for someone with a strong opinion. > > ranjit m. > > > > >>>+ typeof(v) ceil = RTE_ALIGN_MUL_CEIL(_v, _m); \