DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH] igb_uio: fix mmap failure
Date: Fri,  1 Jul 2016 12:35:12 +0100	[thread overview]
Message-ID: <1467372912-31113-1-git-send-email-ferruh.yigit@intel.com> (raw)
In-Reply-To: <57764BA3.5030903@intel.com>

With kernels enabled CONFIG_IO_STRICT_DEVMEM option mmap the iomem area
to userspace fails:

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.

Fixes: af75078fece3 ("first public release")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/linuxapp/igb_uio/igb_uio.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
index 45a5720..df41e45 100644
--- a/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
+++ b/lib/librte_eal/linuxapp/igb_uio/igb_uio.c
@@ -342,16 +342,6 @@ igbuio_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 		goto fail_free;
 	}
 
-	/*
-	 * reserve device's PCI memory regions for use by this
-	 * module
-	 */
-	err = pci_request_regions(dev, "igb_uio");
-	if (err != 0) {
-		dev_err(&dev->dev, "Cannot request regions\n");
-		goto fail_disable;
-	}
-
 	/* enable bus mastering on the device */
 	pci_set_master(dev);
 
@@ -441,8 +431,6 @@ fail_release_iomem:
 	igbuio_pci_release_iomem(&udev->info);
 	if (udev->mode == RTE_INTR_MODE_MSIX)
 		pci_disable_msix(udev->pdev);
-	pci_release_regions(dev);
-fail_disable:
 	pci_disable_device(dev);
 fail_free:
 	kfree(udev);
@@ -460,7 +448,6 @@ igbuio_pci_remove(struct pci_dev *dev)
 	igbuio_pci_release_iomem(&udev->info);
 	if (udev->mode == RTE_INTR_MODE_MSIX)
 		pci_disable_msix(dev);
-	pci_release_regions(dev);
 	pci_disable_device(dev);
 	pci_set_drvdata(dev, NULL);
 	kfree(udev);
-- 
2.7.4

  reply	other threads:[~2016-07-01 11:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01 10:21 [dpdk-dev] Issue with igb_uio in Fedora 24 Mcnamara, John
2016-07-01 10:53 ` Ferruh Yigit
2016-07-01 11:35   ` Ferruh Yigit [this message]
2016-07-01 12:47     ` [dpdk-dev] [PATCH] igb_uio: fix mmap failure Thomas Monjalon
2016-07-01 14:39       ` Ferruh Yigit
2016-07-01 14:54         ` Thomas Monjalon
2016-07-01 15:07     ` [dpdk-dev] [PATCH v2] igb_uio: fix possible mmap failure for Linux > v4.3 Ferruh Yigit
2016-07-01 15:52       ` De Lara Guarch, Pablo
2016-07-01 15:54         ` Ferruh Yigit
2016-07-01 15:59       ` [dpdk-dev] [PATCH v3] igb_uio: fix possible mmap failure for Linux >= v4.5 Ferruh Yigit
2016-07-05 15:00       ` [dpdk-dev] [PATCH v4] " Ferruh Yigit
2016-07-10 13:58         ` Thomas Monjalon
2016-07-02  0:12   ` [dpdk-dev] Issue with igb_uio in Fedora 24 De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467372912-31113-1-git-send-email-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).