From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <Jerin.Jacob@caviumnetworks.com>
Received: from na01-bn1-obe.outbound.protection.outlook.com
 (mail-bn1on0076.outbound.protection.outlook.com [157.56.110.76])
 by dpdk.org (Postfix) with ESMTP id 5B8F25683
 for <dev@dpdk.org>; Thu,  3 Dec 2015 10:34:02 +0100 (CET)
Authentication-Results: spf=none (sender IP is )
 smtp.mailfrom=Jerin.Jacob@caviumnetworks.com; 
Received: from localhost.localdomain (122.166.132.183) by
 BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) with Microsoft SMTP
 Server (TLS) id 15.1.337.19; Thu, 3 Dec 2015 09:33:58 +0000
Date: Thu, 3 Dec 2015 15:03:37 +0530
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Message-ID: <20151203093334.GA12727@localhost.localdomain>
References: <1448995276-9599-1-git-send-email-jianbo.liu@linaro.org>
 <2275492.7Tn0tJ2v06@xps13>
 <20151202165302.GA2452@localhost.localdomain>
 <2257776.TI734NhvVv@xps13>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <2257776.TI734NhvVv@xps13>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Originating-IP: [122.166.132.183]
X-ClientProxiedBy: MAXPR01CA0067.INDPRD01.PROD.OUTLOOK.COM (25.164.146.167) To
 BN3PR0701MB1717.namprd07.prod.outlook.com (25.163.39.16)
X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717;
 2:fZ018n5/pNjW7a3tZr3znzTBf7PQYV3LF35x6pBZTewQ5P0OeKhDUV3xO1XQFlOOBrj80Xiw44TdCbtWO/AAR21UfgfCgruksOe1xpYcO3IfCB8pIpPG6SxjUhKjD0VeLBgjHwOrYkok6VBclaNdcQ==;
 3:Wd29mtjQZS1OZjEeVKAJIbnorIUS4hSF73B+7rPsoBeYuXJ1fpGq8noIZOFLZtOko11/vea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-Antispam-PRVS: <BN3PR0701MB17170350B5B8DC27E30F35B68C0D0@BN3PR0701MB1717.namprd07.prod.outlook.com>
X-Exchange-Antispam-Report-Test: UriScan:(236414709691187);
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
 RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001);
 SRVR:BN3PR0701MB1717; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1717; 
X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717;
 4:TMnBhZ7j4F8R77sR1iR307BKZLh5qKL0v1eulsZlOEw0ZFBXWdyfr5p06YtFDy/Yir3DSNIrHBvquxCevE+JKYmXcswGlseZRkAXALM/EvDMdw2Dg49ynKg8idvcu5R6ah9JwTohsm5GyyZInJ+eTpa0air6j7fJx4bGnV6x6Gviq+Ae/VHgmbldsamj2eMr30BxUwWv2qIijQNgYYp1CFsTZTJsaJYMnFddaCBS0kh3ccLJx0GDIUL4vchQYLp+R0HaXj5P91rP2q5q7svF5TQ7ADnGPrOMwlyIiFr49Y1V+bb1F/jm8W5ec13sCvFh3AFNQAVuk4/5dhmk8x25N0eE6GseUehfgnBzeTe9yNP444Q0s2UAfCQOF+o18dVsK0rjHwquLb/6oZEr6eMUKrry1RkNefd5BF1whZy1tWADxQih7k6VN9cjJOZwJb0W
X-Forefront-PRVS: 077929D941
X-Forefront-Antispam-Report: SFV:NSPM;
 SFS:(10009020)(6009001)(6069001)(24454002)(189002)(199003)(377424004)(1096002)(23726003)(42186005)(586003)(50466002)(1076002)(106356001)(189998001)(105586002)(110136002)(6116002)(5001960100002)(54356999)(3846002)(77096005)(5004730100002)(93886004)(33656002)(101416001)(122386002)(40100003)(97756001)(76176999)(5008740100001)(61506002)(46406003)(19580395003)(86362001)(50986999)(2950100001)(66066001)(19580405001)(92566002)(97736004)(81156007)(4001350100001)(87976001)(47776003)(83506001);
 DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1717; 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; BN3PR0701MB1717;
 23:vsXUb2MzOeB5FLbvjHQKks4oaJSMstLtM2JkYjU?=
 =?us-ascii?Q?GIv3aekFRqpEDMI3BVg4MoTK4QHbUkniIJe93+RBwH2msVCTdfulMne1Q7Rq?=
 =?us-ascii?Q?dLLwYVv/QCELKOkgfNG2GD2rvUJqA/2Fc2YACngLPgjsysDSkLYYYp5Cw+VE?=
 =?us-ascii?Q?7xD0cEZk2r6oxmQ4QyTtPlsB2jcBb74NP7koGXOk7ycvPGQKt4EWYRWVstNJ?=
 =?us-ascii?Q?OaQWea45i466Nr6Fswemxlil48Iv1rOqSCfmWmEh55w5EvqU6kRY3XJnRhxS?=
 =?us-ascii?Q?E3an/bl4ZMVBP/BArH+IbKAnKzyBE+tOHDAA+EAKtylmIf1Taw2eGUBO/w6Q?=
 =?us-ascii?Q?R5RWdBIy1QZ2Cv3AW+LVWwHwKZX4PtCdwuljMx2U51RTvp5AiPSmDxuEQpVa?=
 =?us-ascii?Q?J6KIz7efx1rS89sJjxQK7sBUxgsLTyL5RrD324Y4gHL574E2anTLKYUEEznf?=
 =?us-ascii?Q?r9FcyQ4TQyw1p9xqqtpBMWNMIB95Iyyum0oQzENKafFOvf+MF19HZUE0fFEI?=
 =?us-ascii?Q?9KrZUtIR7jZtGTSz24tDEJ8U80RgfDAfpZcFA4qIJqmmGS6JoNs5p8ewkCGp?=
 =?us-ascii?Q?10bvAufKOeOKVmop9KE8v4R9na6CZ965Wabk9HVnbXR1SStsBOx+mbruKkfm?=
 =?us-ascii?Q?dMiqcGYIv3cofe5gtA9j+KnuaHPZhoj+HjDTjIo+RFiKCFIEgI6ng91NVbbz?=
 =?us-ascii?Q?fZAC2gM1tn2rLlGnfZmivrWpEesSfYazQYsBu3X1W/n2p6+g7U0gBrvkZ9OA?=
 =?us-ascii?Q?Uxlv8vxjEpB+7iArC4hewGfaKvChM+NY+LICjFRsFwklQfbf6ikNIFeuIFwL?=
 =?us-ascii?Q?HlhP5vyi7b/GJCRP2cfj8PruJUnPzjwF7kmoZ8RpJFr6q3r8fSQf9forkx0o?=
 =?us-ascii?Q?eefMMFcjvDymR+C3Yqgwg9anD5q3glkqN0oUSJ7faLQb3UWr+xqK6j+/xc/1?=
 =?us-ascii?Q?vzm0+HHNT3iU45WQJn6pYZOd7IIzSn0EXDERGoa6a18sSSWbG3FSN47wlpan?=
 =?us-ascii?Q?J2X9q9VIdH+lgfZxJry8P6M5Q7nNRpZM19uN4zKUDdGRnF13kPIZ6M+wIsAt?=
 =?us-ascii?Q?FZpR1C6K5r4/FAnqS+m/4XNQAaAr2l4twUKoCLPSnAfjPQS4Bp17qleXx0Qs?=
 =?us-ascii?Q?JYMJdIeFpiaLegObFJ1j5MQIQkIeX6sryvoXg1o0nL9LL+FVcYtQqBw=3D?=
 =?us-ascii?Q?=3D?=
X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717;
 5:q1disAWOupnxuiBegUnTO6NPSrRbcxc6S0jjK17ycSX75Se4Nh6CDti3rLUrsB2sJNJwPEn+JUbC+svmYETglGdId4OEIBGXaW8p8CLRncO6jW1XUibrg/6jT67ZjDLbNTcGdluBOPwKTVaKnsEbAw==;
 24:Uu6AB2msppnxpsOp3iYgfDnDBS9/2yetApyXsgh1JyO2P1NWrrFgWRnNlLo/PIAYUg4d6M6XbT2soS0M062AL6Q6CB/szLeslbN/k4/pYVg=
SpamDiagnosticOutput: 1:23
SpamDiagnosticMetadata: NSPM
X-OriginatorOrg: caviumnetworks.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2015 09:33:58.7370 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717
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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 03 Dec 2015 09:34:02 -0000

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 <jerin.jacob@caviumnetworks.com> 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)

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.