From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: Issue with igb_uio in Fedora 24 Date: Fri, 1 Jul 2016 11:53:23 +0100 Message-ID: <57764BA3.5030903@intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: Pablo de Lara , Stephen Hemminger To: "Mcnamara, John" , "dev@dpdk.org" 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) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 7/1/2016 11:21 AM, Mcnamara, John wrote: > Hi, >=20 > 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. >=20 > The issue occurs after binding a nic to igb_uio: >=20 > # ./tools/dpdk_nic_bind.py -b igb_uio 0000:03:00.0 > # ./x86_64-native-linuxapp-gcc/app/test >=20 > 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 > =20 > The issue is exposed when the kernel is compiled with option > CONFIG_IO_STRICT_DEVMEM turned on. >=20 > This option is new from kernel 4.5 and is on by default in Fedora 24: >=20 > config IO_STRICT_DEVMEM > bool "Filter I/O access to /dev/mem" > depends on STRICT_DEVMEM > ---help--- >=20 > 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. >=20 > 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. >=20 > If in doubt, say Y. >=20 > This issue doesn't occur with uio_pci_generic. >=20 > John >=20 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