From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id B1B8B1B1EC for ; Mon, 2 Oct 2017 15:31:00 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2017 06:30:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,469,1500966000"; d="scan'208";a="1020640823" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga003.jf.intel.com with ESMTP; 02 Oct 2017 06:30:57 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.167]) by IRSMSX103.ger.corp.intel.com ([169.254.3.49]) with mapi id 14.03.0319.002; Mon, 2 Oct 2017 14:30:57 +0100 From: "De Lara Guarch, Pablo" To: "Wang, Yipeng1" , "dev@dpdk.org" CC: "thomas@monjalon.net" , "Tai, Charlie" , "Gobriel, Sameh" , "Mcnamara, John" Thread-Topic: [PATCH v4 2/7] member: implement HT mode Thread-Index: AQHTN7hHgW2fDrK1RkWW6H3lHPSQGKLQQNfQ Date: Mon, 2 Oct 2017 13:30:56 +0000 Message-ID: References: <1504655989-1518-1-git-send-email-yipeng1.wang@intel.com> <1506534034-39433-1-git-send-email-yipeng1.wang@intel.com> <1506534034-39433-3-git-send-email-yipeng1.wang@intel.com> In-Reply-To: <1506534034-39433-3-git-send-email-yipeng1.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2YxNTI3NmYtMWE4My00NWJjLWEwYTEtMTA1NDhlNzEyOWVjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlhYdEE1Z25QZnhUSEVvdjcxQXNcL3Zkdm5lWWdXNTB3RUtvRU1RY2ZhaDRZPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 2/7] member: implement HT mode 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, 02 Oct 2017 13:31:01 -0000 DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV2FuZywgWWlwZW5nMQ0K PiBTZW50OiBXZWRuZXNkYXksIFNlcHRlbWJlciAyNywgMjAxNyA2OjQwIFBNDQo+IFRvOiBkZXZA ZHBkay5vcmcNCj4gQ2M6IHRob21hc0Btb25qYWxvbi5uZXQ7IFRhaSwgQ2hhcmxpZSA8Y2hhcmxp ZS50YWlAaW50ZWwuY29tPjsgR29icmllbCwNCj4gU2FtZWggPHNhbWVoLmdvYnJpZWxAaW50ZWwu Y29tPjsgRGUgTGFyYSBHdWFyY2gsIFBhYmxvDQo+IDxwYWJsby5kZS5sYXJhLmd1YXJjaEBpbnRl bC5jb20+OyBNY25hbWFyYSwgSm9obg0KPiA8am9obi5tY25hbWFyYUBpbnRlbC5jb20+OyBXYW5n LCBZaXBlbmcxIDx5aXBlbmcxLndhbmdAaW50ZWwuY29tPg0KPiBTdWJqZWN0OiBbUEFUQ0ggdjQg Mi83XSBtZW1iZXI6IGltcGxlbWVud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