From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0083.outbound.protection.outlook.com [157.56.110.83]) by dpdk.org (Postfix) with ESMTP id CCDBB37A6 for ; Tue, 31 May 2016 14:59:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bUuMaCA/2hesMW+zZ5BNMFQeG/k8FNVjqj+w6oiFVFA=; b=MveFIiICDc+OEuco1d8IvRJIJbybKVctF01qyATB23/UvccAmG3Pjgy/T2tRjujNXnWNimuNa4rLYwpJ+cdOsScCHhLhgVCz+HOuC154s6Wxu/EAjIll1uAganGOZ72ym70A5dO0B6NAR72LIqUWoUBRcAUpuGVw8/ntGNgbJag= Authentication-Results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (111.93.218.67) by CY1PR0701MB1728.namprd07.prod.outlook.com (10.163.21.142) with Microsoft SMTP Server (TLS) id 15.1.506.9; Tue, 31 May 2016 12:59:02 +0000 Date: Tue, 31 May 2016 18:28:42 +0530 From: Jerin Jacob To: Olivier Matz CC: , , , Message-ID: <20160531125822.GA10995@localhost.localdomain> References: <1464101442-10501-1-git-send-email-jerin.jacob@caviumnetworks.com> <1464250025-9191-1-git-send-email-jerin.jacob@caviumnetworks.com> <574BFD97.2010505@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <574BFD97.2010505@6wind.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0007.INDPRD01.PROD.OUTLOOK.COM (10.164.137.14) To CY1PR0701MB1728.namprd07.prod.outlook.com (10.163.21.142) X-MS-Office365-Filtering-Correlation-Id: aa341308-5e30-4fdf-7cc5-08d389535834 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 2:TV+RpNmbB1U5siJUxaYUw45pO1DNYmcLUL37IC9OTg++hWip5/kGKy2ruFIgHGILZaMykJGVck4QmUDlWk0+oguPqqYRH3GVVBNYtt+9IsHIGOBEAVUcmXqUKF3q6dsYiDDt0PonSmVWnxrr0NhLGpDwHlV3izF4ZuIwhvTP12PF+TgRCjjNQNFG2neUvZef; 3:zecxB6yn+JLo2POD7cb3+RqdzQ4TOHH7ToP9l/goo8GTkFVh5KugW+l/wyugMgjr4m2sBrDmPWmVFt+lcUf0/PDwMLc1/EcROvzdLECPdgYI9odiGck5DnDzGRpaT6JJ; 25:4IMa82mEXadJ7Rq6zTmChbOd2cLICPZlwIFxhIijwy51m57G6QRfdZ8ZEV9+0AAS/afJcDTR91WvzeBSL3S93RwOXEKFySY9u9ZdMoUP2kfinQPqpbIhHVq/FM3XHidElhZz72BrEZsvrSv0USzQ3mUa8G/FTuFh8e/d/5Q9ezTIHG1cn+8b/6gx+HLFMjfwtdunjAOgiUwYlBthy1ztaS98FHmWNDQGb6cqkXaRJNO0cjD+Baf78efjsZWSCpqrHQRJrkNS3LlyeY5AGPwW+bgLudOMKNmwXGt89N4eRyzN4pcVvQO38fR6LAkJ642Dgn2D3bO1dPCEtmV3UB2n0ywVeVYKydseeHqp2M+sUc9vCrFOd5GNAlImsSsG8zcLdOxEv5J6DkrJqHQ4e0hop9JUoMpCnJ6CtWP7IZYQqDE= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1728; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 20:YqrySHc8lMuplXUpF5Tqb+ExtJ03L09watQzPX8Sbi139rt8WQTdoMKa0tperaMIvemUflQORGqtYSQXRGU9214pb7c6asxw/HR8BOE+qRruVf/F2wjwh3rsX8ZzmIIE09FEf/X1WzjUo431BdEo7OQVKifuqwtUd4ZxBu9BG8L71+c4lgteTlvoex1kbasbpRtAIdmmtfV6F87wqLObw6MswMgSdGKrNRgVbSxbRm0zdKxv0GW6ziQD4UHG+03Ghud59XW61K8rwvdeXIA9GTZRKVC9HNOhLNjaRUao/ux8Dd1TpDWT/u5nXtPalZsYEaGwq1ojFxLV6PfU+f7X1l4VaW8r+gq2TXuLRSa9aQBNymFRaksgB6K080oduvXOyXSvuL3JLyF6jIubz8yzHy1vryF0QDGYbI1EDh5/rhMyQLz7tIRQ0FH8jpTxd5ccxji8N6J9xb4xuxKz5JyL3mVYj5HJyMSVgC/kaZ9I0lYw2JX4/xDQZmMLeg0Apw3R+06sb7Um/JJWtA+j+DFpur2tuj4vikxktCXtaLK+RhzfbyeyV9y/04Q7sqKeUdaVFUJPHYErFVKiQnFA6906ljXVgcbQG7dFqVFvlpciMnw= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(131327999870524)(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:CY1PR0701MB1728; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1728; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1728; 4:ee02vZGgUVpxmRDFzDvxl386rpo8gxc71yjUTTGn2yi+p5gAZzqNIlekBMwTQZ86UaFOH3BBw1LRn0ZJSKcT/45aRa5RjA5Y8vzVrXm8ZpTc5haSCjMHXcVEFnfqOPNcBsu0KlHBDetEk5cwBu5a5qbupeImUQsPjpsjMsoY9+Pq0VmvTO50R9p771O7r7eYbjQhC2PCMgAJIF2lQCCYwEs5mHf1FdUtIDyik1+237e8ERktE5fwTbC3UAx0oToUZQxhp788BVR3rQo8+fL8TbWj7tcoUb0cb3i76I+rr8JgvFsKhYy1ek5Kl1hCJ5y71+QsiwAY/arxUPr+UUcjTvag1QcagfcOa3p2pM9qG4x2KBmJvJseeSl21DmP015mV8qiaP3QXYwUD+9TuwEzzGat+k1I87csz3BXrW5H5hbBy987oC6bxCmM5NYJixdh X-Forefront-PRVS: 095972DF2F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(24454002)(76104003)(377454003)(97756001)(2906002)(50466002)(23726003)(4326007)(189998001)(92566002)(50986999)(5004730100002)(8676002)(76176999)(54356999)(81166006)(46406003)(2950100001)(5009440100003)(5008740100001)(110136002)(19580405001)(61506002)(19580395003)(83506001)(42186005)(4001350100001)(1076002)(47776003)(586003)(66066001)(77096005)(33656002)(3846002)(6116002)(9686002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1728; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1728; 23:6rec0T8Y67WZ4Hbj88jqoBSplH0RwlT40ZFVGu5?= =?us-ascii?Q?wdsXThYSKfCdCPYNZZJ10JBoA1q7r/7R12PbplwB80RmWRv6HzY86/H5pSkV?= =?us-ascii?Q?3gR7xjrWt72KQar2ZFbgYULLNyEpCVnlbKJAI0nXYGfBiCWYygEWTFLzIZMo?= =?us-ascii?Q?8sgKVZImtKhWrqYHiLhZKhQ0OVvhxvZ2SGW38wX/hYh9yf7yHuK6RFKc+6ns?= =?us-ascii?Q?2iFSZOQT3JXFrr++tgoq+AdTvg0RCRG4jADrj4sWmlMTHn5wDX1RVmn8mhw5?= =?us-ascii?Q?tf6eEqmz7sOKCMg6jMYvzDG+ymOOcs5jplbTmaswD3AkhIBFhkeSnN7WEWlF?= =?us-ascii?Q?tHU8b1wDgFZAkh1dLUaqlVTryJ9jZAxTMmjkDhvnapuyBjAZoti0oEqekJu7?= =?us-ascii?Q?5WVwE4AIdSLEKWFce5p6JVUES5vfrVTThc9dph9v46U6AQij1WxMosSH7teV?= =?us-ascii?Q?cnIYsouqDi6o7dvSVUP3HInEyXHqmbtdGshL6q98r/z38vwAO5ueBFXtw7Vk?= =?us-ascii?Q?Ot1+HoN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hWCdSIaIBKD4yRHUVDPVD75EmAXU/nGrUvepm4fVMPKeXThDLE9JvAxYR3nsgu3udppgJLurcItJv+biqiZkM/7+Lo0bI+JdeQiLhp/q5NqvxbT0SVpfd SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2016 12:59:02.4809 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1728 Subject: Re: [dpdk-dev] [PATCH v2] mempool: replace c memcpy code semantics with optimized rte_memcpy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2016 12:59:06 -0000 On Mon, May 30, 2016 at 10:45:11AM +0200, Olivier Matz wrote: > Hi Jerin, > > On 05/26/2016 10:07 AM, Jerin Jacob wrote: > > Signed-off-by: Jerin Jacob > > --- > > v1..v2 > > Corrected the the git commit message(s/mbuf/mempool/g) > > --- > > lib/librte_mempool/rte_mempool.h | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h > > index 60339bd..24876a2 100644 > > --- a/lib/librte_mempool/rte_mempool.h > > +++ b/lib/librte_mempool/rte_mempool.h > > @@ -73,6 +73,7 @@ > > #include > > #include > > #include > > +#include > > > > #ifdef __cplusplus > > extern "C" { > > @@ -739,7 +740,6 @@ __mempool_put_bulk(struct rte_mempool *mp, void * const *obj_table, > > unsigned n, int is_mp) > > { > > struct rte_mempool_cache *cache; > > - uint32_t index; > > void **cache_objs; > > unsigned lcore_id = rte_lcore_id(); > > uint32_t cache_size = mp->cache_size; > > @@ -768,8 +768,7 @@ __mempool_put_bulk(struct rte_mempool *mp, void * const *obj_table, > > */ > > > > /* Add elements back into the cache */ > > - for (index = 0; index < n; ++index, obj_table++) > > - cache_objs[index] = *obj_table; > > + rte_memcpy(&cache_objs[0], obj_table, sizeof(void *) * n); > > > > cache->len += n; > > > > > > I also checked in the get_bulk() function, which looks like that: > > /* Now fill in the response ... */ > for (index = 0, len = cache->len - 1; > index < n; > ++index, len--, obj_table++) > *obj_table = cache_objs[len]; > > I think we could replace it by something like: > > rte_memcpy(obj_table, &cache_objs[len - n], sizeof(void *) * n); > > The only difference is that it won't reverse the pointers in the > table, but I don't see any problem with that. > > What do you think? In true sense, it will _not_ be LIFO. Not sure about cache usage implications on the specific use cases. Jerin > > > Regards, > Olivier >