DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Chenbo Xia <chenbox@nvidia.com>,
	Nipun Gupta <nipun.gupta@amd.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [RFC] eal: remove support for I/O port
Date: Tue,  8 Apr 2025 11:30:32 -0700	[thread overview]
Message-ID: <20250408183032.86167-1-stephen@networkplumber.org> (raw)

In early days of virtio, the x86 I/O instructions were used
to ring the doorbell for host access. To support these DPDK
needed to enable IO access. This is no longer necessary and
the vestiage can be marked deprecated.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/rel_notes/deprecation.rst   |  4 ++++
 drivers/bus/pci/linux/pci_uio.c        | 15 ++-------------
 drivers/net/virtio/virtio_pci_ethdev.c |  1 -
 lib/eal/include/rte_eal.h              |  9 ++++-----
 lib/eal/linux/eal.c                    |  7 -------
 5 files changed, 10 insertions(+), 26 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 36489f6e68..473148b5c7 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -142,3 +142,7 @@ Deprecation Notices
 * bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in
   ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK.
   Those API functions are used internally by DPDK core and netvsc PMD.
+
+* eal: No devices in DPDK currently use I/O port access (inb, outb)
+  and therefore the function to enable I/O port access rte_eal_iopl_init()
+  is deprecated and will be removed in 25.11 release.
diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c
index 4c1d3327a9..1914ecd34e 100644
--- a/drivers/bus/pci/linux/pci_uio.c
+++ b/drivers/bus/pci/linux/pci_uio.c
@@ -412,19 +412,8 @@ pci_uio_ioport_map(struct rte_pci_device *dev, int bar,
 		goto error;
 
 	if (flags & IORESOURCE_IO) {
-		if (rte_eal_iopl_init()) {
-			PCI_LOG(ERR, "%s(): insufficient ioport permissions for PCI device %s",
-				__func__, dev->name);
-			goto error;
-		}
-
-		base = (unsigned long)phys_addr;
-		if (base > PIO_MAX) {
-			PCI_LOG(ERR, "%s(): %08lx too large PIO resource", __func__, base);
-			goto error;
-		}
-
-		PCI_LOG(DEBUG, "%s(): PIO BAR %08lx detected", __func__, base);
+		PCI_LOG(DEBUG, "%s(): PIO BAR %" PRIx64" ignored", __func__, phys_addr);
+		goto error;
 	} else if (flags & IORESOURCE_MEM) {
 		base = (unsigned long)dev->mem_resource[bar].addr;
 		PCI_LOG(DEBUG, "%s(): MMIO BAR %08lx detected", __func__, base);
diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c
index 9b4b846f8a..abb04abba1 100644
--- a/drivers/net/virtio/virtio_pci_ethdev.c
+++ b/drivers/net/virtio/virtio_pci_ethdev.c
@@ -233,7 +233,6 @@ static struct rte_pci_driver rte_virtio_net_pci_pmd = {
 
 RTE_INIT(rte_virtio_net_pci_pmd_init)
 {
-	rte_eal_iopl_init();
 	rte_pci_register(&rte_virtio_net_pci_pmd);
 }
 
diff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h
index c826e143f1..8d28e9f914 100644
--- a/lib/eal/include/rte_eal.h
+++ b/lib/eal/include/rte_eal.h
@@ -15,6 +15,7 @@
 #include <time.h>
 
 #include <rte_config.h>
+#include <rte_common.h>
 #include <rte_compat.h>
 #include <rte_per_lcore.h>
 #include <rte_uuid.h>
@@ -49,12 +50,10 @@ enum rte_proc_type_t rte_eal_process_type(void);
 /**
  * Request iopl privilege for all RPL.
  *
- * This function should be called by pmds which need access to ioports.
-
- * @return
- *   - On success, returns 0.
- *   - On failure, returns -1.
+ * This function was used by pmds which need access to ioports.
+ * No longer used.
  */
+__rte_deprecated
 int rte_eal_iopl_init(void);
 
 /**
diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c
index 20f777b8b0..2f1523ffdb 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -20,9 +20,6 @@
 #include <limits.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
-#if defined(RTE_ARCH_X86)
-#include <sys/io.h>
-#endif
 #include <linux/version.h>
 
 #include <rte_common.h>
@@ -825,10 +822,6 @@ RTE_EXPORT_SYMBOL(rte_eal_iopl_init)
 int
 rte_eal_iopl_init(void)
 {
-#if defined(RTE_ARCH_X86)
-	if (iopl(3) != 0)
-		return -1;
-#endif
 	return 0;
 }
 
-- 
2.47.2


             reply	other threads:[~2025-04-08 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 18:30 Stephen Hemminger [this message]
2025-04-08 19:04 ` Stephen Hemminger

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=20250408183032.86167-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=nipun.gupta@amd.com \
    --cc=roretzla@linux.microsoft.com \
    /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).