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 DBF99A0547; Fri, 12 Mar 2021 19:49:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97AF71608DA; Fri, 12 Mar 2021 19:49:15 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 24C691608D5 for ; Fri, 12 Mar 2021 19:49:14 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 58AB620B26E1; Fri, 12 Mar 2021 10:49:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 58AB620B26E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1615574953; bh=iLAsL0LF+QRGEPSUxYfhMyULDxgxtKcJAC+DyiZx1tc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gnx3F+Js7YtwVIVptptAmAIpxWKd3taBf4SNdf5p3UnyH+i/QONUX2cPy3YhPmSCX 8+Z3nSml7Uhp+EmlOd+6O6XF6w8iWNKU0r9IJ93nlR8U4Zp5cScuMBREEhcwPO+dLr LK9gcggLdffuQNZae+gG5Yol7S6ZYJ7m1Qc68cJE= Date: Fri, 12 Mar 2021 10:49:13 -0800 From: Tyler Retzlaff To: David Marchand Cc: dev , Thomas Monjalon , Aaron Conole Message-ID: <20210312184913.GD23744@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1615496911-7050-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Fri, Mar 12, 2021 at 09:07:22AM +0100, David Marchand wrote: > On Thu, Mar 11, 2021 at 10:08 PM Tyler Retzlaff > wrote: > > > > Avoid expanding v and mul parameters multiple times in the macro. based > > on usage of the macro it seems like side effects were not intended. > > > > For example: > > ``return RTE_ALIGN_MUL_NEAR(rte_rdtsc() - start, CYC_PER_10MHZ);'' > > That's the beauty of macros. > How about updating the unit tests so that this kind of issue is not > reintroduced? i would like to. if i can find time i will but i can't promise. > > > Are other RTE_ALIGN_* macro affected with similar issues? > Like mul expression passed to RTE_ALIGN_MUL_FLOOR and RTE_ALIGN_MUL_CEIL. it is possible. i did look at a number of these macros while evaluating something else but until i ran into this looking for side effects wasn't on my radar. > > > -- > David Marchand