From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0061.outbound.protection.outlook.com [104.47.40.61]) by dpdk.org (Postfix) with ESMTP id 86943FA5F for ; Mon, 16 Jan 2017 05:26:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Z94AMApllA1AACyyQ6XX/zBgrJ4EKtyt1n/DpmuUSg4=; b=axFwxCd+Gyy89+OM7YwtGZtj2MntxHb0sVc989Pr3ZHFwjvY7dAOFD0b2VRHZeyyE9oIoKghcp+SbqP09hq+ZJpKHx3txHCdFOMqeNDxEsP/LhmRzylhY8X3rQM9BMFSRsoY7Jl2fSJpVf3zNOWG5Y6fXAWhIpz0aRaRB63ioko= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain (122.171.223.66) by BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Mon, 16 Jan 2017 04:26:09 +0000 Date: Mon, 16 Jan 2017 09:55:48 +0530 From: Jerin Jacob To: Pablo de Lara CC: , Byron Marohn , Saikrishna Edupuganti Message-ID: <20170116042547.GA6781@localhost.localdomain> References: <1484259360-198276-1-git-send-email-pablo.de.lara.guarch@intel.com> <1484481875-126335-1-git-send-email-pablo.de.lara.guarch@intel.com> <1484481875-126335-2-git-send-email-pablo.de.lara.guarch@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1484481875-126335-2-git-send-email-pablo.de.lara.guarch@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [122.171.223.66] X-ClientProxiedBy: MAXPR01CA0005.INDPRD01.PROD.OUTLOOK.COM (10.164.147.12) To BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) X-MS-Office365-Filtering-Correlation-Id: 7b72d720-9463-433d-8703-08d43dc7ccf8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 3:fPQuI9LcvuDO24OOodO/Df4An/y6oKdOqcaXOxOh41YduacCFinf4T498YffIkmBPw8pwWDtoY3eSTVtKHAlOEpoM0NV34COI5bICavErNTaqB9wFHZhNcudms3sCAHYZxCTZnGFlMc48RZNapGqcJBq748cmt0ID9VAlbL7MizzP8/qJn5DiWetqcVBNRMxrvNM1sOaFcQeW5iIMdKVZO/P4XJB6vUVuq/dN0Odkx15I7/XejPTOYe33NVuFrs3iKVlhxBBU7hKFItaQYzdog== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 25:ah2Nt9fVuPgU3zowCHTDvgCh2eiXrEUE26KmtQgSw+v/1DLUVd9aIeERTfFpihI549Os4TsUa9vXFOxMGmYBASdR/klF7MyOhZx3xBrDNB8rws/4ozaH6inCWLtOKZC0z4e++0Pgrp0HmxeAPKSSBK7gdqUS/UZhNQmyOmYjKgJhFGrpAcht6tueo9dvwoqFYc3fYfz/IeFtuUI8mDTybdy6pyOtwkQumvwoeIJW/8+WowiC1qo//DTr3eo47osXvxRd/Emol8jPr1d7a/yqUVoTLnmXrYiD+pQLl6QZsIUsVmRf4fEWlB5eqkprByK0T2DloesJzxgVe7IEvll9yWjgAbcDA+9i93+CTHSMpDmV96danni7twY3XsPi/omvnsCpQ+/16rpHlulrk45MoT5H4vl+XtBCv0NVi2s/1ltp/Dgwx1HeVtBhRrHWOV5VHiHnqzWHhwNphpFCTP8nmo7Pk7LL2PYqznLJu09eoxkQtEnlqkDqYS55Aum21tAEWgqukQsxejLp6kjtk1DizpPgU0Zo0K5kIfrOh19gwHg3dX/H6OYI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yXU/5ZfmsLjh0+IfNZljXVToype+NGS23bNlAlKmhi5S87WU4vQ1sv0flT9vziHMLCx8tofzSHyxejS5g6t0Ocgx84JOzVcaPVv5/FcI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:BN3PR0701MB1717; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 4:phhnXu7rCveilhHSA57EcHzVxhNZ3E8KfMb3ZlyBMTg1BESow2uoV+A3UqlOqO360krjl3FaH/N7PMSGdc9rFUVTrf/6wY/hyK6nLSyXOnVmMBzE501MKfN85oMFKbd8TCV4C/GSNWiKTW5hzZz1vfNeAnIGVvPSazmbUE8toqSCO4vs+Qeu2lRqFRHDHoPFAeZyfS7Y3ca7EWVztiy0ucbQeDe7vgoyoBrR1Gv0eZqeUeYgQ7DaXUD8pRg7hdti8N0B9z5A/Y9epiyTjdCN8ur+xdLLEoUBN4mJP5Mrc6ZnL3AT1RmHGVrsTMpiYBnL0iCF/qUHTr4uzD7RwUK3TC/oumsJ3N74UgpN+TxyZSiuLzo3XtDuuxihm5Ah9/6K7dcIWUvtZlsxgIs/NzKNwwLE2dqQt2uVKgj5VBVzOvC/NCZlMaSULou498RtHAK11bWGOG5c/Rg2Vs9RQpu7uG7O6bzTDWMfHL7I5LAraBZ2UkCuRF3oybEfq3Ilh7T6G56HAJ3jTxQUNYMSaz+9OkDYxBiji61d/jeHAx7x1S9Xd2H7Pd9fVp5yUtu1e3MsuyM0gFwgFomWq1ZDj/GBDl9LH1NKsVvRoKV0L4YKgoWoPdD0YLzT+swQ/ewRtBeU X-Forefront-PRVS: 01894AD3B8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(189002)(199003)(24454002)(25786008)(110136003)(5660300001)(4001350100001)(97736004)(305945005)(27001)(61506002)(68736007)(55016002)(92566002)(54906002)(42882006)(83506001)(42186005)(6916009)(4326007)(106356001)(105586002)(47776003)(81156014)(2950100002)(229853002)(54356999)(9686003)(6506006)(6666003)(38730400001)(33656002)(81166006)(50986999)(76176999)(101416001)(97756001)(66066001)(1076002)(7736002)(6116002)(23726003)(8676002)(50466002)(2906002)(3846002)(46406003)(189998001)(18370500001); 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: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1717; 23:xo97u64GjZu5uLoPryZLclYY/O13HL4dF801oKn?= =?us-ascii?Q?sr+oAm68h9wKSfg/I4ZVdMjCcBGxAk2/R53AwbPiHbkpM319D0aTkaE7qVv3?= =?us-ascii?Q?zk5UQVq2Ap/4mugnopIMUBVXw1O3ogIsIsRcVzNsd4XSjf7k1U2X+FR2ic71?= =?us-ascii?Q?fnJgEkdUfQMGrpdT/t5gvd2xhfKNf1NpAwpZ53dVwhKvy4qVZrnkxN9qSF7Q?= =?us-ascii?Q?yj5ZkWrN+Kyvtdbb9KaE6uXbQcD8phN+gOwhaZuOccQ8G1xD1SSdmtdlMUxk?= =?us-ascii?Q?IiGtjjd3VGY2xWstSoblUcplmn21t1m2KPYJR9o2qq/etYciBA2foVhhc41d?= =?us-ascii?Q?OkmZ+t4o0d/MiSr4Izkjz/FwABO5B1lg0Pjw/Dlc3RCXj4X9OGwXbNDTPQVG?= =?us-ascii?Q?FtFa21L/ABA4rf4dVCB3SULX1dsVWETj2F0/HbiWkjw3HBLG7sdkBzhDL5cL?= =?us-ascii?Q?a/Ja4j6kUEP73+H4QRo4Mc5IlQ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P4MycaehZIEE8p/NLaLewsBju+hb3WMVrEvoTGDIT8S0c1qNEp8hWIxFEmnCTxv/FkiomNPrf/SkpAtnTQgr5xE5ZwE8LCa1C7vp2tfojsmaXBUBPgM8kZfCwFMzXWv8fK8B+ekYhB+MQYO0eQ8NdAQ2HzKeHbnvfBYODVw4fehndq0w== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2017 04:26:09.2111 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717 Subject: Re: [dpdk-dev] [PATCH v4 1/5] efd: new Elastic Flow Distributor library X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 04:26:15 -0000 On Sun, Jan 15, 2017 at 12:04:31PM +0000, Pablo de Lara wrote: > Elastic Flow Distributor (EFD) is a distributor library that uses > perfect hashing to determine a target/value for a given incoming flow key. > It has the following advantages: > > - First, because it uses perfect hashing, it does not store > the key itself and hence lookup performance is not dependent > on the key size. > > - Second, the target/value can be any arbitrary value hence > the system designer and/or operator can better optimize service rates > and inter-cluster network traffic locating. > > - Third, since the storage requirement is much smaller than a hash-based > flow table (i.e. better fit for CPU cache), EFD can scale to > millions of flow keys. > Finally, with current optimized library implementation performance > is fully scalable with number of CPU cores. > > Signed-off-by: Byron Marohn > Signed-off-by: Pablo de Lara > Signed-off-by: Saikrishna Edupuganti > Acked-by: Christian Maciocco > --- > +#if (RTE_EFD_VALUE_NUM_BITS == 8 || RTE_EFD_VALUE_NUM_BITS == 16 || \ > + RTE_EFD_VALUE_NUM_BITS == 24 || RTE_EFD_VALUE_NUM_BITS == 32) > +#define EFD_LOAD_SI128(val) _mm_load_si128(val) > +#else > +#define EFD_LOAD_SI128(val) _mm_lddqu_si128(val) > +#endif > + > +static inline efd_value_t > +efd_lookup_internal(const struct efd_online_group_entry * const group, > + const uint32_t hash_val_a, const uint32_t hash_val_b, > + enum rte_efd_compare_function cmp_fn) > +{ > + efd_value_t value = 0; > + uint32_t i; > + > + switch (cmp_fn) { > +#ifdef RTE_MACHINE_CPUFLAG_AVX2 > + case RTE_HASH_COMPARE_AVX2: > + > + i = 0; > + __m256i vhash_val_a = _mm256_set1_epi32(hash_val_a); > + __m256i vhash_val_b = _mm256_set1_epi32(hash_val_b); > + Could you please abstract and move SIMD specific code to another file like other libraries(example: lib_acl) to enable smooth integration with neon and altivec SIMD implementations in future. > + for (; i < RTE_EFD_VALUE_NUM_BITS; i += 8) { > + __m256i vhash_idx = > + _mm256_cvtepu16_epi32(EFD_LOAD_SI128( > + (__m128i const *) &group->hash_idx[i])); > + __m256i vlookup_table = _mm256_cvtepu16_epi32( > + EFD_LOAD_SI128((__m128i const *) > + &group->lookup_table[i])); > + __m256i vhash = _mm256_add_epi32(vhash_val_a, > + _mm256_mullo_epi32(vhash_idx, vhash_val_b)); > + __m256i vbucket_idx = _mm256_srli_epi32(vhash, > + EFD_LOOKUPTBL_SHIFT); > + __m256i vresult = _mm256_srlv_epi32(vlookup_table, > + vbucket_idx); > + > + value |= (_mm256_movemask_ps( > + (__m256) _mm256_slli_epi32(vresult, 31)) > + & ((1 << (RTE_EFD_VALUE_NUM_BITS - i)) - 1)) << i; > + } > + break; > +#endif