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 DF9D8A3295 for ; Wed, 23 Oct 2019 12:05:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8F8291BFEF; Wed, 23 Oct 2019 12:05:28 +0200 (CEST) Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id 57E041BFE7 for ; Wed, 23 Oct 2019 12:05:27 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id 2CB973356BB; Wed, 23 Oct 2019 12:05:27 +0200 (CEST) Date: Wed, 23 Oct 2019 12:05:27 +0200 From: Olivier Matz To: Honnappa Nagarahalli Cc: sthemmin@microsoft.com, jerinj@marvell.com, bruce.richardson@intel.com, david.marchand@redhat.com, pbhagavatula@marvell.com, konstantin.ananyev@intel.com, drc@linux.vnet.ibm.com, hemant.agrawal@nxp.com, dev@dpdk.org, dharmik.thakkar@arm.com, ruifeng.wang@arm.com, gavin.hu@arm.com Message-ID: <20191023100527.GG25286@glumotte.dev.6wind.com> References: <20190906190510.11146-1-honnappa.nagarahalli@arm.com> <20191021002300.26497-1-honnappa.nagarahalli@arm.com> <20191021002300.26497-7-honnappa.nagarahalli@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191021002300.26497-7-honnappa.nagarahalli@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [RFC v6 6/6] lib/ring: improved copy function to copy ring elements 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Sun, Oct 20, 2019 at 07:23:00PM -0500, Honnappa Nagarahalli wrote: > Improved copy function to copy to/from ring elements. > > Signed-off-by: Honnappa Nagarahalli > Signed-off-by: Konstantin Ananyev > --- > lib/librte_ring/rte_ring_elem.h | 165 ++++++++++++++++---------------- > 1 file changed, 84 insertions(+), 81 deletions(-) (...) > +static __rte_always_inline void > +copy_elems(uint32_t du32[], const uint32_t su32[], uint32_t nr_num) > +{ > + uint32_t i; > + > + for (i = 0; i < (nr_num & ~7); i += 8) > + memcpy(du32 + i, su32 + i, 8 * sizeof(uint32_t)); > + > + switch (nr_num & 7) { > + case 7: du32[nr_num - 7] = su32[nr_num - 7]; /* fallthrough */ > + case 6: du32[nr_num - 6] = su32[nr_num - 6]; /* fallthrough */ > + case 5: du32[nr_num - 5] = su32[nr_num - 5]; /* fallthrough */ > + case 4: du32[nr_num - 4] = su32[nr_num - 4]; /* fallthrough */ > + case 3: du32[nr_num - 3] = su32[nr_num - 3]; /* fallthrough */ > + case 2: du32[nr_num - 2] = su32[nr_num - 2]; /* fallthrough */ > + case 1: du32[nr_num - 1] = su32[nr_num - 1]; /* fallthrough */ > + } > +} minor comment: I suggest src32 and dst32 instead of su32 and du32.