Commit ac9895f7 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

env: move struct spdk_pci_device to public headers



In order to populate our PCI device list with devices
located behind the VMD, we'll need to fill out those
device structures from within a special VMD driver. That
driver will base on PCI configuration and BAR accesses,
but definitely not on DPDK. We want to put the VMD driver
outside of the env lib, so we provide it with a direct
access to the device struct.

Change-Id: Iabddf361a805e69d7e857c2d07ceaed36aca261d
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/435800


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent df4d03f1
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#define SPDK_ENV_H

#include "spdk/stdinc.h"
#include "spdk/queue.h"

#ifdef __cplusplus
extern "C" {
@@ -66,8 +67,6 @@ extern "C" {
 */
#define SPDK_MEMZONE_NO_IOVA_CONTIG 0x00100000 /**< no iova contiguity */

struct spdk_pci_device;

/**
 * \brief Environment initialization options
 */
@@ -595,6 +594,19 @@ struct spdk_pci_id {
	uint16_t	subdevice_id;
};

struct spdk_pci_device {
	void				*dev_handle;
	struct spdk_pci_addr		addr;
	struct spdk_pci_id		id;
	int				socket_id;

	struct _spdk_pci_device_internal {
		struct spdk_pci_driver		*driver;
		bool				attached;
		TAILQ_ENTRY(spdk_pci_device)	tailq;
	} internal;
};

typedef int (*spdk_pci_enum_cb)(void *enum_ctx, struct spdk_pci_device *pci_dev);

/**
+0 −13
Original line number Diff line number Diff line
@@ -78,19 +78,6 @@ __attribute__((constructor)) static void pci_drv ## _register(void) \
	spdk_pci_driver_register(&pci_drv);								\
}

struct spdk_pci_device {
	void				*dev_handle;
	struct spdk_pci_addr		addr;
	struct spdk_pci_id		id;
	int				socket_id;

	struct _spdk_pci_device_internal {
		struct spdk_pci_driver		*driver;
		bool				attached;
		TAILQ_ENTRY(spdk_pci_device)	tailq;
	} internal;
};

struct spdk_pci_driver {
	struct rte_pci_driver		driver;
	spdk_pci_enum_cb		cb_fn;