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
tailq: move to dynamic tailq
[dpdk.git]
/
lib
/
librte_eal
/
linuxapp
/
eal
/
eal_pci.c
diff --git
a/lib/librte_eal/linuxapp/eal/eal_pci.c
b/lib/librte_eal/linuxapp/eal/eal_pci.c
index
f880f90
..
c42e843
100644
(file)
--- a/
lib/librte_eal/linuxapp/eal/eal_pci.c
+++ b/
lib/librte_eal/linuxapp/eal/eal_pci.c
@@
-37,7
+37,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 <rte_devargs.h>
#include <rte_eal_memconfig.h>
#include <rte_malloc.h>
#include <rte_devargs.h>
@@
-59,6
+58,11
@@
struct mapped_pci_res_list *pci_res_list = NULL;
struct mapped_pci_res_list *pci_res_list = NULL;
+static struct rte_tailq_elem rte_pci_tailq = {
+ .name = "PCI_RESOURCE_LIST",
+};
+EAL_REGISTER_TAILQ(rte_pci_tailq)
+
/* unbind kernel driver for this device */
static int
pci_unbind_kernel_driver(struct rte_pci_device *dev)
/* unbind kernel driver for this device */
static int
pci_unbind_kernel_driver(struct rte_pci_device *dev)
@@
-440,8
+444,8
@@
error:
* Scan the content of the PCI bus, and the devices in the devices
* list
*/
* Scan the content of the PCI bus, and the devices in the devices
* list
*/
-
static
int
-pci_scan(void)
+int
+
rte_eal_
pci_scan(void)
{
struct dirent *e;
DIR *dir;
{
struct dirent *e;
DIR *dir;
@@
-766,14
+770,13
@@
rte_eal_pci_init(void)
{
TAILQ_INIT(&pci_driver_list);
TAILQ_INIT(&pci_device_list);
{
TAILQ_INIT(&pci_driver_list);
TAILQ_INIT(&pci_device_list);
- pci_res_list = RTE_TAILQ_RESERVE_BY_IDX(RTE_TAILQ_PCI,
- mapped_pci_res_list);
+ pci_res_list = RTE_TAILQ_CAST(rte_pci_tailq.head, mapped_pci_res_list);
/* for debug purposes, PCI can be disabled */
if (internal_config.no_pci)
return 0;
/* for debug purposes, PCI can be disabled */
if (internal_config.no_pci)
return 0;
- if (pci_scan() < 0) {
+ if (
rte_eal_
pci_scan() < 0) {
RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__);
return -1;
}
RTE_LOG(ERR, EAL, "%s(): Cannot scan PCI bus\n", __func__);
return -1;
}