From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0069.outbound.protection.outlook.com [207.46.100.69]) by dpdk.org (Postfix) with ESMTP id E373412A8 for ; Thu, 3 Dec 2015 13:17:56 +0100 (CET) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@caviumnetworks.com; Received: from localhost.localdomain (122.166.132.183) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (TLS) id 15.1.331.20; Thu, 3 Dec 2015 12:17:50 +0000 Date: Thu, 3 Dec 2015 17:47:29 +0530 From: Jerin Jacob To: "Ananyev, Konstantin" Message-ID: <20151203121726.GA15808@localhost.localdomain> References: <1448995276-9599-1-git-send-email-jianbo.liu@linaro.org> <2275492.7Tn0tJ2v06@xps13> <20151202165302.GA2452@localhost.localdomain> <2257776.TI734NhvVv@xps13> <20151203093334.GA12727@localhost.localdomain> <2601191342CEEE43887BDE71AB97725836AD013F@irsmsx105.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <2601191342CEEE43887BDE71AB97725836AD013F@irsmsx105.ger.corp.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [122.166.132.183] X-ClientProxiedBy: BM1PR01CA0059.INDPRD01.PROD.OUTLOOK.COM (25.163.199.31) To BLUPR0701MB1714.namprd07.prod.outlook.com (25.163.85.140) X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 2:+l3IB53PHEvqv7+FA8L8h1/9PBk9AMJOyB43hRTm5F5zrKqDguD5JP7vKCF1eXbb5s0HZqCTmM6aaQlHQaXV6Ippw1FeiKZUUkbbVP1gqeZE31EvqyiSgg5j1rkjdHt9wgfdjk1EbJ581+X42Z8UMA==; 3:hAt+ybiKIUceHWQ+uHuQdub29mSGkU61qhxd3BR+mm9nNwnL41trgBrXT+K2WgUGolW52Rnvom/oaCrWp+6YNxQbQ1r94GQEvgBrIchG/iBnH61F4rFWoT/poifnridF; 25:mUFhxrsTf4sFmFIr5024+VbrUJHQQ+ngWK+JHuWs9y+JirXsyRyD43hJ2o/Z8RdaXAy11jc1jNVYFXn1oDOJFo/8SpzsrfpeUP6g6E2yxjyDoFgtY4jL3NyNqz1qoqVScizo7b9i+U17POSGm1cwc5CSOFU+5/3/D+uvMIIUXhZK82NI/aTlEhIMcLAcWUAmMMm7WDmOYrYkwF2kgCD3v2H0ZbJT5v+SL6T2nOY5f5MgftJBatDJhr45jBPxavs/lpiTZYnP62UTnfr0nFmWnQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 20:ginyFANrkr3liiy+j+Id/B1pqn4gaCDZ8UDzACIOqRrlApCHmV/2vDQszHlMaarKSwC4UryF+kHLfwBCEr+Z5o/WXnZirvwJyOtsfekRdkaMAAQ+3idUPym8z5JJUngFaeMrRlBxzGiKrL0x+qaqdVGCCSq4fkEb8S2tfpxHJjrIIk1VyFBJkamXTN1hbbwJd2Wfl5mc4u/oLTN3y+3cKtiGwVnhppfhTNyhEKXN/kl/hC0QjMGUWJuAp3USanzn4VFOZHJV85AuPod/i7ORD0JonT9eziqinLoUpEF8rCNjpnU1aQrulbIlz+NAafl8vSqed6gD78qqoWg8Ej2kzHbBDYaQ7fcGZfJh5mKVkFkW+Sa2tabbSsib38vzcu7z8WQ7GCHO6Uu9nu3pMcvpJ0R4yBNXrwaS3pjB4MA1a6PXbV8V8CK4f7LAj60FqL8RoSBnnGK87UyQP1BzxE3UpJjVqxvCrYo7HYE+PnqrIutBkRLXguagz0jh51domJlRuT6yB/SdUcW+DVeLtFYIt++n8tTVJwXDRSjVXwLNslf8xMvKSjuhVol+sKuitOpN/HfMT0IYWJrBCYWmX9NeVceLsC9w5Up1qlQaRfR0DHg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236414709691187); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(3002001)(10201501046); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:RZCSSwbHYogKSHVPQH37fHmYa+6R1MHpnGHUFTkA+je3n/zDJfo3I+DBQ9AS+Af179DshvFJfRQkcW764JC4izCPDHaQHT03l5BxGM7zKzh0kn9Y2pagoQQWisKUh5hRzz0AdbEFDZiG2lfJW55cerTwC+VsjLpRtd1PFUiZJnoarDnWhhBkbVpx13V/VuxzdtRZp39c2tF8FbTGOpRjcThY4hp8tN3u7eZAHyZY4AP+cN8AdRukcxkQO3nMskOZp83vLhttXsZchHeXpOt4UacddFiECeAMnusHp/f/zmUiQwXqiGjvoOya7H8z35tbgD4DPC5tW9c4Mzo2/eLPzCoh0CJmvXWWNl45PHoXYoeZhfrGv95h5oooYNx3YQYsL21236+Jmlqp6lRhTCy8S3K/ShiCZhxpZ3x2yrlzklrU1dKEoEj8OFF0tjzdHBkz X-Forefront-PRVS: 077929D941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(24454002)(13464003)(377454003)(377424004)(189002)(199003)(54356999)(93886004)(47776003)(101416001)(42186005)(5008740100001)(76176999)(189998001)(50466002)(66066001)(106356001)(46406003)(19580395003)(105586002)(19580405001)(110136002)(5001960100002)(81156007)(97736004)(4001350100001)(61506002)(92566002)(3846002)(97756001)(87976001)(83506001)(23726003)(50986999)(2950100001)(86362001)(77096005)(1076002)(6116002)(5004730100002)(1096002)(40100003)(586003)(122386002)(33656002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BLUPR0701MB1714; 23:gCLz1avZQJ7lQFvQ+s/gQW2VhESdDGC+oQSDjVb?= =?us-ascii?Q?ETp8ayYcMdvElvaOQIr5g6KqevcCmUtnqSfVilq/wCCh5E9z4xg5ZIZBc0tE?= =?us-ascii?Q?aEJllZpez+hBuCJg8m4LifHxPvmC94Cyb8QuXGgdv3DGKjuAaTB2mpCTD+Lt?= =?us-ascii?Q?/crcfhpG+5S1Eat50lkHzCUmoB4/EocQiVaSGAnD+/zHzvldY9ze0/s2so2l?= =?us-ascii?Q?I5TgFjyjQ2IPfpgspmDvIdNthxyi/lwf2VmDgw9XP9NDVObj3l9qJfWfBVun?= =?us-ascii?Q?CW/r/1c6chwE3XMb+Rr1HL7OmBjX7lR0gX9V0hY4t57LmbRAbjVJs1AY2TwN?= =?us-ascii?Q?at+kdKhIQRIFi7ee8aCl4nnzfkg6/slVmi5AowknA7M/w7WKCIvwxX4lmZ/o?= =?us-ascii?Q?Z4mux3uu1otwyblqPjj7dzxs4iJbfU/ux2GoT3KsX6oPn+vPA2KO11HmNmcu?= =?us-ascii?Q?xySFVkUxtddNgvpqOENt/QQv8hpBlCo5/MAycTdD08eQqmAh5evfN/4yNYT2?= =?us-ascii?Q?fBVUA3jFP19E4lhRGoHkEwZaxcNYrHw3bAcERlbqK51gszKUkUzfIF59+NbA?= =?us-ascii?Q?Eoj20uImmFvgP2Q7LiEjHlkn73HqN5wW6tQv7G6K9djTzBrPnEZiJ8VXM8xJ?= =?us-ascii?Q?950ZAOYHZgUC9c8bGAk0O53Hx9PBnhhdjjVrKwVexRArLi/nVWQkr1/RBKes?= =?us-ascii?Q?jrRRmUx+9+oMDr5A3hzlxEx33AsgSFbSYsb8SOts3D/qJD5wQK8B4y/8242j?= =?us-ascii?Q?JBYgFkOEQskHMo7BF1FxIW9nGG5paHM+wLr/Ez2hrG9J/dDSRo67SvwO7hvL?= =?us-ascii?Q?rgJO9lsB2+wZFAp9fYysPb+JALy86l7pDzPa0J0hJuGE7cq5zlnncysyp/M8?= =?us-ascii?Q?dTWbRuuRmYxym11rWe7jOFEMbBlwgT6dBUPJ9/bWplpgUwkC9DTCKmbkXfKx?= =?us-ascii?Q?bTlR4JLmd62W8QFZGT5RlrrZItVLrmicjt8Zoq5TS1z6NTsYt+mGtZ88A4c1?= =?us-ascii?Q?F2Yp6j2SysV/fxu4MaO6ehSv1nBkosEbSJbaU0CNJyeO6xAUIHRaZu8fKfJ4?= =?us-ascii?Q?Oq+zC8/Qe+6w09wiqr1XpPFmBvfPAHcjkrtKJzyrE2ai86dHt62lJBS/jiCx?= =?us-ascii?Q?dLlQr+VaeyHMtLbvjP6YIv4KpmPf+04LgxoOQ2WGMDQ2CFXAInxIe3C33vyF?= =?us-ascii?Q?lgmW81rG53fxqaxP18bYlkoduVolE+2mQU0RJ?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 5:uGUSYMk4xU+ts0a07Dl3SVNkzHqpiCTA6j9EU32zjYuZN+bJLenh1vPaLK+wDnCFfhen4G2J6GoedHlJ7tSBNprj4rhiNuxDJpnLp08XrFEYp5xbrEb0+ftmo/Dd9mIePWR0t8p7sHKZSlYnHWVgyA==; 24:sVRG2HtleAy7hJvGtcZ7TlEJ1DQpZudy2OG2dbKIkpvZiTHlt8CVGW3jSF10UJp1pCgd9o5TMLy9fulgAJfAMB91SOAcJPgMewyBMl7A5Ww= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2015 12:17:50.7867 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 3/4] eal/arm: Enable lpm/table/pipeline libs 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: Thu, 03 Dec 2015 12:17:58 -0000 On Thu, Dec 03, 2015 at 11:02:07AM +0000, Ananyev, Konstantin wrote: Hi Konstantin, > Hi Jerin, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jerin Jacob > > Sent: Thursday, December 03, 2015 9:34 AM > > To: Thomas Monjalon > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH 3/4] eal/arm: Enable lpm/table/pipeline libs > > > > On Wed, Dec 02, 2015 at 05:57:10PM +0100, Thomas Monjalon wrote: > > > 2015-12-02 22:23, Jerin Jacob: > > > > On Wed, Dec 02, 2015 at 05:40:13PM +0100, Thomas Monjalon wrote: > > > > > 2015-12-02 20:04, Jerin Jacob: > > > > > > On Wed, Dec 02, 2015 at 09:13:51PM +0800, Jianbo Liu wrote: > > > > > > > On 2 December 2015 at 18:39, Jerin Jacob wrote: > > > > > > > > AND they include "rte_lpm.h"(it internally includes rte_vect.h) > > > > > > > > that lead to multiple definition and its not good. > > > > > > > > > > > > > > > But you will have similar issue since "typedef int32x4_t __m128i" > > > > > > > appears in both your patch and this header file. > > > > > > > > > > > > I just tested it, it won't break, back to back "typedef int32x4_t __m128i" > > > > > > is fine(unlike inline function). > > > > > > > > > > > > my intention to keep __m128i "as is" because changing the __m128i to rte_??? > > > > > > something would break the ABI. > > > > > > > > > > Isn't it already broken in 2.2? > > > > > > > > Does it mean, You would like to have rte_128i(or similar) kind of > > > > abstraction to represent 128bit SIMD variable in DPDK? > > > > > > If you are convinced that it is the best way to write a generic code, yes. > > > > I grep-ed through DPDK API list to see the dependency with SIMD in API > > definition.I see only rte_lpm_lookupx4 API has SIMD dependency in API > > definition. > > > > I believe that's the root cause of the problem. IMO, The > > better way to fix this would be to remove __m128i from API and have more > > general representation to remove the architecture dependency from API > > > > something like this, > > > > rte_lpm_lookupx4(const struct rte_lpm *lpm, uint32_t *ip, uint16_t > > hop[4], uint16_t defv) > > > > instead of > > > > rte_lpm_lookupx4(const struct rte_lpm *lpm, __m128i ip, uint16_t > > hop[4], uint16_t defv) > > The idea for that function was that rte_lpm_lookupx4() accepts 4 IPv4 addresses that are: > 1. already in 128bit register > 2. 'prepared' - byte swap is already done for them if needed. > > About ways to fix __m128i dependency: as I can see x86 and arm DPDK code > already has xmm_t typedef: > > $ find lib -type f | xargs grep xmm_t | grep typedef > lib/librte_eal/common/include/arch/x86/rte_vect.h:typedef __m128i xmm_t; > lib/librte_eal/common/include/arch/arm/rte_vect.h:typedef int32x4_t xmm_t; > > Why not to change rte_lpm_lookupx4() to accept xmm_t as input parameter. > As I understand it would solve the problem, and wouldn't introduce any API/ABI breakage, right? Yes, If we have API/ABI breakage concerns. IMO, Now this would call for some kind of rte_vect_* abstraction load, store, set kind of SIMD operation on xmm_t in common test code to aviod #ifdef's in app/test/test_lpm.c I guess we may not need those abstractions in lib/librte_eal/common/include/arch/ directory. keeping in app/test/xmmt_ops.h should be enough, right? > > Konstantin > > > > > Now I am not sure why this API was created like this, from l3fwd.c > > example, it looks to accommodate the IPV4 byte swap[1]. If it's true, > > maybe we can have eal byte swap abstraction for optimized byte swap on > > memory for 4 IP address in one shot > > > > or > > > > Have rte_lpm_lookupx4 take an argument for byte swap or not ? > > > > or > > > > something similar? > > > > Thoughts ? > > > > [1] > > const __m128i bswap_mask = _mm_set_epi8(12, 13, 14, 15, 8, 9, 10, 11, > > 4, 5, 6, 7, 0, 1, 2, 3); > > /* Byte swap 4 IPV4 addresses. */ > > dip = _mm_shuffle_epi8(dip, bswap_mask); > > > > Jerin > > > > > I think the most important question is to know what is the best solution > > > for performance and maintainability. The API/ABI questions will be considered > > > after. > > > > > > Thanks for your involvement guys.