Thread (11 messages) 11 messages, 5 authors, 2023-07-07
STALE1084d

[PATCH v2 2/2] bus/pci: add IO port region check before region map

From: Miao Li <hidden>
Date: 2023-06-29 02:27:10
Subsystem: the rest · Maintainer: Linus Torvalds

This patch adds IO port region check to skip region map
when doing IO port map for legacy device in secondary process.

Fixes: 33604c31354a ("vfio: refactor PCI BAR mapping")
Cc: stable@dpdk.org

Signed-off-by: Miao Li <redacted>
---
 drivers/bus/pci/linux/pci_vfio.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index e634de8322..dd4ca46120 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -1099,6 +1099,15 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev)
 	maps = vfio_res->maps;
 
 	for (i = 0; i < vfio_res->nb_maps; i++) {
+		/* chk for io port region */
+		ret = pci_vfio_is_ioport_bar(dev, vfio_dev_fd, i);
+		if (ret < 0) {
+			goto err_vfio_dev_fd;
+		} else if (ret) {
+			RTE_LOG(INFO, EAL, "Ignore mapping IO port bar(%d)\n", i);
+			continue;
+		}
+
 		if (maps[i].nr_areas > 0) {
 			ret = pci_vfio_sparse_mmap_bar(vfio_dev_fd, vfio_res, i, MAP_FIXED);
 			if (ret < 0) {
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help