From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0093.outbound.protection.outlook.com [65.55.169.93]) by dpdk.org (Postfix) with ESMTP id 907EF93FC for ; Mon, 7 Dec 2015 07:58:08 +0100 (CET) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@caviumnetworks.com; Received: from localhost.localdomain (122.167.201.216) by CY1PR0701MB1727.namprd07.prod.outlook.com (10.163.21.141) with Microsoft SMTP Server (TLS) id 15.1.337.19; Mon, 7 Dec 2015 06:58:03 +0000 Date: Mon, 7 Dec 2015 12:27:34 +0530 From: Jerin Jacob To: Jianbo Liu Message-ID: <20151207065731.GA2897@localhost.localdomain> References: <1448904253-12929-1-git-send-email-jerin.jacob@caviumnetworks.com> <1449242086-19051-1-git-send-email-jerin.jacob@caviumnetworks.com> <1449242086-19051-2-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [122.167.201.216] X-ClientProxiedBy: PN1PR01CA0050.INDPRD01.PROD.OUTLOOK.COM (25.164.136.150) To CY1PR0701MB1727.namprd07.prod.outlook.com (25.163.21.141) X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1727; 2:gLFt96rTXDowpMVl5wb69plRcne7qDKA6aW33cSD7cKHGu9rU/H3JqR75giisbq5CiMn8s8bFgPKywCb9mEsBw4Eht1u1Y1zFHeyOYuma+niuhQJ1kngNFEjuEgmFnPoseC1PYfNORxei5DKrErW5w==; 3:ssZoDoXz8IYCxgFOrzSvwNjf0FY5IFnc0RkJZWDX9wAPqBEshGsQFKL+hPrSfNyY8J8x1FYvY+J+e9M56vro9YsBLCPBt/fyCoNgEntynMEYK1UoLxct2gvzuo0Oa5+h; 25:54pAcwpFDyzqy4w/KH/DUnjfAGlYrgkjnHAmhnkAlVEkKrwicid0QTmI2ICqG2skhp5ItmeSxrijUwsT9zJcu9EmpwTHUH1n600DtrJt44UNeNb9WJkNrHb1z0PHX8lAcSymcHPufu/cm1ASIQ25mWX4tGiWZI63HpOybTmegLWxtAcAy/06dRigJTQg9ws2s+KtxzMiRoYkfcvxRuu3/Wfap4t/XI89uXx7DbuKuZdh+PXLwdCltoW2WPi3mn/hogEwBiVCD83Oc8RM2xMs5Q== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0701MB1727; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1727; 20:XwSMrNK5aaR08yLZH7Oqz9ePd4mwikbhuUJReyJXv+JUpBSLqXeso67tN5a6kYhsvecC9AekGMAaIgLwxNK/yFZcOgOeyqe80sn1Ltuw2aWQgo54+aLqbzmq/t/fTFyCVem2VLwa5QKRl4SitSWZMD0vHk48e6wFlSUFiYmoq+C/TXt18cjmeYmIpCH1w2uHdOJ+TItshAhMROW125wcV9q+bN+mR3mwBaGqKFRCZltW6i/lBLKIqd4HJjhehP8k4duA0KTDDi5qtiYjmPWROPLOv2ul2IJ2BDNMRllxw7afBEWKj2Sg8l4NvKqoslAxlEW1/SdXMiuUaG8eLEStJ49xOhPpTwGBXlkcfxKYE6pV1wZen8HaTE2N4s+llIB8eWvD7qxEK1LN45hPdbU2uQWW/I896xRuwhFnx6im6xOtA1gBzfwrIGHasardRd0cf6c8f2Xj+zI/MxevMkJRcVFmnA4WqJ0Rl8F32sTiuYWy4kUIQC43NNpp3GNkBgWjHzi9dTbEjG3PWnGi3XzjjRMJrwKGmraLITuwCAvcLDaZu1y15H+PGWvgAtxLzC4jYlDKtuMe5glYPnak9bWoiccQAqoGmDD5sVJDTm6Wj2I= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:CY1PR0701MB1727; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0701MB1727; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1727; 4:5hlz5W3kqQf7jia/p/tSyqgNVX7QnxxGjCzwTn80+CeeCXG26ZfQb4Z1+SfopguS0lJ5nSrynv6jR8eFe52Tvr3sWKPBAx+hF1X2EZRKJv1ntOoiNZV3LzN20G/qWxlmkKoOouvU55dmPS1+g13a2o7WwlfrNrZgjUMlCWI7R+BL5fETBzbZMV6oALSyM3n/5BFmLZTZbpwY8bhXLv0gOl5aS156rYFR3S/dXAJ0ubrPfsLlCZzU3PweNw+KBcqmbvBGXYTjoJXYUWcUL1R1tbdJ4AGvnH8gFtJZnyD7j+/A9tdHXhJ/NuWbxU31rQOOh++lB1p0F/agqk73WAHt6Y1u3nmGlUlXWRfe8Xg6QSkEIh0zGDHY/25KcwUyUZDInjYJE2xckf8JWDU8rkCQxvV0b4J4OuyfF+HMbibWWQtcuVQuenzeXHB6yW7EsHl7 X-Forefront-PRVS: 078310077C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(199003)(189002)(24454002)(164054003)(42186005)(83506001)(23726003)(86362001)(50986999)(46406003)(54356999)(19580395003)(110136002)(76176999)(33656002)(5008740100001)(5001960100002)(81156007)(19580405001)(4001350100001)(189998001)(3846002)(97736004)(586003)(92566002)(5004730100002)(6116002)(1096002)(15975445007)(87976001)(122386002)(1076002)(97756001)(101416001)(93886004)(2950100001)(50466002)(40100003)(15395725005)(106356001)(77096005)(47776003)(105586002)(66066001)(61506002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1727; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1727; 23:t6nMbPFnNsAFE3Xb36fowTXpY/2+eZJmsE1AsPD?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ZVSTdhHdLKHHlXVE3G1tVlQ?= =?us-ascii?Q?wA/rj3ojpBgqf67hdavvf4xP8Zia+QTjv9JkMTBgQcC/mgEnUwGkHoM/lZ2L?= =?us-ascii?Q?3zGDJ2HinYHvpFYxwavuQ3/3IDWQSHmY3hzvmkUOE35ijWFJShz0KdZ21YMC?= =?us-ascii?Q?c3bdS8eCIk9QUZR2AQbmE6xx5+8uCZhZ/+w+OPhwB8LXa3Myeu03Pr8gsEsn?= =?us-ascii?Q?dKStf/R/NbpJsW4H6wUuMCscaCLwZGyDpZDAFez1wBDkmrQH8ddT6OCSvfan?= =?us-ascii?Q?nizo2F+F4zHOFmBupghkAQ2PO1XCmos2IRhiPT/oPcEXgdyoIuVMLP7XetDa?= =?us-ascii?Q?Tffis/6uRU8vkgmLQRxE=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1727; 5:zaVDUTs3pwmBR7mOsbpyxEj613ObUvtJ5Bh6ZAwKnVuj4PhYZnQGBaohqj/X4DPhHBxVkDTu2zK92WjvtMQ9E3hemLwEgGt5vsLPobzYsCM/iCV8ayDJbWRfIhoa6++u6GL4+NOUw0TRqe2zc0L/HQ==; 24:olJDwoxQP24uLFcK+aXO/vxUURWa43879TO7gpMmaBm8/5Jw2VVsVPMLA+zeLWOVteDhApnmmRgRjWzMVEX7faBTb9Q0hnymgAO6B1KxrC8= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2015 06:58:03.5400 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1727 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2 1/3] lpm: make rte_lpm_lookupx4 API definition architecture agnostic 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: Mon, 07 Dec 2015 06:58:09 -0000 On Mon, Dec 07, 2015 at 02:15:28PM +0800, Jianbo Liu wrote: > On 4 December 2015 at 23:14, Jerin Jacob wrote: > > -Used architecture agnostic xmm_t to represent 128 bit SIMD variable > > > > -Introduced vect_* API abstraction in app/test to test rte_lpm_lookupx4 > > API in architecture agnostic way > > > > -Moved rte_lpm_lookupx4 SSE implementation to architecture specific > > rte_lpm_sse.h file to accommodate new rte_lpm_lookupx4 implementation > > for a different architecture. > > > > Signed-off-by: Jerin Jacob > > --- > > app/test/test_lpm.c | 21 ++++--- > > app/test/test_xmmt_ops.h | 47 ++++++++++++++ > > lib/librte_lpm/Makefile | 2 + > > lib/librte_lpm/rte_lpm.h | 93 +--------------------------- > > lib/librte_lpm/rte_lpm_sse.h | 143 +++++++++++++++++++++++++++++++++++++++++++ > > 5 files changed, 206 insertions(+), 100 deletions(-) > > create mode 100644 app/test/test_xmmt_ops.h > > create mode 100644 lib/librte_lpm/rte_lpm_sse.h > > > > diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c > > index 8b4ded9..59674f1 100644 > > --- a/app/test/test_lpm.c > > +++ b/app/test/test_lpm.c > > @@ -49,6 +49,7 @@ > > > > #include "rte_lpm.h" > > #include "test_lpm_routes.h" > > +#include "test_xmmt_ops.h" > > > > #define TEST_LPM_ASSERT(cond) do { \ > > if (!(cond)) { \ > > @@ -308,7 +309,7 @@ test6(void) > > int32_t > > test7(void) > > { > > - __m128i ipx4; > > + xmm_t ipx4; > > uint16_t hop[4]; > > struct rte_lpm *lpm = NULL; > > uint32_t ip = IPv4(0, 0, 0, 0); > > @@ -324,7 +325,7 @@ test7(void) > > status = rte_lpm_lookup(lpm, ip, &next_hop_return); > > TEST_LPM_ASSERT((status == 0) && (next_hop_return == next_hop_add)); > > > > - ipx4 = _mm_set_epi32(ip, ip + 0x100, ip - 0x100, ip); > > + ipx4 = vect_set_epi32(ip, ip + 0x100, ip - 0x100, ip); > > rte_lpm_lookupx4(lpm, ipx4, hop, UINT16_MAX); > > TEST_LPM_ASSERT(hop[0] == next_hop_add); > > TEST_LPM_ASSERT(hop[1] == UINT16_MAX); > > @@ -354,7 +355,7 @@ test7(void) > > int32_t > > test8(void) > > { > > - __m128i ipx4; > > + xmm_t ipx4; > > uint16_t hop[4]; > > struct rte_lpm *lpm = NULL; > > uint32_t ip1 = IPv4(127, 255, 255, 255), ip2 = IPv4(128, 0, 0, 0); > > @@ -380,7 +381,7 @@ test8(void) > > TEST_LPM_ASSERT((status == 0) && > > (next_hop_return == next_hop_add)); > > > > - ipx4 = _mm_set_epi32(ip2, ip1, ip2, ip1); > > + ipx4 = vect_set_epi32(ip2, ip1, ip2, ip1); > > rte_lpm_lookupx4(lpm, ipx4, hop, UINT16_MAX); > > TEST_LPM_ASSERT(hop[0] == UINT16_MAX); > > TEST_LPM_ASSERT(hop[1] == next_hop_add); > > @@ -408,7 +409,7 @@ test8(void) > > status = rte_lpm_lookup(lpm, ip1, &next_hop_return); > > TEST_LPM_ASSERT(status == -ENOENT); > > > > - ipx4 = _mm_set_epi32(ip1, ip1, ip2, ip2); > > + ipx4 = vect_set_epi32(ip1, ip1, ip2, ip2); > > rte_lpm_lookupx4(lpm, ipx4, hop, UINT16_MAX); > > if (depth != 1) { > > TEST_LPM_ASSERT(hop[0] == next_hop_add); > > @@ -850,7 +851,7 @@ test11(void) > > int32_t > > test12(void) > > { > > - __m128i ipx4; > > + xmm_t ipx4; > > uint16_t hop[4]; > > struct rte_lpm *lpm = NULL; > > uint32_t ip, i; > > @@ -872,7 +873,7 @@ test12(void) > > TEST_LPM_ASSERT((status == 0) && > > (next_hop_return == next_hop_add)); > > > > - ipx4 = _mm_set_epi32(ip, ip + 1, ip, ip - 1); > > + ipx4 = vect_set_epi32(ip, ip + 1, ip, ip - 1); > > rte_lpm_lookupx4(lpm, ipx4, hop, UINT16_MAX); > > TEST_LPM_ASSERT(hop[0] == UINT16_MAX); > > TEST_LPM_ASSERT(hop[1] == next_hop_add); > > @@ -1289,10 +1290,10 @@ perf_test(void) > > begin = rte_rdtsc(); > > for (j = 0; j < BATCH_SIZE; j += RTE_DIM(next_hops)) { > > unsigned k; > > - __m128i ipx4; > > + xmm_t ipx4; > > > > - ipx4 = _mm_loadu_si128((__m128i *)(ip_batch + j)); > > - ipx4 = *(__m128i *)(ip_batch + j); > > + ipx4 = vect_loadu_sil128((xmm_t *)(ip_batch + j)); > > + ipx4 = *(xmm_t *)(ip_batch + j); > > rte_lpm_lookupx4(lpm, ipx4, next_hops, UINT16_MAX); > > for (k = 0; k < RTE_DIM(next_hops); k++) > > if (unlikely(next_hops[k] == UINT16_MAX)) > > diff --git a/app/test/test_xmmt_ops.h b/app/test/test_xmmt_ops.h > > new file mode 100644 > > index 0000000..c055912 > > --- /dev/null > > +++ b/app/test/test_xmmt_ops.h > Why add this new file under app/test, which is only for test app? > Should vect_loadu_sil128/vect_set_epi32 be in each ARCH's rte_vect.h? > V1 was like that, I thought of moving the file under app/test because 1) all the ARCH can't have the implementation for vector primitives if architecture doesn't support it like ppc64 and tile so moving EAL may not be a good idea 2) scope of vector abstraction only for using the API(i.e test app), NOT for implementing the library. So its boils down to load/store/set should not be beyond that. and I am afraid that if we opening up EAL abstraction that will change the scope and which will have performance implication to use emulating the logic in library 3) It's been discussed, There was no disagreement on this http://dpdk.org/ml/archives/dev/2015-December/029404.html Thanks, Jerin [snip]