Commit 36644ef3 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

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: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I5f1727d465eaa73cf71d2f3589cecd3ebb83eb85
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14531


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 2bb7185f
Loading
Loading
Loading
Loading
+2 −19
Original line number Diff line number Diff line
@@ -13,10 +13,6 @@
#include <rte_config.h>
#include <rte_version.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)
#error RTE_VERSION is too old! Minimum 19.11 is required.
@@ -31,27 +27,14 @@
#define SHIFT_1GB	30 /* (1 << 30) == 1 GB */
#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_reinit(void);
void pci_env_fini(void);
int mem_map_init(bool legacy_mem);
int vtophys_init(void);

struct rte_pci_device;

uint64_t dpdk_pci_device_vtophys(struct rte_pci_device *dev, uint64_t vaddr);

/**
+16 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#include "env_internal.h"

#include <rte_alarm.h>
#include <rte_bus_pci.h>
#include <rte_devargs.h>
#include "spdk/env.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 =
	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 rte_bus	*bus;
	char		name[128];