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 8E611A034E; Thu, 7 Nov 2019 13:24:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 011F51E9F1; Thu, 7 Nov 2019 13:24:40 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 8F0091E9C6 for ; Thu, 7 Nov 2019 13:24:38 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Nov 2019 04:24:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,278,1569308400"; d="scan'208";a="201386795" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.92]) ([10.237.220.92]) by fmsmga007.fm.intel.com with ESMTP; 07 Nov 2019 04:24:35 -0800 To: "Wangyu (Eric)" , David Marchand Cc: "dev@dpdk.org" , "ferruh.yigit@intel.com" , Linuxarm , "humin (Q)" , "Liyuan (Larry)" , dengxiaofeng References: <78A93308629D474AA53B84C5879E84D24B102602@DGGEMM533-MBX.china.huawei.com> <78A93308629D474AA53B84C5879E84D24B103B0C@DGGEMM533-MBX.china.huawei.com> <8c50d8b6-4149-f101-fe90-b4c83f9b2b40@intel.com> <78A93308629D474AA53B84C5879E84D24B104514@DGGEMM533-MBX.china.huawei.com> From: "Burakov, Anatoly" Message-ID: <9c8852bc-fb47-e06b-5761-40e2a56faeec@intel.com> Date: Thu, 7 Nov 2019 12:24:34 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <78A93308629D474AA53B84C5879E84D24B104514@DGGEMM533-MBX.china.huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] =?utf-8?b?562U5aSNOiAgW1BBVENIIHYyXSBidXMvcGNpOiByZXNv?= =?utf-8?q?lve_multiple_NICs_address_conflicts?= 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" On 07-Nov-19 5:44 AM, Wangyu (Eric) wrote: > Hi, Anatoly > > Thank you for advices. This problem will happen in both VFIO and UIO, I will modify both according to your advices and test them. > > I did some tests with mmap() on my system, when I provided address not page-aligned, mmap() could return page-aligned address too, but the code will return fault because mmap() return address was not equal with address I provided(problem occurs in pci_uio_map_secondary()). > I still don't understand how do you get addresses aligned on a 16K boundary with 64K page size. The mapping process is as follows: 0) start with max_va_end, or with previous addres + previous len 1) reserve virtual area with mmap() (accepts any return address) 2) map the BAR with MAP_FIXED (checks return address, but should work because we already have that area reserved) The error you're referring to would've happened at step 2 (MAP_FIXED with unaligned addresses will cause the mmap() to fail), but at that point we already have a valid virtual area for the bar. If you get a 16K-aligned page address for the BAR, you get it on step 1, not step 2. So, if, by your own admission, your mmap() implementation does return a 64K-aligned address... What exactly is the issue then? How does your BAR end up with an invalid address? -- Thanks, Anatoly