mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 21:37:15 +02:00
85 lines
2.7 KiB
Diff
85 lines
2.7 KiB
Diff
diff -Nurp a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
|
|
--- a/drivers/bus/pci/linux/pci_vfio.c 2023-11-28 14:35:41.000000000 +0000
|
|
+++ b/drivers/bus/pci/linux/pci_vfio.c 2023-11-28 20:38:26.022187702 +0000
|
|
@@ -80,7 +80,7 @@ pci_vfio_read_config(const struct rte_pc
|
|
if ((uint64_t)len + offs > size)
|
|
return -1;
|
|
|
|
- return pread64(fd, buf, len, offset + offs);
|
|
+ return pread(fd, buf, len, offset + offs);
|
|
}
|
|
|
|
int
|
|
@@ -101,7 +101,7 @@ pci_vfio_write_config(const struct rte_p
|
|
if ((uint64_t)len + offs > size)
|
|
return -1;
|
|
|
|
- return pwrite64(fd, buf, len, offset + offs);
|
|
+ return pwrite(fd, buf, len, offset + offs);
|
|
}
|
|
|
|
/* get PCI BAR number where MSI-X interrupts are */
|
|
@@ -155,7 +155,7 @@ pci_vfio_enable_bus_memory(struct rte_pc
|
|
return -1;
|
|
}
|
|
|
|
- ret = pread64(dev_fd, &cmd, sizeof(cmd), offset + RTE_PCI_COMMAND);
|
|
+ ret = pread(dev_fd, &cmd, sizeof(cmd), offset + RTE_PCI_COMMAND);
|
|
|
|
if (ret != sizeof(cmd)) {
|
|
RTE_LOG(ERR, EAL, "Cannot read command from PCI config space!\n");
|
|
@@ -166,7 +166,7 @@ pci_vfio_enable_bus_memory(struct rte_pc
|
|
return 0;
|
|
|
|
cmd |= RTE_PCI_COMMAND_MEMORY;
|
|
- ret = pwrite64(dev_fd, &cmd, sizeof(cmd), offset + RTE_PCI_COMMAND);
|
|
+ ret = pwrite(dev_fd, &cmd, sizeof(cmd), offset + RTE_PCI_COMMAND);
|
|
|
|
if (ret != sizeof(cmd)) {
|
|
RTE_LOG(ERR, EAL, "Cannot write command to PCI config space!\n");
|
|
@@ -425,7 +425,7 @@ pci_vfio_is_ioport_bar(const struct rte_
|
|
return -1;
|
|
}
|
|
|
|
- ret = pread64(vfio_dev_fd, &ioport_bar, sizeof(ioport_bar),
|
|
+ ret = pread(vfio_dev_fd, &ioport_bar, sizeof(ioport_bar),
|
|
offset + RTE_PCI_BASE_ADDRESS_0 + bar_index * 4);
|
|
if (ret != sizeof(ioport_bar)) {
|
|
RTE_LOG(ERR, EAL, "Cannot read command (%x) from config space!\n",
|
|
@@ -1250,7 +1250,7 @@ pci_vfio_ioport_read(struct rte_pci_iopo
|
|
if (vfio_dev_fd < 0)
|
|
return;
|
|
|
|
- if (pread64(vfio_dev_fd, data,
|
|
+ if (pread(vfio_dev_fd, data,
|
|
len, p->base + offset) <= 0)
|
|
RTE_LOG(ERR, EAL,
|
|
"Can't read from PCI bar (%" PRIu64 ") : offset (%x)\n",
|
|
@@ -1267,7 +1267,7 @@ pci_vfio_ioport_write(struct rte_pci_iop
|
|
if (vfio_dev_fd < 0)
|
|
return;
|
|
|
|
- if (pwrite64(vfio_dev_fd, data,
|
|
+ if (pwrite(vfio_dev_fd, data,
|
|
len, p->base + offset) <= 0)
|
|
RTE_LOG(ERR, EAL,
|
|
"Can't write to PCI bar (%" PRIu64 ") : offset (%x)\n",
|
|
@@ -1298,7 +1298,7 @@ pci_vfio_mmio_read(const struct rte_pci_
|
|
if ((uint64_t)len + offs > size)
|
|
return -1;
|
|
|
|
- return pread64(fd, buf, len, offset + offs);
|
|
+ return pread(fd, buf, len, offset + offs);
|
|
}
|
|
|
|
int
|
|
@@ -1318,7 +1318,7 @@ pci_vfio_mmio_write(const struct rte_pci
|
|
if ((uint64_t)len + offs > size)
|
|
return -1;
|
|
|
|
- return pwrite64(fd, buf, len, offset + offs);
|
|
+ return pwrite(fd, buf, len, offset + offs);
|
|
}
|
|
|
|
int
|