From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 5AADEF94 for ; Fri, 1 Jul 2016 12:53:26 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP; 01 Jul 2016 03:53:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,556,1459839600"; d="scan'208";a="998706206" 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 03:53:24 -0700 To: "Mcnamara, John" , "dev@dpdk.org" References: Cc: Pablo de Lara , Stephen Hemminger From: Ferruh Yigit Message-ID: <57764BA3.5030903@intel.com> Date: Fri, 1 Jul 2016 11:53:23 +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: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] Issue with igb_uio in Fedora 24 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 10:53:26 -0000 On 7/1/2016 11:21 AM, Mcnamara, John wrote: > Hi, > > We have seen an issue when using the igb_uio module in Fedora > 24. However, it relates to kernel 4.5+ so it could occur in other > distros/oses. > > The issue occurs after binding a nic to igb_uio: > > # ./tools/dpdk_nic_bind.py -b igb_uio 0000:03:00.0 > # ./x86_64-native-linuxapp-gcc/app/test > > EAL: Detected 8 lcore(s) > EAL: Probing VFIO support... > PMD: bnxt_rte_pmd_init() called for (null) > EAL: PCI device 0000:03:00.0 on NUMA socket -1 > EAL: probe driver: 8086:1533 rte_igb_pmd > EAL: pci_map_resource(): > cannot mmap(39, 0x7f1c51800000, 0x100000, 0x0): > Invalid argument (0xffffffffffffffff) > EAL: Error - exiting with code: 1 > Cause: Requested device 0000:03:00.0 cannot be used > > The issue is exposed when the kernel is compiled with option > CONFIG_IO_STRICT_DEVMEM turned on. > > This option is new from kernel 4.5 and is on by default in Fedora 24: > > config IO_STRICT_DEVMEM > bool "Filter I/O access to /dev/mem" > depends on STRICT_DEVMEM > ---help--- > > If this option is disabled, you allow userspace (root) access > to all io-memory regardless of whether a driver is actively > using that range. Accidental access to this is obviously > disastrous, but specific access can be used by people > debugging kernel drivers. > > If this option is switched on, the /dev/mem file only allows > userspace access to *idle* io-memory ranges (see /proc/iomem) > This may break traditional users of /dev/mem (dosemu, legacy > X, etc...) if the driver using a given range cannot be > disabled. > > If in doubt, say Y. > > This issue doesn't occur with uio_pci_generic. > > John > Thanks for Pablo figuring out the details, and related config option, otherwise I was digging same issue without success. Disabling following code in igb_uio makes it work again: "pci_request_regions(dev, "igb_uio");" This call adds device bars as active resources, and with above config option mmap fails for those addresses. uio_pci_generic already doesn't have this call, and I can send a patch to remove this from igb_uio. BUT, I don't know why that call added at first place and concerned about any corner case that requires this call. Anybody out has/knows a reason to keep this call? Thanks, ferruh