From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v4 1/2] eal/tile: add rte_vect.h and enable CONFIG_RTE_LIBRTE_LPM Date: Tue, 08 Mar 2016 20:59:06 +0100 Message-ID: <1561679.Mbe3omy2mz@xps13> References: <1452263948-22485-1-git-send-email-lsun@ezchip.com> <1455077070-6666-1-git-send-email-lsun@ezchip.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Liming Sun Return-path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id BEBD83B5 for ; Tue, 8 Mar 2016 21:00:49 +0100 (CET) Received: by mail-wm0-f45.google.com with SMTP id l68so148151346wml.0 for ; Tue, 08 Mar 2016 12:00:49 -0800 (PST) In-Reply-To: <1455077070-6666-1-git-send-email-lsun@ezchip.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-02-09 23:04, Liming Sun: > 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 [...] > # 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 You just have to remove the disabling line. > +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; Why do you mimic SSE? > +/* 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); \ > +}) Please check the work in progress to have arch-specific implementation of rte_lpm_lookupx4(): http://dpdk.org/dev/patchwork/patch/10478/