From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 1ED4F1B277 for ; Tue, 3 Oct 2017 03:18:55 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 02 Oct 2017 18:18:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,471,1500966000"; d="scan'208";a="1201479495" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by fmsmga001.fm.intel.com with ESMTP; 02 Oct 2017 18:18:54 -0700 Received: from orsmsx161.amr.corp.intel.com (10.22.240.84) by ORSMSX110.amr.corp.intel.com (10.22.240.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 2 Oct 2017 18:18:54 -0700 Received: from orsmsx105.amr.corp.intel.com ([169.254.2.169]) by ORSMSX161.amr.corp.intel.com ([169.254.4.13]) with mapi id 14.03.0319.002; Mon, 2 Oct 2017 18:18:54 -0700 From: "Wang, Yipeng1" To: "De Lara Guarch, Pablo" , "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: AQHTN7hHgW2fDrK1RkWW6H3lHPSQGKLQQNfQgAESKXA= Date: Tue, 3 Oct 2017 01:18:53 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2YxNTI3NmYtMWE4My00NWJjLWEwYTEtMTA1NDhlNzEyOWVjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlhYdEE1Z25QZnhUSEVvdjcxQXNcL3Zkdm5lWWdXNTB3RUtvRU1RY2ZhaDRZPSJ9 x-originating-ip: [10.22.254.138] 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: Tue, 03 Oct 2017 01:18:57 -0000 VGhhbmsgeW91IHZlcnkgbXVjaCBQYWJsby4NCg0KIEkgYWdyZWUgd2l0aCB5b3Ugb24gbW9zdCBv ZiB5b3VyIGNvbW1lbnRzIGFuZCBJIHdpbGwgYWRkcmVzcyB0aGVtIHNvb24uDQpCdXQgcGxlYXNl IGZpbmQgc29tZSBleHBsYW5hdGlvbnMgaW5saW5lZCBmb3IgY2VydGFpbiBxdWVzdGlvbnMgeW91 IHJhaXNlZC4NCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBEZSBMYXJh IEd1YXJjaCwgUGFibG8NCj4gU2VudDogTW9uZGF5LCBPY3RvYmVyIDIsIDIwMTcgNjozMSBBTQ0K PiBUbzogV2FuZywgWWlwZW5nMSA8eWlwZW5nMS53YW5nQGludGVsLmNvbT47IGRldkBkcGRrLm9y Zw0KPiBDYzogdGhvbWFzQG1vbmphbG9uLm5ldD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