From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id C892C325F for ; Mon, 15 Jan 2018 12:38:07 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5E30A203E1; Mon, 15 Jan 2018 06:38:07 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 15 Jan 2018 06:38:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=P+JqMcdH629UWGDK+jtUgp9cZt bNATUIVbgWN5zz/zY=; b=m/mWOg+PmnR2M3PcfLT9gqhX1Q08bBeqcttXJNZQLw mhbwOXY8G/zNJqQBN3Yl2om4HVamvZoIbjf5cdXoE8ZosO2RRYeJScZJGB7e8Mzu +gvjFtM8i9Ch4fY7BBEy7DqZOMDY0+8QlXcAuuwjEYi9XIjvuGn7ROXUS6mE5O7a g= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=P+JqMc dH629UWGDK+jtUgp9cZtbNATUIVbgWN5zz/zY=; b=ppKGCvKhr5Mg/U6dZY+HlO 6fqTN6qnXzT1zk+/QmLql5xKi4xaJ6zLvJgoxAxAR0TlUPoOka6HTdBGfktSl5Wd 9bdvbGclVVlxXAuwRerHk288aIeN4UZrv93Jp/edV9KUHqDHelFWGVwArJTyokvs NOAluI8OTRdhYQzVhegeqSQQs/taXM4KRD4hqR7ZjYn1aR6zw9qjmx2SQtam9LSQ zBOIqLBvh4xGC8Ss1FatZlR+vc1TbGsfbHShZ8Cr1TiRXP9cXKpKap7n8waoNzFL FCp3gitp0RYE6PeRjtRKXzk4Tznu0SRKil2YDjjTMQJaWe+TUhZfDW/1Uo6VpKbg == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id F18EC2473E; Mon, 15 Jan 2018 06:38:06 -0500 (EST) From: Thomas Monjalon To: Herbert Guan Cc: dev@dpdk.org, "jerin.jacob@caviumnetworks.com" , nd Date: Mon, 15 Jan 2018 12:37:35 +0100 Message-ID: <6835875.KleASt5oKJ@xps> In-Reply-To: References: <1511768985-21639-1-git-send-email-herbert.guan@arm.com> <3668269.EoJLONrpA4@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v5] arch/arm: optimization for memcpy on AArch64 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 11:38:08 -0000 15/01/2018 11:57, Herbert Guan: > Hi Thomas, > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Hi, > > > > All the code is using ARM64, but the title suggests AArch64. > > What is the difference between AArch64 and ARM64 (and ARMv8)? > > AArch64 and ARM64 refer to the same thing. AArch64 refers to the 64-bit architecture introduced since ARMv8-A. But the Linux kernel community calls it as ARM64. As to DPDK, in most existing compile flags, ARM64 is used. So this patch keeps the ARM64 naming in newly added compile options. So please let's continue to call it ARM64. > > 04/01/2018 11:20, Herbert Guan: > > > +#define RTE_ARM64_MEMCPY_IS_UNALIGNED_COPY(dst, src) \ > > > + ((uintptr_t)(dst) & RTE_ARM64_MEMCPY_ALIGN_MASK) #else > > > +/* Both dst and src unalignment will be treated as unaligned copy */ > > > +#define RTE_ARM64_MEMCPY_IS_UNALIGNED_COPY(dst, src) \ > > > + (((uintptr_t)(dst) | (uintptr_t)(src)) & > > > +RTE_ARM64_MEMCPY_ALIGN_MASK) #endif > > > + > > > + > > > +/* > > > + * If copy size is larger than threshold, memcpy() will be used. > > > + * Run "memcpy_perf_autotest" to determine the proper threshold. > > > + */ > > > +#define RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD > > ((size_t)(0xffffffff)) > > > +#define RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD > > ((size_t)(0xffffffff)) > > > + > > > +/* > > > + * The logic of USE_RTE_MEMCPY() can also be modified to best fit > > platform. > > > + */ > > > +#define USE_RTE_MEMCPY(dst, src, n) \ > > > +((!RTE_ARM64_MEMCPY_IS_UNALIGNED_COPY(dst, src) && \ n <= > > > +RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD) \ > > > +|| (RTE_ARM64_MEMCPY_IS_UNALIGNED_COPY(dst, src) && \ > > > +n <= RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD)) > > > + > > > +/************************************** > > > + * End of customization section > > > + **************************************/ > > > > Modifying the code to asjust the platform is not easy for deployment. > > Can we move some customization variables inside the configuration file? > > RTE_ARM64_MEMCPY_ALIGNED_THRESHOLD and RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD are the 2 parameters can be configured during build-time. The values can be specified with the best values for the target platform. Usually it's not necessary to change the expression, the comment added in the code is just to raise the hint that this code piece can be modified. The build time configuration must be set in the config file (config/common_armv8a_linuxapp). v6 please?