From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A0956C544 for ; Thu, 16 Jun 2016 06:58:50 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 15 Jun 2016 21:58:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,478,1459839600"; d="scan'208";a="122804718" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by fmsmga004.fm.intel.com with ESMTP; 15 Jun 2016 21:58:50 -0700 Received: from orsmsx161.amr.corp.intel.com (10.22.240.84) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 15 Jun 2016 21:58:48 -0700 Received: from orsmsx111.amr.corp.intel.com ([169.254.12.253]) by ORSMSX161.amr.corp.intel.com ([169.254.4.132]) with mapi id 14.03.0248.002; Wed, 15 Jun 2016 21:58:48 -0700 From: "Shen, Wei1" To: "De Lara Guarch, Pablo" , "dev@dpdk.org" CC: "Tai, Charlie" , "Maciocco, Christian" , "Gobriel, Sameh" Thread-Topic: [PATCH v1] hash: add tsx support for cuckoo hash Thread-Index: AQHRp9KdILwjFTuD+Eah0g0d2C46YJ/r5bmA///iKYA= Date: Thu, 16 Jun 2016 04:58:47 +0000 Message-ID: <2B1FD0A0-7B94-4E57-8831-3A456823B746@intel.com> References: <1462565102-15312-1-git-send-email-wei1.shen@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.24.5.50] Content-Type: text/plain; charset="utf-8" Content-ID: <9B0D317348923B4182E0436AF7448CC1@intel.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1] hash: add tsx support for cuckoo hash 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, 16 Jun 2016 04:58:51 -0000 VGhhbmtzIFBhYmxvIGZvciByZXZpZXdpbmcgdGhlIHBhdGNoLiBJIGp1c3Qgc2VudCBvdXQgdjIg cGF0Y2guIEl0IGZpeGVkIHRob3NlIHByb2JsZW1zIHlvdSBmb3VuZCBhbmQgYWxzbyByZW1vdmVk IHRoZSBSVEVfSEFTSF9LRVlfRkxBR19NT1ZFRCBmbGFnIHVzZWQgaW4gdjEsIHdoaWNoIHdvdWxk IGNhdXNlIHByb2JsZW0gd2hlbiBrZXkgZGVsZXRpb24gaGFwcGVucyAoY3VycmVudCBrZXkgZGVs ZXRpb24gZG9lc27igJl0IHJlc3RvcmUga2V5cyBiYWNrIHRvIGl0cyBwcmltYXJ5IGJ1Y2tldCku IE5vdyBpdCBqdXN0IHN3YXBzIGN1cnJlbnQvYWx0IHNpZyB3aGVuIGEgcHVzaCBoYXBwZW5zLCBh cyBtYWtlX3NwYWNlX2J1Y2tldCBkb2VzLg0KDQpUaGVyZSBpcyBzdGlsbCBzb21lIGxpbmUgdG9v IGxvbmcgY2hlY2twYXRjaCB3YXJuaW5nLCBidXQgZml4aW5nIHRob3NlIHdvdWxkIGh1cnQgY29k ZSByZWFkYWJpbGl0eSByYXRoZXIgdGhhbiBpbXByb3ZpbmcgdGhlbS4gU28gSSBsZWZ0IGFzIGl0 Lg0KDQpUaGFua3MuDQotLSANCkJlc3QsDQoNCldlaSBTaGVuLg0KDQpPbiA2LzE1LzE2LCA0OjQ1 IFBNLCAiRGUgTGFyYSBHdWFyY2gsIFBhYmxvIiA8cGFibG8uZGUubGFyYS5ndWFyY2hAaW50ZWwu Y29tPiB3cm90ZToNCg0KSGkgV2VpLA0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+ IEZyb206IFNoZW4sIFdlaTENCj4gU2VudDogRnJpZGF5LCBNYXkgMDYsID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