Commit 4a6a2824 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

env: add pci_allowed/pci_blocked to spdk_env_opts



The old pci_whitelist/pci_blacklist are now deprecated.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I9fddec0c90691dd385eb21d13be849247f144889
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5279


Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent ddd71f93
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@

## v21.01: (Upcoming Release)

### env

The pci_whitelist and pci_blacklist members of struct spdk_env_opts have been
deprecated.  The new members are named pci_allowed and pci_blocked respectively.

### nvmf

The functions `destroy` and `qpair_fini` in the transport interface now accept a
+1 −1
Original line number Diff line number Diff line
@@ -2334,7 +2334,7 @@ int main(int argc, char **argv)
	}

	if (g_allowed_pci_addr_num) {
		opts.pci_whitelist = g_allowed_pci_addr;
		opts.pci_allowed = g_allowed_pci_addr;
		opts.num_pci_addr = g_allowed_pci_addr_num;
	}
	if (spdk_env_init(&opts) < 0) {
+9 −3
Original line number Diff line number Diff line
@@ -83,8 +83,14 @@ struct spdk_env_opts {
	bool			unlink_hugepage;
	size_t			num_pci_addr;
	const char		*hugedir;
	struct spdk_pci_addr	*pci_blacklist;
	struct spdk_pci_addr	*pci_whitelist;
	union {
		struct spdk_pci_addr	*pci_blocked;
		struct spdk_pci_addr	*pci_blacklist __attribute__((deprecated));
	};
	union {
		struct spdk_pci_addr	*pci_allowed;
		struct spdk_pci_addr	*pci_whitelist __attribute__((deprecated));
	};
	const char		*iova_mode;
	uint64_t		base_virtaddr;

@@ -980,7 +986,7 @@ void spdk_pci_device_unclaim(struct spdk_pci_device *dev);
void spdk_pci_device_detach(struct spdk_pci_device *device);

/**
 * Attach a PCI device. This will bypass all blacklist rules and explicitly
 * Attach a PCI device. This will bypass all blocked list rules and explicitly
 * attach a device at the provided address. The return code of the provided
 * callback will decide whether that device is attached or not. Attached
 * devices have to be manually detached with spdk_pci_device_detach() to be
+5 −5
Original line number Diff line number Diff line
@@ -53,11 +53,11 @@
#define SPDK_ENV_DPDK_DEFAULT_BASE_VIRTADDR	0x200000000000

#if RTE_VERSION < RTE_VERSION_NUM(20, 11, 0, 0)
#define DPDK_ALLOW_PARAM	"--allow"
#define DPDK_BLOCK_PARAM	"--block"
#else
#define DPDK_ALLOW_PARAM	"--pci-whitelist"
#define DPDK_BLOCK_PARAM	"--pci-blacklist"
#else
#define DPDK_ALLOW_PARAM	"--allow"
#define DPDK_BLOCK_PARAM	"--block"
#endif

static char **g_eal_cmdline;
@@ -348,12 +348,12 @@ build_eal_cmdline(const struct spdk_env_opts *opts)
		size_t i;
		char bdf[32];
		struct spdk_pci_addr *pci_addr =
				opts->pci_blacklist ? opts->pci_blacklist : opts->pci_whitelist;
				opts->pci_blocked ? opts->pci_blocked : opts->pci_allowed;

		for (i = 0; i < opts->num_pci_addr; i++) {
			spdk_pci_addr_fmt(bdf, 32, &pci_addr[i]);
			args = push_arg(args, &argcount, _sprintf_alloc("%s=%s",
					(opts->pci_blacklist ? DPDK_BLOCK_PARAM : DPDK_ALLOW_PARAM),
					(opts->pci_blocked ? DPDK_BLOCK_PARAM : DPDK_ALLOW_PARAM),
					bdf));
			if (args == NULL) {
				return -1;
+4 −4
Original line number Diff line number Diff line
@@ -316,15 +316,15 @@ app_setup_env(struct spdk_app_opts *opts)
	env_opts.hugedir = opts->hugedir;
	env_opts.no_pci = opts->no_pci;
	env_opts.num_pci_addr = opts->num_pci_addr;
	env_opts.pci_blacklist = opts->pci_blacklist;
	env_opts.pci_whitelist = opts->pci_whitelist;
	env_opts.pci_blocked = opts->pci_blacklist;
	env_opts.pci_allowed = opts->pci_whitelist;
	env_opts.base_virtaddr = opts->base_virtaddr;
	env_opts.env_context = opts->env_context;
	env_opts.iova_mode = opts->iova_mode;

	rc = spdk_env_init(&env_opts);
	free(env_opts.pci_blacklist);
	free(env_opts.pci_whitelist);
	free(env_opts.pci_blocked);
	free(env_opts.pci_allowed);

	if (rc < 0) {
		SPDK_ERRLOG("Unable to initialize SPDK env\n");
Loading