From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E0E60A0471 for ; Tue, 18 Jun 2019 04:39:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EBC6D1BEB8; Tue, 18 Jun 2019 04:39:24 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2D35C1BEB8 for ; Tue, 18 Jun 2019 04:39:23 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jun 2019 19:39:22 -0700 X-ExtLoop1: 1 Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga005.jf.intel.com with ESMTP; 17 Jun 2019 19:39:21 -0700 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 19:39:21 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Jun 2019 19:39:20 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.33]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.225]) with mapi id 14.03.0439.000; Tue, 18 Jun 2019 10:39:19 +0800 From: "Mo, YufengX" To: "dev@dpdk.org" CC: "drc@ibm.com" , "pradeep@us.ibm.com" , Takeshi Yoshimura Thread-Topic: [dpdk-dev] [PATCH] vfio: fix expanding DMA area in ppc64le Thread-Index: AQHVJX61C4qC2KCbv0+gKDSJbfK/dKagsp7g Date: Tue, 18 Jun 2019 02:39:18 +0000 Message-ID: References: <20190613022239.6946-1-tyos@jp.ibm.com> In-Reply-To: <20190613022239.6946-1-tyos@jp.ibm.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] vfio: fix expanding DMA area in ppc64le 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" U29ycnksIG1pc3NlZCBzZW5kIHRoaXMgbWFpbC4gSWdub3JlIGl0IHBscy4NCg0KDQo+IC0tLS0t T3JpZ2luYWwgTWVzc2FnZS0tLS0tDQo+IEZyb206IE1vLCBZdWZlbmdYDQo+IFNlbnQ6IFR1ZXNk YXksIEp1bmUgMTgsIDIwMTkgMTA6MzggQU0NCj4gVG86IE1vLCBZdWZlbmdYIDx5dWZlbmd4Lm1v QGludGVsLmNvbT47IGRldkBkcGRrLm9yZw0KPiBDYzogZHJjQGlibS5jb207IHByYWRlZXBAdXMu aWJtLmNvbTsgVGFrZXNoaSBZb3NoaW11cmEgPHR5b3NAanAuaWJtLmNvbT4NCj4gU3ViamVjdDog W2RwZGstZGV2XSBbUEFUQ0hdIHZmaW86IGZpeCBleHBhbmRpbmcgRE1BIGFyZWEgaW4gcHBjNjRs ZQ0KPiANCj4gRnJvbTogVGFrZXNoaSBZb3NoaW11cmEgPHR5b3NAanAuaWJtLmNvbT4NCj4gDQo+ IEluIHBwYzY0bGUsIGV4cGFuZGluZyBETUEgYXJlYXMgYWx3YXlzIGZhaWwgYmVjYXVzZSB3ZSBj YW5ub3QgcmVtb3ZlDQo+IGEgRE1BIHdpbmRvdy4gQXMgYSByZXN1bHQsIHdlIGNhbm5vdCBhbGxv Y2F0ZSBtb3JlIHRoYW4gb25lIG1l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