event: add pci_allowed/pci_blocked to spdk_app_opts
The old terms pci_whitelist/pci_blacklist are now deprecated. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I6350a6dbe21ceb5965b30241899eead651834dca Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5280 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
4a6a282411
commit
9c2b3b3535
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
## v21.01: (Upcoming Release)
|
## v21.01: (Upcoming Release)
|
||||||
|
|
||||||
|
### event
|
||||||
|
|
||||||
|
The pci_whitelist and pci_blacklist members of struct spdk_app_opts have been
|
||||||
|
deprecated. The new members are named pci_allowed and pci_blocked respectively.
|
||||||
|
|
||||||
### env
|
### env
|
||||||
|
|
||||||
The pci_whitelist and pci_blacklist members of struct spdk_env_opts have been
|
The pci_whitelist and pci_blacklist members of struct spdk_env_opts have been
|
||||||
|
@ -110,8 +110,14 @@ struct spdk_app_opts {
|
|||||||
const char *hugedir;
|
const char *hugedir;
|
||||||
enum spdk_log_level print_level;
|
enum spdk_log_level print_level;
|
||||||
size_t num_pci_addr;
|
size_t num_pci_addr;
|
||||||
struct spdk_pci_addr *pci_blacklist;
|
union {
|
||||||
struct spdk_pci_addr *pci_whitelist;
|
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;
|
const char *iova_mode;
|
||||||
|
|
||||||
/* DEPRECATED. No longer has any effect.
|
/* DEPRECATED. No longer has any effect.
|
||||||
|
@ -316,8 +316,8 @@ app_setup_env(struct spdk_app_opts *opts)
|
|||||||
env_opts.hugedir = opts->hugedir;
|
env_opts.hugedir = opts->hugedir;
|
||||||
env_opts.no_pci = opts->no_pci;
|
env_opts.no_pci = opts->no_pci;
|
||||||
env_opts.num_pci_addr = opts->num_pci_addr;
|
env_opts.num_pci_addr = opts->num_pci_addr;
|
||||||
env_opts.pci_blocked = opts->pci_blacklist;
|
env_opts.pci_blocked = opts->pci_blocked;
|
||||||
env_opts.pci_allowed = opts->pci_whitelist;
|
env_opts.pci_allowed = opts->pci_allowed;
|
||||||
env_opts.base_virtaddr = opts->base_virtaddr;
|
env_opts.base_virtaddr = opts->base_virtaddr;
|
||||||
env_opts.env_context = opts->env_context;
|
env_opts.env_context = opts->env_context;
|
||||||
env_opts.iova_mode = opts->iova_mode;
|
env_opts.iova_mode = opts->iova_mode;
|
||||||
@ -738,18 +738,18 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
|
|||||||
opts->delay_subsystem_init = true;
|
opts->delay_subsystem_init = true;
|
||||||
break;
|
break;
|
||||||
case PCI_BLACKLIST_OPT_IDX:
|
case PCI_BLACKLIST_OPT_IDX:
|
||||||
if (opts->pci_whitelist) {
|
if (opts->pci_allowed) {
|
||||||
free(opts->pci_whitelist);
|
free(opts->pci_allowed);
|
||||||
opts->pci_whitelist = NULL;
|
opts->pci_allowed = NULL;
|
||||||
SPDK_ERRLOG("-B and -W cannot be used at the same time\n");
|
SPDK_ERRLOG("-B and -W cannot be used at the same time\n");
|
||||||
usage(app_usage);
|
usage(app_usage);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = app_opts_add_pci_addr(opts, &opts->pci_blacklist, optarg);
|
rc = app_opts_add_pci_addr(opts, &opts->pci_blocked, optarg);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
free(opts->pci_blacklist);
|
free(opts->pci_blocked);
|
||||||
opts->pci_blacklist = NULL;
|
opts->pci_blocked = NULL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -768,18 +768,18 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
|
|||||||
opts->unlink_hugepage = true;
|
opts->unlink_hugepage = true;
|
||||||
break;
|
break;
|
||||||
case PCI_WHITELIST_OPT_IDX:
|
case PCI_WHITELIST_OPT_IDX:
|
||||||
if (opts->pci_blacklist) {
|
if (opts->pci_blocked) {
|
||||||
free(opts->pci_blacklist);
|
free(opts->pci_blocked);
|
||||||
opts->pci_blacklist = NULL;
|
opts->pci_blocked = NULL;
|
||||||
SPDK_ERRLOG("-B and -W cannot be used at the same time\n");
|
SPDK_ERRLOG("-B and -W cannot be used at the same time\n");
|
||||||
usage(app_usage);
|
usage(app_usage);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = app_opts_add_pci_addr(opts, &opts->pci_whitelist, optarg);
|
rc = app_opts_add_pci_addr(opts, &opts->pci_allowed, optarg);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
free(opts->pci_whitelist);
|
free(opts->pci_allowed);
|
||||||
opts->pci_whitelist = NULL;
|
opts->pci_allowed = NULL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -844,10 +844,10 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
|
|||||||
retval = SPDK_APP_PARSE_ARGS_SUCCESS;
|
retval = SPDK_APP_PARSE_ARGS_SUCCESS;
|
||||||
out:
|
out:
|
||||||
if (retval != SPDK_APP_PARSE_ARGS_SUCCESS) {
|
if (retval != SPDK_APP_PARSE_ARGS_SUCCESS) {
|
||||||
free(opts->pci_blacklist);
|
free(opts->pci_blocked);
|
||||||
opts->pci_blacklist = NULL;
|
opts->pci_blocked = NULL;
|
||||||
free(opts->pci_whitelist);
|
free(opts->pci_allowed);
|
||||||
opts->pci_whitelist = NULL;
|
opts->pci_allowed = NULL;
|
||||||
}
|
}
|
||||||
free(cmdline_short_opts);
|
free(cmdline_short_opts);
|
||||||
free(cmdline_options);
|
free(cmdline_options);
|
||||||
|
@ -56,6 +56,8 @@ function confirm_abi_deps() {
|
|||||||
changed_enumerators = SPDK_BDEV_NUM_IO_TYPES
|
changed_enumerators = SPDK_BDEV_NUM_IO_TYPES
|
||||||
[suppress_type]
|
[suppress_type]
|
||||||
name = spdk_env_opts
|
name = spdk_env_opts
|
||||||
|
[suppress_type]
|
||||||
|
name = spdk_app_opts
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
for object in "$libdir"/libspdk_*.so; do
|
for object in "$libdir"/libspdk_*.so; do
|
||||||
|
@ -72,10 +72,10 @@ unittest_parse_args(int ch, char *arg)
|
|||||||
static void
|
static void
|
||||||
clean_opts(struct spdk_app_opts *opts)
|
clean_opts(struct spdk_app_opts *opts)
|
||||||
{
|
{
|
||||||
free(opts->pci_whitelist);
|
free(opts->pci_allowed);
|
||||||
opts->pci_whitelist = NULL;
|
opts->pci_allowed = NULL;
|
||||||
free(opts->pci_blacklist);
|
free(opts->pci_blocked);
|
||||||
opts->pci_blacklist = NULL;
|
opts->pci_blocked = NULL;
|
||||||
memset(opts, 0, sizeof(struct spdk_app_opts));
|
memset(opts, 0, sizeof(struct spdk_app_opts));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user