From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id E58EC805F for ; Tue, 16 Dec 2014 20:36:13 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 16 Dec 2014 11:11:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="499716796" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga003.jf.intel.com with ESMTP; 16 Dec 2014 11:09:43 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.150]) by IRSMSX103.ger.corp.intel.com ([169.254.3.113]) with mapi id 14.03.0195.001; Tue, 16 Dec 2014 19:13:55 +0000 From: "Dumitrescu, Cristian" To: "Wunderlich, Mark W" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] lib/librte_table: Fix table array lookup Thread-Index: AQHQFnIwG3+qW2QW10q8mdY0wgOlIJySmnSg Date: Tue, 16 Dec 2014 19:13:55 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D89126322DF189@IRSMSX108.ger.corp.intel.com> References: <20141213010638.28002.63966.stgit@localhost.localdomain> In-Reply-To: <20141213010638.28002.63966.stgit@localhost.localdomain> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: Re: [dpdk-dev] [PATCH] lib/librte_table: Fix table array lookup 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: Tue, 16 Dec 2014 19:36:14 -0000 SGkgTWFyaywNCg0KTkFDSw0KDQo+SWYgdGhlIG9yaWdpbmFsIGludGVudCBmb3IgdGhp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