env: add pci_allowed/pci_blocked to spdk_env_opts
The old pci_whitelist/pci_blacklist are now deprecated. Signed-off-by: Jim 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: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
ddd71f939d
commit
4a6a282411
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -54,6 +54,8 @@ function confirm_abi_deps() {
|
||||
[suppress_type]
|
||||
type_kind = enum
|
||||
changed_enumerators = SPDK_BDEV_NUM_IO_TYPES
|
||||
[suppress_type]
|
||||
name = spdk_env_opts
|
||||
EOF
|
||||
|
||||
for object in "$libdir"/libspdk_*.so; do
|
||||
|
Loading…
Reference in New Issue
Block a user