eal: remove support for I/O port
RFC 1/1 eal: remove support for I/O port
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 <[email protected]>
--- 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(-)
doc/guides/rel_notes/deprecation.rst +4 -0
@@ -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.
drivers/bus/pci/linux/pci_uio.c +2 -13
@@ -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);
drivers/net/virtio/virtio_pci_ethdev.c +0 -1
@@ -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); }
lib/eal/include/rte_eal.h +4 -5
@@ -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);/**
lib/eal/linux/eal.c +0 -7
@@ -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 ; }
Signature · 1 line
2.47.2
Quoted 7 lines · On Tue, 8 Apr 2025 11:30:32 -0700 Stephen Hemminger…
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 <[email protected]>---
Not yet, FreeBSD still uses it and the virtio support still needs it. Really needs to go since many kernels fully block userspace to I/O because it allows unrestricted access to hardware.