git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
eal/linux: change log severity levels
[dpdk.git]
/
lib
/
librte_eal
/
linuxapp
/
eal
/
eal_pci_vfio.c
diff --git
a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index
ee9660f
..
cf5ac50
100644
(file)
--- a/
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/
lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@
-41,7
+41,6
@@
#include <rte_log.h>
#include <rte_pci.h>
#include <rte_log.h>
#include <rte_pci.h>
-#include <rte_tailq.h>
#include <rte_eal_memconfig.h>
#include <rte_malloc.h>
#include <eal_private.h>
#include <rte_eal_memconfig.h>
#include <rte_malloc.h>
#include <eal_private.h>
@@
-65,6
+64,11
@@
#define PAGE_SIZE (sysconf(_SC_PAGESIZE))
#define PAGE_MASK (~(PAGE_SIZE - 1))
#define PAGE_SIZE (sysconf(_SC_PAGESIZE))
#define PAGE_MASK (~(PAGE_SIZE - 1))
+static struct rte_tailq_elem rte_vfio_tailq = {
+ .name = "VFIO_RESOURCE_LIST",
+};
+EAL_REGISTER_TAILQ(rte_vfio_tailq)
+
#define VFIO_DIR "/dev/vfio"
#define VFIO_CONTAINER_PATH "/dev/vfio/vfio"
#define VFIO_GROUP_FMT "/dev/vfio/%u"
#define VFIO_DIR "/dev/vfio"
#define VFIO_CONTAINER_PATH "/dev/vfio/vfio"
#define VFIO_GROUP_FMT "/dev/vfio/%u"
@@
-290,7
+294,7
@@
pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd)
}
/* set up an eventfd for interrupts */
}
/* set up an eventfd for interrupts */
- fd = eventfd(0,
0
);
+ fd = eventfd(0,
EFD_NONBLOCK | EFD_CLOEXEC
);
if (fd < 0) {
RTE_LOG(ERR, EAL, " cannot set up eventfd, "
"error %i (%s)\n", errno, strerror(errno));
if (fd < 0) {
RTE_LOG(ERR, EAL, " cannot set up eventfd, "
"error %i (%s)\n", errno, strerror(errno));
@@
-547,6
+551,8
@@
pci_vfio_map_resource(struct rte_pci_device *dev)
struct rte_pci_addr *loc = &dev->addr;
int i, ret, msix_bar;
struct mapped_pci_resource *vfio_res = NULL;
struct rte_pci_addr *loc = &dev->addr;
int i, ret, msix_bar;
struct mapped_pci_resource *vfio_res = NULL;
+ struct mapped_pci_res_list *vfio_res_list = RTE_TAILQ_CAST(rte_vfio_tailq.head, mapped_pci_res_list);
+
struct pci_map *maps;
uint32_t msix_table_offset = 0;
uint32_t msix_table_size = 0;
struct pci_map *maps;
uint32_t msix_table_offset = 0;
uint32_t msix_table_size = 0;
@@
-701,7
+707,7
@@
pci_vfio_map_resource(struct rte_pci_device *dev)
VFIO_PCI_BAR5_REGION_INDEX + 1);
} else {
/* if we're in a secondary process, just find our tailq entry */
VFIO_PCI_BAR5_REGION_INDEX + 1);
} else {
/* if we're in a secondary process, just find our tailq entry */
- TAILQ_FOREACH(vfio_res,
pci
_res_list, next) {
+ TAILQ_FOREACH(vfio_res,
vfio
_res_list, next) {
if (memcmp(&vfio_res->pci_addr, &dev->addr, sizeof(dev->addr)))
continue;
break;
if (memcmp(&vfio_res->pci_addr, &dev->addr, sizeof(dev->addr)))
continue;
break;
@@
-722,7
+728,7
@@
pci_vfio_map_resource(struct rte_pci_device *dev)
struct vfio_region_info reg = { .argsz = sizeof(reg) };
void *bar_addr;
struct memreg {
struct vfio_region_info reg = { .argsz = sizeof(reg) };
void *bar_addr;
struct memreg {
- u
int32_t
offset, size;
+ u
nsigned long
offset, size;
} memreg[2] = {};
reg.index = i;
} memreg[2] = {};
reg.index = i;
@@
-765,7
+771,7
@@
pci_vfio_map_resource(struct rte_pci_device *dev)
RTE_LOG(DEBUG, EAL,
"Trying to map BAR %d that contains the MSI-X "
"table. Trying offsets: "
RTE_LOG(DEBUG, EAL,
"Trying to map BAR %d that contains the MSI-X "
"table. Trying offsets: "
- "
%04x:%04x, %04x:%04
x\n", i,
+ "
0x%04lx:0x%04lx, 0x%04lx:0x%04l
x\n", i,
memreg[0].offset, memreg[0].size,
memreg[1].offset, memreg[1].size);
}
memreg[0].offset, memreg[0].size,
memreg[1].offset, memreg[1].size);
}
@@
-855,7
+861,7
@@
pci_vfio_map_resource(struct rte_pci_device *dev)
}
if (internal_config.process_type == RTE_PROC_PRIMARY)
}
if (internal_config.process_type == RTE_PROC_PRIMARY)
- TAILQ_INSERT_TAIL(
pci
_res_list, vfio_res, next);
+ TAILQ_INSERT_TAIL(
vfio
_res_list, vfio_res, next);
return 0;
}
return 0;
}
@@
-893,7
+899,7
@@
pci_vfio_enable(void)
if (vfio_cfg.vfio_container_fd != -1)
vfio_cfg.vfio_enabled = 1;
else
if (vfio_cfg.vfio_container_fd != -1)
vfio_cfg.vfio_enabled = 1;
else
- RTE_LOG(
INFO
, EAL, "VFIO support could not be initialized\n");
+ RTE_LOG(
NOTICE
, EAL, "VFIO support could not be initialized\n");
return 0;
}
return 0;
}