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 AF8EB2BA8 for ; Fri, 1 Jul 2016 16:40:00 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 01 Jul 2016 07:39:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,557,1459839600"; d="scan'208";a="998819331" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.37]) ([10.237.220.37]) by fmsmga001.fm.intel.com with ESMTP; 01 Jul 2016 07:39:58 -0700 To: Thomas Monjalon References: <57764BA3.5030903@intel.com> <1467372912-31113-1-git-send-email-ferruh.yigit@intel.com> <4689144.y76TPTqy0y@xps13> Cc: dev@dpdk.org, Stephen Hemminger From: Ferruh Yigit Message-ID: <577680BE.60408@intel.com> Date: Fri, 1 Jul 2016 15:39:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <4689144.y76TPTqy0y@xps13> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] igb_uio: fix mmap failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2016 14:40:01 -0000 On 7/1/2016 1:47 PM, Thomas Monjalon wrote: > Thank you Ferruh for taking care of igb_uio. > > 2016-07-01 12:35, Ferruh Yigit: >> With kernels enabled CONFIG_IO_STRICT_DEVMEM option mmap the iomem area >> to userspace fails: > > Maybe some words are missing. > Please check punctuation of the whole commit message to make it easier > to understand. I will re-word. > >> EAL: pci_map_resource(): >> cannot mmap(39, 0x7f1c51800000, 0x100000, 0x0): >> Invalid argument (0xffffffffffffffff) >> >> As a workaround igb_uio can stop reserving PCI memory resources, from >> kernel point of view io-memory region looks like idle and mmap works >> again. >> >> With this update device io-memory range is not protected against any >> other kernel driver claim ownership on those resources, which shouldn't >> be a problem for dpdk usage module. > > Why it should not be a problem? request_mem_region() is a way for driver informing the rest of the kernel that memory region is used. And with CONFIG_IO_STRICT_DEVMEM=y, userspace also prevented to touch that ares. But for igb_uio, we explicitly want userspace to access that memory range. > Please could you give an example of what could happen? Technically device lost a protection of its memory region against any other driver, but I am not sure if this is real threat in practical life. Also this is same in uio_pci_generic, it doesn't reserve the memory. > > This patch fixes a problem with recent kernels (not mentioned above) > which offer the uio_pci_generic alternative. Will give kernel version information. > That's why I think we should fix it only if there is absolutely no > regression for older kernels. > Totally agreed, that is why I expressed my concern, let this patch hang around a little.