env_dpdk: move spdk_pci_driver definition to pci.c
Also remove all pci-related DPDK includes from env_internal.h, and add rte_bus_pci.h to pci.c only. Now pci.c has all references to DPDK pci-related header files and data structures. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I5f1727d465eaa73cf71d2f3589cecd3ebb83eb85 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14531 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
2bb7185f1b
commit
36644ef32f
@ -13,10 +13,6 @@
|
|||||||
#include <rte_config.h>
|
#include <rte_config.h>
|
||||||
#include <rte_version.h>
|
#include <rte_version.h>
|
||||||
#include <rte_eal.h>
|
#include <rte_eal.h>
|
||||||
#include <rte_bus.h>
|
|
||||||
#include <rte_pci.h>
|
|
||||||
#include <rte_bus_pci.h>
|
|
||||||
#include <rte_dev.h>
|
|
||||||
|
|
||||||
#if RTE_VERSION < RTE_VERSION_NUM(19, 11, 0, 0)
|
#if RTE_VERSION < RTE_VERSION_NUM(19, 11, 0, 0)
|
||||||
#error RTE_VERSION is too old! Minimum 19.11 is required.
|
#error RTE_VERSION is too old! Minimum 19.11 is required.
|
||||||
@ -31,27 +27,14 @@
|
|||||||
#define SHIFT_1GB 30 /* (1 << 30) == 1 GB */
|
#define SHIFT_1GB 30 /* (1 << 30) == 1 GB */
|
||||||
#define MASK_1GB ((1ULL << SHIFT_1GB) - 1)
|
#define MASK_1GB ((1ULL << SHIFT_1GB) - 1)
|
||||||
|
|
||||||
struct spdk_pci_driver {
|
|
||||||
struct rte_pci_driver driver;
|
|
||||||
|
|
||||||
const char *name;
|
|
||||||
const struct spdk_pci_id *id_table;
|
|
||||||
uint32_t drv_flags;
|
|
||||||
|
|
||||||
spdk_pci_enum_cb cb_fn;
|
|
||||||
void *cb_arg;
|
|
||||||
TAILQ_ENTRY(spdk_pci_driver) tailq;
|
|
||||||
};
|
|
||||||
|
|
||||||
int pci_device_init(struct rte_pci_driver *driver, struct rte_pci_device *device);
|
|
||||||
int pci_device_fini(struct rte_pci_device *device);
|
|
||||||
|
|
||||||
void pci_env_init(void);
|
void pci_env_init(void);
|
||||||
void pci_env_reinit(void);
|
void pci_env_reinit(void);
|
||||||
void pci_env_fini(void);
|
void pci_env_fini(void);
|
||||||
int mem_map_init(bool legacy_mem);
|
int mem_map_init(bool legacy_mem);
|
||||||
int vtophys_init(void);
|
int vtophys_init(void);
|
||||||
|
|
||||||
|
struct rte_pci_device;
|
||||||
|
|
||||||
uint64_t dpdk_pci_device_vtophys(struct rte_pci_device *dev, uint64_t vaddr);
|
uint64_t dpdk_pci_device_vtophys(struct rte_pci_device *dev, uint64_t vaddr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "env_internal.h"
|
#include "env_internal.h"
|
||||||
|
|
||||||
#include <rte_alarm.h>
|
#include <rte_alarm.h>
|
||||||
|
#include <rte_bus_pci.h>
|
||||||
#include <rte_devargs.h>
|
#include <rte_devargs.h>
|
||||||
#include "spdk/env.h"
|
#include "spdk/env.h"
|
||||||
#include "spdk/log.h"
|
#include "spdk/log.h"
|
||||||
@ -38,6 +39,21 @@ static TAILQ_HEAD(, spdk_pci_driver) g_pci_drivers = TAILQ_HEAD_INITIALIZER(g_pc
|
|||||||
static TAILQ_HEAD(, spdk_pci_device_provider) g_pci_device_providers =
|
static TAILQ_HEAD(, spdk_pci_device_provider) g_pci_device_providers =
|
||||||
TAILQ_HEAD_INITIALIZER(g_pci_device_providers);
|
TAILQ_HEAD_INITIALIZER(g_pci_device_providers);
|
||||||
|
|
||||||
|
struct spdk_pci_driver {
|
||||||
|
struct rte_pci_driver driver;
|
||||||
|
|
||||||
|
const char *name;
|
||||||
|
const struct spdk_pci_id *id_table;
|
||||||
|
uint32_t drv_flags;
|
||||||
|
|
||||||
|
spdk_pci_enum_cb cb_fn;
|
||||||
|
void *cb_arg;
|
||||||
|
TAILQ_ENTRY(spdk_pci_driver) tailq;
|
||||||
|
};
|
||||||
|
|
||||||
|
int pci_device_init(struct rte_pci_driver *driver, struct rte_pci_device *device);
|
||||||
|
int pci_device_fini(struct rte_pci_device *device);
|
||||||
|
|
||||||
struct env_devargs {
|
struct env_devargs {
|
||||||
struct rte_bus *bus;
|
struct rte_bus *bus;
|
||||||
char name[128];
|
char name[128];
|
||||||
|
Loading…
Reference in New Issue
Block a user