From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F2A8A052B; Thu, 30 Jul 2020 15:17:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D16411A2; Thu, 30 Jul 2020 15:17:03 +0200 (CEST) Received: from huawei.com (szxga01-in.huawei.com [45.249.212.187]) by dpdk.org (Postfix) with ESMTP id CC3C13B5; Thu, 30 Jul 2020 15:17:00 +0200 (CEST) Received: from DGGEMM406-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 0132A93C300DDEA18802; Thu, 30 Jul 2020 21:16:56 +0800 (CST) Received: from DGGEMM513-MBX.china.huawei.com ([169.254.1.141]) by DGGEMM406-HUB.china.huawei.com ([10.3.20.214]) with mapi id 14.03.0487.000; Thu, 30 Jul 2020 21:16:45 +0800 From: wangyunjian To: "Burakov, Anatoly" , "dev@dpdk.org" , "david.marchand@redhat.com" CC: "Lilijun (Jerry)" , xudingke , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] eal/linux: do not create user mem map repeatedly when it exists Thread-Index: AQHWYQBeKLf/JXFWikCJC/y3HWnXzakWM5gAgAHZYzCAAppcgIAFfUTg Date: Thu, 30 Jul 2020 13:16:44 +0000 Message-ID: <34EFBCA9F01B0748BEB6B629CE643AE60D0F695F@dggemm513-mbx.china.huawei.com> References: <1595515713-24640-1-git-send-email-wangyunjian@huawei.com> <34EFBCA9F01B0748BEB6B629CE643AE60D0EAAD8@dggemm513-mbx.china.huawei.com> In-Reply-To: Accept-Language: en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.185.168] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v2] eal/linux: do not create user mem map repeatedly when it exists 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" PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBCdXJha292LCBBbmF0b2x5IFtt YWlsdG86YW5hdG9seS5idXJha292QGludGVsLmNvbV0NCj4gU2VudDogTW9uZGF5LCBKdWx5IDI3 LCAyMDIwIDU6MjQgUE0NCj4gVG86IHdhbmd5dW5qaWFuIDx3YW5neXVuamlhbkBodWF3ZWkuY29t PjsgZGV2QGRwZGsub3JnOw0KPiBkYXZpZC5tYXJjaGFuZEByZWRoYXQuY29tDQo+IENjOiBMaWxp anVuIChKZXJyeSkgPGplcnJ5LmxpbGlqdW5AaHVhd2VpLmNvbT47IHh1ZGluZ2tlDQo+IDx4dWRp bmdrZUBodWF3ZWkuY29tPjsgc3RhYmxlQGRwZGsub3JnDQo+IFN1YmplY3Q6IFJlOiBbZHBkay1k ZXZdIFtQQVRDSCB2Ml0gZWFsL2xpbnV4OiBkbyBub3QgY3JlYXRlIHVzZXIgbWVtIG1hcA0KPiBy ZXBlYXRlZGx5IHdoZW4gaXQgZXhpc3RzDQo+IA0KPiBPbiAyNS1KdWwtMjAgMTA6NTkgQU0sIHdh bmd5dW5qaWFuIHdyb3RlOg0KPiA+PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiA+PiBG cm9tOiBCdXJha292LCBBbmF0b2x5IFttYWlsdG86YW5hdG9seS5idXJha292QGludGVsLmNvbV0N Cj4gPj4gU2VudDogRnJpZGF5LCBKdWx5IDI0LCAyMDIwIDk6MjUgUE0NCj4gPj4gVG86IHdhbmd5 dW5qaWFuIDx3YW5neXVuamlhbkBodWF3ZWkuY29tPjsgZGV2QGRwZGsub3JnOw0KPiA+PiBkYXZp ZC5tYXJjaGFuZEByZWRoYXQuY29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