From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0072.outbound.protection.outlook.com [157.55.234.72]) by dpdk.org (Postfix) with ESMTP id A2CAA8D28 for ; Wed, 10 Feb 2016 04:47:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ezchip.onmicrosoft.com; s=selector1-ezchip-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PQeZ7f9fCbJMdq39OKpnXVHY7yy+XPpmkoGUlGjlXKA=; b=m7LVNImTa+/4nx0U7TPjpp4zuBz7eE6pgqPUSC+xMth0IavWFs5j8Ysi9BR2YByWrkRGNkzslFqUm0Au2NHyw0IuyQJ50dKuADtCS6zKVL9H8oRMYvSzD0cMSyxm9O1TOBUo9LBSYSNBekjrP8KRFMZPZdvCMJpQalyFnkNmYF4= Received: from AMSPR02CA0023.eurprd02.prod.outlook.com (10.242.225.151) by DB5PR02MB1015.eurprd02.prod.outlook.com (10.162.162.21) with Microsoft SMTP Server (TLS) id 15.1.403.16; Wed, 10 Feb 2016 03:47:23 +0000 Received: from DB3FFO11FD020.protection.gbl (2a01:111:f400:7e04::152) by AMSPR02CA0023.outlook.office365.com (2a01:111:e400:8028::23) with Microsoft SMTP Server (TLS) id 15.1.403.16 via Frontend Transport; Wed, 10 Feb 2016 03:47:24 +0000 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none;ezchip.com; dmarc=none action=none header.from=ezchip.com; Received-SPF: Fail (protection.outlook.com: domain of ezchip.com does not designate 12.216.194.146 as permitted sender) receiver=protection.outlook.com; client-ip=12.216.194.146; helo=lab-14.internal.tilera.com; Received: from lab-14.internal.tilera.com (12.216.194.146) by DB3FFO11FD020.mail.protection.outlook.com (10.47.217.51) with Microsoft SMTP Server (TLS) id 15.1.409.7 via Frontend Transport; Wed, 10 Feb 2016 03:47:23 +0000 Received: (from lsun@localhost) by lab-14.internal.tilera.com (8.14.7/8.14.7/Submit) id u1A3lMEw005516; Tue, 9 Feb 2016 22:47:22 -0500 From: Liming Sun To: Date: Tue, 9 Feb 2016 22:46:59 -0500 Message-ID: <1455076020-5457-1-git-send-email-lsun@ezchip.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1452263948-22485-1-git-send-email-lsun@ezchip.com> References: <1452263948-22485-1-git-send-email-lsun@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD020; 1:RraCq3qZJ7IwEu4/ePAVPfpmeT3EszUAooWGZeJHmWbGJ6IPNa7U2WEFQkW8E3P88cyqMuZwX26hAbBMW3haIVfYyZ6sju10hX7STS4iSTBGn97W+H8lr+GnJzPgEJPNjkSLBIUqUqD4eLLuAtTD+dI+7frveGvU53cUoNDuCVdnFNQHaSSA1PNBdg1Zeh5HO3keT8TUfnCboH2eA8wHld8y1x1Quqva3i30wEGeA383Y9dDuGDbUrhL4MySVlIkay6RUQGkh7gkC4FHjICfGAyP6uF9sgj/QT7jfhyU4FdldW8YWdm712RIJx5XuXBt8cebH5xKwcuOmIzH64W6ZNBpY5hGTpwREjdvbcifjFwaqWpSsrkVfoAQbUQtlvXx1YSjdOTZ9vEtwlZrdtq8TdDYdOXG1atzRosjMRgl2azD/eHlANG0wIC9AiBAlQ5824vPFx0+4SJ3eEO3WxTjwJeTUljkQd91xXoQO7RmMrFgtKu/Dn+0Okws2/i1EMAwzxIhRjNCoR8AgJUgki/UAQ== X-Forefront-Antispam-Report: CIP:12.216.194.146; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(104016004)(36756003)(5003940100001)(92566002)(50466002)(2950100001)(6806005)(106466001)(105606002)(5008740100001)(5001970100001)(107886002)(50986999)(76176999)(110136002)(87936001)(189998001)(47776003)(19580405001)(4001430100002)(33646002)(42186005)(586003)(2351001)(86362001)(50226001)(1220700001)(48376002)(1096002)(229853001)(4326007)(85426001)(2906002)(19580395003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR02MB1015; H:lab-14.internal.tilera.com; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1; DB5PR02MB1015; 2:1OT/ENI4+5ogIqPoBivuEYa2fC47o8TMTy8Rr1suaN17xj7Rgwjkxj8/Y6fnM8NJlMgPiQ8NjOYxJ7eqvi87MCcFmPRHXaqQ7PcEb8EToWBz/qI9u2GRJ2Foeqm+1zNwtrjIW/sh8iT5ElJB8qPV9A==; 3:ku0YTrs0oATsKvZgdBeEHQerr3hDqA90hJM9yHI9VZRGy4r5e7ms8MIkm/dVi4WMyPOXKe5fOJrJxlx+lpTYiluiUvb+RPL0MYbta7S6dEaYpK0ZvD+WEM/C+kmAkZK5RdqD3FHWIPkEbnZ5M9P/Y+UoAhC34m5JKMrY+3DX8qiKdeML6yeZgH2XhgT9rjY/7wDqZSewTj+tz+qx75E5y0/shtkEKZk+psOGbd71Ntg=; 25:2ZzmvHXb74PAPNRVPPXP64/vvV27PDbDCO8MWMHzXMiPlkTbfsALJlH8CnrmhSQV9D9Y+iiGxZHoKN0+NmcxD+ukQj3xURzmZuskEhS5B+WX2Br8I/GX0+8EX/R2V/hO739P62lA0LFMRiS90OoHHsFXPYiTBHO+g71DLdVqJ+tqb1//oSYwP3IgJ4D7h3b9YrGsl5EAU9iZgYYjnaUa6jJQ5ZhucIjQXGhxxAChkE25UVEcV9sSstm0WO6UiaWjswwfdU1Lfjco07C4aWm5htNQ5A9edwcGfMSGjVAtb4H/FL6h6ynWe8Z2H813MVoL; 20:jcty56cNQcZPFvhYp7RCgK3GczjmZJ4UjzqarNAJ5dpTvp6HZTGXxjJqXxTCpekEq3kbQWJDyfW11uIfQ8T7XinSFUE9oznB/5qtjlXeLijjPrBvJBYnRvj2GiX3emy/puikj21x8q+O9PjPoIa2w0KI4z/PY6dw5ofk0kY1Kyg= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB1015; X-MS-Office365-Filtering-Correlation-Id: 181b4949-4ddc-4286-e551-08d331cce2e8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13018025)(13023025)(5005006)(8121501046)(13015025)(13017025)(10201501046)(3002001); SRVR:DB5PR02MB1015; BCL:0; PCL:0; RULEID:; SRVR:DB5PR02MB1015; X-Microsoft-Exchange-Diagnostics: 1; DB5PR02MB1015; 4:XlTR5YF8RlGrdIqLItI0bpCJSj754eJKEEwhrIn0gqYIvFi1E6xtKv9cxoSiSHNQcUPhAN8cMIYZEGOEpZecIEI4azjOPINuusXED3vX0pVh+cEusuAtMf2na07ZiIvjOnaWpEOT4FZfETjt/2F04R1gZZMiaZXIIH5TsQCpK7utTFbxPNj5+SoddFoNKxVTtI+usO8J0+KX6NW5NrzZXAAYYR7cVT4t1YdxN22h9tYuR3YTgGBAP8gYbY5gJ/9bD9Cnr9jb9sUwgGrdEks4qv9Ys6zTkPC8fWsiB3ArrH8LJzvnpEL2BVVo6SfqbEXxIr3fa5loI3ex1pL+pw01NDX5mSllabM0NyNhXk3Xca5HYwC2BQFIHQagYs/I/QTnCwuqeJCu+uJHJuI2ogG0j9x+1hB1VcfcUBsAdDQSWXuNnUkBYyB7IOxKAhq4a1/hTrUS68y24Znz9jLFxuVe/w== X-Forefront-PRVS: 0848C1A6AA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB5PR02MB1015; 23:L3/dhyXiHeCwzrz8TaC5RnfT4RlDUJ8Pzn9dIYaYY?= =?us-ascii?Q?RyNOQvHpODSSUrqR9ntKQb0QnsnCxttyB1B6uMgVCr+5zDBLE2rHOO2I/gfR?= =?us-ascii?Q?eTbB09UxAHMrbK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1OvmTVk?= =?us-ascii?Q?Udfw0Y5ObK+cCsPF3JJK4oeqNO2Hs1ob1ZWYDhRfbUNvzOMvRyYaeeIeLSoL?= =?us-ascii?Q?U1yiwByLCx5QbLtVQzwy3h6eCj5?= X-Microsoft-Exchange-Diagnostics: 1; DB5PR02MB1015; 5:vUUh5dQyZzxVEnn4yytBrVSTauJrJVZYRBcr5HpWZe1jWy0nAMaJ8RqSMPuuTy4eQjFPc2aOPf3LMeJsKS1UxpuryAy2so/IzjIw6LMBXOl7te1GhViudeCLBfA70iaV94tZlwfrGh0RBHl6tCtnYQ==; 24:vbOzEpTmKx24aZhgPaNkOAMI9DkAl7tY4COHLOireuxZDBPX2RuVgQXcd2nTdcBiWIsH96aoCIMrx52uZfWS1AIzEnBLtf2V3nLJjEEfkeQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2016 03:47:23.5317 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3; Ip=[12.216.194.146]; Helo=[lab-14.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB1015 Subject: [dpdk-dev] [PATCH v3 1/2] eal/tile: add rte_vect.h and enable CONFIG_RTE_LIBRTE_LPM 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: Wed, 10 Feb 2016 03:47:25 -0000 rte_vect.h was missing earlier thus LPM was disabled and l3fwd is not able to compile. This commit implements the vector api and enable LPM in the tilegx configuration by default. Signed-off-by: Liming Sun Acked-by: Zhigang Lu --- config/defconfig_tile-tilegx-linuxapp-gcc | 2 +- lib/librte_eal/common/include/arch/tile/rte_vect.h | 93 ++++++++++++++++++++++ 2 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 lib/librte_eal/common/include/arch/tile/rte_vect.h diff --git a/config/defconfig_tile-tilegx-linuxapp-gcc b/config/defconfig_tile-tilegx-linuxapp-gcc index fb61bcd..39794f6 100644 --- a/config/defconfig_tile-tilegx-linuxapp-gcc +++ b/config/defconfig_tile-tilegx-linuxapp-gcc @@ -64,7 +64,7 @@ CONFIG_RTE_LIBRTE_ENIC_PMD=n # This following libraries are not available on the tile architecture. # So they're turned off. -CONFIG_RTE_LIBRTE_LPM=n +CONFIG_RTE_LIBRTE_LPM=y CONFIG_RTE_LIBRTE_ACL=n CONFIG_RTE_LIBRTE_SCHED=n CONFIG_RTE_LIBRTE_PORT=n diff --git a/lib/librte_eal/common/include/arch/tile/rte_vect.h b/lib/librte_eal/common/include/arch/tile/rte_vect.h new file mode 100644 index 0000000..9afee70 --- /dev/null +++ b/lib/librte_eal/common/include/arch/tile/rte_vect.h @@ -0,0 +1,93 @@ +/* + * BSD LICENSE + * + * Copyright (C) EZchip Semiconductor Ltd. 2016. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of EZchip Semiconductor nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef _RTE_VECT_H_ +#define _RTE_VECT_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef __int128 __m128i; + +#define XMM_SIZE sizeof(__m128i) +#define XMM_MASK (XMM_SIZE - 1) + +typedef union rte_xmm { + __m128i x; + uint32_t u32[XMM_SIZE / sizeof(uint32_t)]; + uint64_t u64[XMM_SIZE / sizeof(uint64_t)]; +} rte_xmm_t; + +/* Extracts the low order 64-bit integer. */ +#define _mm_cvtsi128_si64(a) ((rte_xmm_t*)&a)->u64[0] + +/* Sets the 2 signed 64-bit integer values. */ +#define _mm_set_epi64x(i1, i0) ({ \ + rte_xmm_t m; \ + m.u64[0] = i0; \ + m.u64[1] = i1; \ + (m.x); \ +}) + +/* Sets the 4 signed 32-bit integer values. */ +#define _mm_set_epi32(i3, i2, i1, i0) ({ \ + rte_xmm_t m; \ + m.u32[0] = i0; \ + m.u32[1] = i1; \ + m.u32[2] = i2; \ + m.u32[3] = i3; \ + (m.x); \ +}) + +/* Shifts right the 4 32-bit integers by count bits with zeros. */ +#define _mm_srli_epi32(v, cnt) ({ \ + rte_xmm_t m; \ + m.u64[0] = __insn_v4shru(((rte_xmm_t*)&(v))->u64[0], cnt); \ + m.u64[1] = __insn_v4shru(((rte_xmm_t*)&(v))->u64[1], cnt); \ + (m.x); \ +}) + +/* Shifts the 128-bit value in a right by imm bytes. */ +#define _mm_srli_si128(v, imm) ((v) >> (imm * sizeof(uint8_t))) + +/* Bitwise AND of the 128-bit value in a and the 128-bit value in b. */ +#define _mm_and_si128(a, b) ((a) & (b)) + +/* Loads 128-bit value. */ +#define _mm_loadu_si128(p) (*(p)) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_VECT_H_ */ -- 1.8.3.1