event: add new pci-allowed and pci-blocked cmd line params
These replace the pci-whitelist and pci-blacklist params which are now deprecated. pci-blocked will still use the -B short name. pci-allowed will use a new -A short name. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Icf1c46c40ad6a0f49fb539b18cdd8d0c8daac636 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5281 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
9c2b3b3535
commit
5237fe34b7
@ -7,6 +7,12 @@
|
|||||||
The pci_whitelist and pci_blacklist members of struct spdk_app_opts have been
|
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.
|
deprecated. The new members are named pci_allowed and pci_blocked respectively.
|
||||||
|
|
||||||
|
The --pci-blacklist command line option has been deprecated, replaced with
|
||||||
|
--pci-blocked.
|
||||||
|
|
||||||
|
The --pci-whitelist/-W command line options have been deprecated, replaced with
|
||||||
|
--pci-allowed/-A.
|
||||||
|
|
||||||
### 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
|
||||||
|
@ -41,8 +41,8 @@ Param | Long Param | Type | Default | Descript
|
|||||||
| | --silence-noticelog | flag | | disable notice level logging to `stderr`
|
| | --silence-noticelog | flag | | disable notice level logging to `stderr`
|
||||||
-u | --no-pci | flag | | @ref cmd_arg_disable_pci_access.
|
-u | --no-pci | flag | | @ref cmd_arg_disable_pci_access.
|
||||||
| | --wait-for-rpc | flag | | @ref cmd_arg_deferred_initialization
|
| | --wait-for-rpc | flag | | @ref cmd_arg_deferred_initialization
|
||||||
-B | --pci-blacklist | B:D:F | | @ref cmd_arg_pci_blacklist_whitelist.
|
-B | --pci-blocked | B:D:F | | @ref cmd_arg_pci_blocked_allowed.
|
||||||
-W | --pci-whitelist | B:D:F | | @ref cmd_arg_pci_blacklist_whitelist.
|
-A | --pci-allowed | B:D:F | | @ref cmd_arg_pci_blocked_allowed.
|
||||||
-R | --huge-unlink | flag | | @ref cmd_arg_huge_unlink
|
-R | --huge-unlink | flag | | @ref cmd_arg_huge_unlink
|
||||||
| | --huge-dir | string | the first discovered | allocate hugepages from a specific mount
|
| | --huge-dir | string | the first discovered | allocate hugepages from a specific mount
|
||||||
-L | --logflag | string | | @ref cmd_arg_log_flags
|
-L | --logflag | string | | @ref cmd_arg_log_flags
|
||||||
@ -121,12 +121,12 @@ If SPDK is run with PCI access disabled it won't detect any PCI devices. This
|
|||||||
includes primarily NVMe and IOAT devices. Also, the VFIO and UIO kernel modules
|
includes primarily NVMe and IOAT devices. Also, the VFIO and UIO kernel modules
|
||||||
are not required in this mode.
|
are not required in this mode.
|
||||||
|
|
||||||
### PCI address blacklist and whitelist {#cmd_arg_pci_blacklist_whitelist}
|
### PCI address blocked and allowed lists {#cmd_arg_pci_blocked_allowed}
|
||||||
|
|
||||||
If blacklist is used, then all devices with the provided PCI address will be
|
If blocked list is used, then all devices with the provided PCI address will be
|
||||||
ignored. If a whitelist is used, only whitelisted devices will be probed.
|
ignored. If an allowed list is used, only allowed devices will be probed.
|
||||||
`-B` or `-W` can be used more than once, but cannot be mixed together. That is,
|
`-B` or `-A` can be used more than once, but cannot be mixed together. That is,
|
||||||
`-B` and `-W` cannot be used at the same time.
|
`-B` and `-A` cannot be used at the same time.
|
||||||
|
|
||||||
### Unlink hugepage files after initialization {#cmd_arg_huge_unlink}
|
### Unlink hugepage files after initialization {#cmd_arg_huge_unlink}
|
||||||
|
|
||||||
|
@ -107,14 +107,17 @@ static const struct option g_cmdline_options[] = {
|
|||||||
{"no-pci", no_argument, NULL, NO_PCI_OPT_IDX},
|
{"no-pci", no_argument, NULL, NO_PCI_OPT_IDX},
|
||||||
#define VERSION_OPT_IDX 'v'
|
#define VERSION_OPT_IDX 'v'
|
||||||
{"version", no_argument, NULL, VERSION_OPT_IDX},
|
{"version", no_argument, NULL, VERSION_OPT_IDX},
|
||||||
#define PCI_BLACKLIST_OPT_IDX 'B'
|
#define PCI_BLOCKED_OPT_IDX 'B'
|
||||||
{"pci-blacklist", required_argument, NULL, PCI_BLACKLIST_OPT_IDX},
|
{"pci-blocked", required_argument, NULL, PCI_BLOCKED_OPT_IDX},
|
||||||
|
{"pci-blacklist", required_argument, NULL, PCI_BLOCKED_OPT_IDX}, /* deprecated */
|
||||||
#define LOGFLAG_OPT_IDX 'L'
|
#define LOGFLAG_OPT_IDX 'L'
|
||||||
{"logflag", required_argument, NULL, LOGFLAG_OPT_IDX},
|
{"logflag", required_argument, NULL, LOGFLAG_OPT_IDX},
|
||||||
#define HUGE_UNLINK_OPT_IDX 'R'
|
#define HUGE_UNLINK_OPT_IDX 'R'
|
||||||
{"huge-unlink", no_argument, NULL, HUGE_UNLINK_OPT_IDX},
|
{"huge-unlink", no_argument, NULL, HUGE_UNLINK_OPT_IDX},
|
||||||
|
#define PCI_ALLOWED_OPT_IDX 'A'
|
||||||
|
{"pci-allowed", required_argument, NULL, PCI_ALLOWED_OPT_IDX},
|
||||||
#define PCI_WHITELIST_OPT_IDX 'W'
|
#define PCI_WHITELIST_OPT_IDX 'W'
|
||||||
{"pci-whitelist", required_argument, NULL, PCI_WHITELIST_OPT_IDX},
|
{"pci-whitelist", required_argument, NULL, PCI_WHITELIST_OPT_IDX}, /* deprecated */
|
||||||
#define SILENCE_NOTICELOG_OPT_IDX 257
|
#define SILENCE_NOTICELOG_OPT_IDX 257
|
||||||
{"silence-noticelog", no_argument, NULL, SILENCE_NOTICELOG_OPT_IDX},
|
{"silence-noticelog", no_argument, NULL, SILENCE_NOTICELOG_OPT_IDX},
|
||||||
#define WAIT_FOR_RPC_OPT_IDX 258
|
#define WAIT_FOR_RPC_OPT_IDX 258
|
||||||
@ -571,12 +574,12 @@ usage(void (*app_usage)(void))
|
|||||||
printf(" -u, --no-pci disable PCI access\n");
|
printf(" -u, --no-pci disable PCI access\n");
|
||||||
printf(" --wait-for-rpc wait for RPCs to initialize subsystems\n");
|
printf(" --wait-for-rpc wait for RPCs to initialize subsystems\n");
|
||||||
printf(" --max-delay <num> maximum reactor delay (in microseconds)\n");
|
printf(" --max-delay <num> maximum reactor delay (in microseconds)\n");
|
||||||
printf(" -B, --pci-blacklist <bdf>\n");
|
printf(" -B, --pci-blocked <bdf>\n");
|
||||||
printf(" pci addr to blacklist (can be used more than once)\n");
|
printf(" pci addr to block (can be used more than once)\n");
|
||||||
printf(" -R, --huge-unlink unlink huge files after initialization\n");
|
printf(" -R, --huge-unlink unlink huge files after initialization\n");
|
||||||
printf(" -v, --version print SPDK version\n");
|
printf(" -v, --version print SPDK version\n");
|
||||||
printf(" -W, --pci-whitelist <bdf>\n");
|
printf(" -A, --pci-allowed <bdf>\n");
|
||||||
printf(" pci addr to whitelist (-B and -W cannot be used at the same time)\n");
|
printf(" pci addr to allow (-B and -A cannot be used at the same time)\n");
|
||||||
printf(" --huge-dir <path> use a specific hugetlbfs mount to reserve memory from\n");
|
printf(" --huge-dir <path> use a specific hugetlbfs mount to reserve memory from\n");
|
||||||
printf(" --iova-mode <pa/va> set IOVA mode ('pa' for IOVA_PA and 'va' for IOVA_VA)\n");
|
printf(" --iova-mode <pa/va> set IOVA mode ('pa' for IOVA_PA and 'va' for IOVA_VA)\n");
|
||||||
printf(" --base-virtaddr <addr> the base virtual address for DPDK (default: 0x200000000000)\n");
|
printf(" --base-virtaddr <addr> the base virtual address for DPDK (default: 0x200000000000)\n");
|
||||||
@ -737,11 +740,11 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
|
|||||||
case WAIT_FOR_RPC_OPT_IDX:
|
case WAIT_FOR_RPC_OPT_IDX:
|
||||||
opts->delay_subsystem_init = true;
|
opts->delay_subsystem_init = true;
|
||||||
break;
|
break;
|
||||||
case PCI_BLACKLIST_OPT_IDX:
|
case PCI_BLOCKED_OPT_IDX:
|
||||||
if (opts->pci_allowed) {
|
if (opts->pci_allowed) {
|
||||||
free(opts->pci_allowed);
|
free(opts->pci_allowed);
|
||||||
opts->pci_allowed = NULL;
|
opts->pci_allowed = NULL;
|
||||||
SPDK_ERRLOG("-B and -W cannot be used at the same time\n");
|
SPDK_ERRLOG("-B and -A cannot be used at the same time\n");
|
||||||
usage(app_usage);
|
usage(app_usage);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -768,6 +771,9 @@ 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:
|
||||||
|
SPDK_WARNLOG("-W/--pci-whitelist is deprecated. Use -A/--pci-allowed.\n");
|
||||||
|
/* fallthrough */
|
||||||
|
case PCI_ALLOWED_OPT_IDX:
|
||||||
if (opts->pci_blocked) {
|
if (opts->pci_blocked) {
|
||||||
free(opts->pci_blocked);
|
free(opts->pci_blocked);
|
||||||
opts->pci_blocked = NULL;
|
opts->pci_blocked = NULL;
|
||||||
|
@ -115,7 +115,7 @@ _spdk_opt_to_complete() {
|
|||||||
local opt=$1
|
local opt=$1
|
||||||
|
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
--pci-blacklist | -B | --pci-whitelist | -W)
|
--pci-blocked | -B | --pci-allowed | -A)
|
||||||
local pcis
|
local pcis
|
||||||
if [[ -e /sys/bus/pci/devices ]]; then
|
if [[ -e /sys/bus/pci/devices ]]; then
|
||||||
pcis=(/sys/bus/pci/devices/*)
|
pcis=(/sys/bus/pci/devices/*)
|
||||||
|
Loading…
Reference in New Issue
Block a user