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: fix tailq init for uio and vfio resources
[dpdk.git]
/
lib
/
librte_eal
/
linuxapp
/
eal
/
eal_pci_uio.c
diff --git
a/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
b/lib/librte_eal/linuxapp/eal/eal_pci_uio.c
index
0b397ca
..
2d1c69b
100644
(file)
--- a/
lib/librte_eal/linuxapp/eal/eal_pci_uio.c
+++ b/
lib/librte_eal/linuxapp/eal/eal_pci_uio.c
@@
-41,9
+41,9
@@
#include <rte_log.h>
#include <rte_pci.h>
#include <rte_log.h>
#include <rte_pci.h>
+#include <rte_eal_memconfig.h>
#include <rte_common.h>
#include <rte_malloc.h>
#include <rte_common.h>
#include <rte_malloc.h>
-#include <rte_tailq.h>
#include "rte_pci_dev_ids.h"
#include "eal_filesystem.h"
#include "rte_pci_dev_ids.h"
#include "eal_filesystem.h"
@@
-51,6
+51,10
@@
void *pci_map_addr = NULL;
void *pci_map_addr = NULL;
+static struct rte_tailq_elem rte_uio_tailq = {
+ .name = "UIO_RESOURCE_LIST",
+};
+EAL_REGISTER_TAILQ(rte_uio_tailq)
#define OFF_MAX ((uint64_t)(off_t)-1)
#define OFF_MAX ((uint64_t)(off_t)-1)
@@
-88,8
+92,9
@@
pci_uio_map_secondary(struct rte_pci_device *dev)
{
int fd, i;
struct mapped_pci_resource *uio_res;
{
int fd, i;
struct mapped_pci_resource *uio_res;
+ struct mapped_pci_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list);
- TAILQ_FOREACH(uio_res,
pci
_res_list, next) {
+ TAILQ_FOREACH(uio_res,
uio
_res_list, next) {
/* skip this element if it doesn't match our PCI address */
if (rte_eal_compare_pci_addr(&uio_res->pci_addr, &dev->addr))
/* skip this element if it doesn't match our PCI address */
if (rte_eal_compare_pci_addr(&uio_res->pci_addr, &dev->addr))
@@
-267,6
+272,7
@@
pci_uio_map_resource(struct rte_pci_device *dev)
uint64_t phaddr;
struct rte_pci_addr *loc = &dev->addr;
struct mapped_pci_resource *uio_res;
uint64_t phaddr;
struct rte_pci_addr *loc = &dev->addr;
struct mapped_pci_resource *uio_res;
+ struct mapped_pci_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list);
struct pci_map *maps;
dev->intr_handle.fd = -1;
struct pci_map *maps;
dev->intr_handle.fd = -1;
@@
-383,7
+389,7
@@
pci_uio_map_resource(struct rte_pci_device *dev)
uio_res->nb_maps = map_idx;
uio_res->nb_maps = map_idx;
- TAILQ_INSERT_TAIL(
pci
_res_list, uio_res, next);
+ TAILQ_INSERT_TAIL(
uio
_res_list, uio_res, next);
return 0;
}
return 0;
}
@@
-406,11
+412,12
@@
static struct mapped_pci_resource *
pci_uio_find_resource(struct rte_pci_device *dev)
{
struct mapped_pci_resource *uio_res;
pci_uio_find_resource(struct rte_pci_device *dev)
{
struct mapped_pci_resource *uio_res;
+ struct mapped_pci_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list);
if (dev == NULL)
return NULL;
if (dev == NULL)
return NULL;
- TAILQ_FOREACH(uio_res,
pci
_res_list, next) {
+ TAILQ_FOREACH(uio_res,
uio
_res_list, next) {
/* skip this element if it doesn't match our PCI address */
if (!rte_eal_compare_pci_addr(&uio_res->pci_addr, &dev->addr))
/* skip this element if it doesn't match our PCI address */
if (!rte_eal_compare_pci_addr(&uio_res->pci_addr, &dev->addr))
@@
-424,6
+431,7
@@
void
pci_uio_unmap_resource(struct rte_pci_device *dev)
{
struct mapped_pci_resource *uio_res;
pci_uio_unmap_resource(struct rte_pci_device *dev)
{
struct mapped_pci_resource *uio_res;
+ struct mapped_pci_res_list *uio_res_list = RTE_TAILQ_CAST(rte_uio_tailq.head, mapped_pci_res_list);
if (dev == NULL)
return;
if (dev == NULL)
return;
@@
-437,7
+445,7
@@
pci_uio_unmap_resource(struct rte_pci_device *dev)
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return pci_uio_unmap(uio_res);
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return pci_uio_unmap(uio_res);
- TAILQ_REMOVE(
pci
_res_list, uio_res, next);
+ TAILQ_REMOVE(
uio
_res_list, uio_res, next);
/* unmap all resources */
pci_uio_unmap(uio_res);
/* unmap all resources */
pci_uio_unmap(uio_res);