rpc: add default UNIX domain socket listen address
RPC is a default feature required for almost all usages, so enable RPC by default, but with a UNIX domain socket for security reasons. -r can now be used from the command line to specify an alternative RPC listen address from the default /var/tmp/spdk.sock. Remove the Enable parameter from the Rpc config section but still allow specifying an alternative listen address using the Listen parameter as an alternative to the command line option. This keeps backward compatibility for this release for anyone using the configuration file still. Remove the Rpc sections from all configuration files that were using them, except for those that specified alternate TCP ports for multi-process test cases. We can fix these later to use an alternate UNIX domain socket and to use the command line instead. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ife0d03fcab638c67b659f1eb85348ddc2b55c4c4 Reviewed-on: https://review.gerrithub.io/386561 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
fbb9430ec4
commit
6bef902ca5
@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## v18.01
|
||||
|
||||
### RPC
|
||||
|
||||
A JSON RPC listener is now enabled by default using a UNIX domain socket at /var/run/spdk.sock.
|
||||
A -r option command line option has been added to enable an alternative UNIX domain socket location,
|
||||
or a TCP port in the format ip_addr:tcp_port (i.e. 127.0.0.1:5260). The Rpc configuration file
|
||||
section is now deprecated and will be removed in the v18.04 release.
|
||||
|
||||
## v17.10: Logical Volumes
|
||||
|
||||
### New dependencies
|
||||
|
@ -42,6 +42,8 @@ fi
|
||||
|
||||
# Make sure the disks are clean (no leftover partition tables)
|
||||
timing_enter cleanup
|
||||
# Remove old domain socket pathname just in case
|
||||
rm -f $DEFAULT_RPC_ADDR
|
||||
if [ $(uname -s) = Linux ]; then
|
||||
# Load the kernel driver
|
||||
./scripts/setup.sh reset
|
||||
|
@ -62,16 +62,6 @@
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
|
||||
[Rpc]
|
||||
# Defines whether to enable configuration via RPC.
|
||||
# Default is disabled. Note that the RPC interface is not
|
||||
# authenticated, so users should be careful about enabling
|
||||
# RPC in non-trusted environments.
|
||||
Enable No
|
||||
# Listen address for the RPC service.
|
||||
# May be an IP address or an absolute path to a Unix socket.
|
||||
Listen 127.0.0.1
|
||||
|
||||
# Users must change the PortalGroup section(s) to match the IP addresses
|
||||
# for their environment.
|
||||
# PortalGroup sections define which TCP ports the iSCSI server will use
|
||||
|
@ -20,16 +20,6 @@
|
||||
# Set to 0xFFFFFFFFFFFFFFFF to enable all tracepoint groups.
|
||||
#TpointGroupMask 0x0
|
||||
|
||||
[Rpc]
|
||||
# Defines whether to enable configuration via RPC.
|
||||
# Default is disabled. Note that the RPC interface is not
|
||||
# authenticated, so users should be careful about enabling
|
||||
# RPC in non-trusted environments.
|
||||
Enable No
|
||||
# Listen address for the RPC service.
|
||||
# May be an IP address or an absolute path to a Unix socket.
|
||||
Listen 127.0.0.1
|
||||
|
||||
# Users may change this section to create a different number or size of
|
||||
# malloc LUNs.
|
||||
# This will generate 8 LUNs with a malloc-allocated backend.
|
||||
|
@ -16,13 +16,6 @@
|
||||
# on all cores.
|
||||
#ReactorMask 0x1
|
||||
|
||||
[Rpc]
|
||||
# Defines whether spdk will enable configuration via RPC.
|
||||
# Default is disabled. Note that the RPC interface is not
|
||||
# authenticated, so users should be careful about enabling
|
||||
# RPC in non-trusted environments.
|
||||
#Enable No
|
||||
|
||||
[Ioat]
|
||||
Disable Yes
|
||||
|
||||
|
@ -29,16 +29,6 @@
|
||||
# Set to 0xFFFFFFFFFFFFFFFF to enable all tracepoint groups.
|
||||
#TpointGroupMask 0x0
|
||||
|
||||
[Rpc]
|
||||
# Defines whether SPDK vhost will enable configuration via RPC.
|
||||
# Default is disabled. Note that the RPC interface is not
|
||||
# authenticated, so users should be careful about enabling
|
||||
# RPC in non-trusted environments.
|
||||
Enable No
|
||||
# Listen address for the RPC service.
|
||||
# May be an IP address or an absolute path to a Unix socket.
|
||||
Listen 127.0.0.1
|
||||
|
||||
# Users may not want to use offload even it is available.
|
||||
# Users may use the whitelist to initialize specified devices, IDS
|
||||
# uses BUS:DEVICE.FUNCTION to identify each Ioat channel.
|
||||
|
@ -63,12 +63,15 @@ struct spdk_poller;
|
||||
typedef void (*spdk_app_shutdown_cb)(void);
|
||||
typedef void (*spdk_sighandler_t)(int);
|
||||
|
||||
#define SPDK_DEFAULT_RPC_ADDR "/var/tmp/spdk.sock"
|
||||
|
||||
/**
|
||||
* \brief Event framework initialization options
|
||||
*/
|
||||
struct spdk_app_opts {
|
||||
const char *name;
|
||||
const char *config_file;
|
||||
const char *rpc_addr; /* Can be UNIX domain socket path or IP address + TCP port */
|
||||
const char *reactor_mask;
|
||||
const char *tpoint_group_mask;
|
||||
|
||||
@ -152,7 +155,7 @@ int spdk_app_get_core_count(void) __attribute__((deprecated));
|
||||
*/
|
||||
uint32_t spdk_app_get_current_core(void) __attribute__((deprecated));
|
||||
|
||||
#define SPDK_APP_GETOPT_STRING "c:de:hi:m:n:p:qs:t:"
|
||||
#define SPDK_APP_GETOPT_STRING "c:de:hi:m:n:p:qr:s:t:"
|
||||
|
||||
/**
|
||||
* \brief Helper function for parsing arguments and printing usage messages.
|
||||
|
@ -76,7 +76,7 @@ void spdk_subsystem_init_next(int rc);
|
||||
void spdk_subsystem_fini_next(void);
|
||||
void spdk_subsystem_config(FILE *fp);
|
||||
|
||||
void spdk_rpc_initialize(void);
|
||||
void spdk_rpc_initialize(const char *listen_addr);
|
||||
void spdk_rpc_finish(void);
|
||||
void spdk_rpc_config_text(FILE *fp);
|
||||
|
||||
|
@ -194,6 +194,7 @@ spdk_app_opts_init(struct spdk_app_opts *opts)
|
||||
opts->reactor_mask = NULL;
|
||||
opts->max_delay_us = 0;
|
||||
opts->print_level = SPDK_LOG_NOTICE;
|
||||
opts->rpc_addr = SPDK_DEFAULT_RPC_ADDR;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -256,7 +257,9 @@ spdk_app_setup_signal_handlers(struct spdk_app_opts *opts)
|
||||
static void
|
||||
start_rpc(void *arg1, void *arg2)
|
||||
{
|
||||
spdk_rpc_initialize();
|
||||
const char *rpc_addr = arg1;
|
||||
|
||||
spdk_rpc_initialize(rpc_addr);
|
||||
g_app_start_fn(g_app_start_arg1, g_app_start_arg2);
|
||||
}
|
||||
|
||||
@ -407,7 +410,7 @@ spdk_app_start(struct spdk_app_opts *opts, spdk_event_fn start_fn,
|
||||
g_app_start_fn = start_fn;
|
||||
g_app_start_arg1 = arg1;
|
||||
g_app_start_arg2 = arg2;
|
||||
app_start_event = spdk_event_allocate(g_init_lcore, start_rpc, NULL, NULL);
|
||||
app_start_event = spdk_event_allocate(g_init_lcore, start_rpc, (void *)opts->rpc_addr, NULL);
|
||||
|
||||
spdk_subsystem_init(app_start_event);
|
||||
|
||||
@ -462,6 +465,7 @@ usage(char *executable_name, struct spdk_app_opts *default_opts, void (*app_usag
|
||||
printf(" -n channel number of memory channels used for DPDK\n");
|
||||
printf(" -p core master (primary) core for DPDK\n");
|
||||
printf(" -q disable notice level logging to stderr\n");
|
||||
printf(" -r RPC listen address (default %s)\n", SPDK_DEFAULT_RPC_ADDR);
|
||||
printf(" -s size memory size in MB for DPDK (default: ");
|
||||
if (default_opts->mem_size > 0) {
|
||||
printf("%dMB)\n", default_opts->mem_size);
|
||||
@ -522,6 +526,9 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
|
||||
case 'q':
|
||||
opts->print_level = SPDK_LOG_WARN;
|
||||
break;
|
||||
case 'r':
|
||||
opts->rpc_addr = optarg;
|
||||
break;
|
||||
case 's':
|
||||
opts->mem_size = atoi(optarg);
|
||||
break;
|
||||
|
@ -41,40 +41,20 @@
|
||||
#include "spdk_internal/event.h"
|
||||
|
||||
#define RPC_SELECT_INTERVAL 4000 /* 4ms */
|
||||
#define RPC_DEFAULT_LISTEN_ADDR "127.0.0.1:5260"
|
||||
|
||||
static struct spdk_poller *g_rpc_poller = NULL;
|
||||
|
||||
static int
|
||||
enable_rpc(void)
|
||||
{
|
||||
struct spdk_conf_section *sp;
|
||||
|
||||
sp = spdk_conf_find_section(NULL, "Rpc");
|
||||
if (sp == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return spdk_conf_section_get_boolval(sp, "Enable", false);
|
||||
}
|
||||
|
||||
static const char *
|
||||
rpc_get_listen_addr(void)
|
||||
{
|
||||
struct spdk_conf_section *sp;
|
||||
const char *val;
|
||||
|
||||
sp = spdk_conf_find_section(NULL, "Rpc");
|
||||
if (sp == NULL) {
|
||||
return RPC_DEFAULT_LISTEN_ADDR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
val = spdk_conf_section_get_val(sp, "Listen");
|
||||
if (val == NULL) {
|
||||
val = RPC_DEFAULT_LISTEN_ADDR;
|
||||
}
|
||||
|
||||
return val;
|
||||
return spdk_conf_section_get_val(sp, "Listen");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -84,18 +64,16 @@ spdk_rpc_subsystem_poll(void *arg)
|
||||
}
|
||||
|
||||
void
|
||||
spdk_rpc_initialize(void)
|
||||
spdk_rpc_initialize(const char *listen_addr)
|
||||
{
|
||||
const char *listen_addr;
|
||||
int rc;
|
||||
|
||||
if (!enable_rpc()) {
|
||||
return;
|
||||
if (rpc_get_listen_addr() != NULL) {
|
||||
listen_addr = rpc_get_listen_addr();
|
||||
}
|
||||
|
||||
listen_addr = rpc_get_listen_addr();
|
||||
if (listen_addr == NULL) {
|
||||
listen_addr = RPC_DEFAULT_LISTEN_ADDR;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Listen on the requested address */
|
||||
@ -123,13 +101,7 @@ spdk_rpc_config_text(FILE *fp)
|
||||
fprintf(fp,
|
||||
"\n"
|
||||
"[Rpc]\n"
|
||||
" # Defines whether to enable configuration via RPC.\n"
|
||||
" # Default is disabled. Note that the RPC interface is not\n"
|
||||
" # authenticated, so users should be careful about enabling\n"
|
||||
" # RPC in non-trusted environments.\n"
|
||||
" Enable %s\n"
|
||||
" # Listen address for the RPC service.\n"
|
||||
" # May be an IP address or an absolute path to a Unix socket.\n"
|
||||
" Listen %s\n",
|
||||
enable_rpc() ? "Yes" : "No", rpc_get_listen_addr());
|
||||
" Listen %s\n", rpc_get_listen_addr());
|
||||
}
|
||||
|
@ -76,9 +76,6 @@
|
||||
"\n" \
|
||||
" ImmediateData %s\n" \
|
||||
" ErrorRecoveryLevel %d\n" \
|
||||
"\n" \
|
||||
" # Defines whether iSCSI target will enable configuration via RPC\n" \
|
||||
" # RpcConfiguration Yes\n" \
|
||||
"\n"
|
||||
|
||||
static void
|
||||
|
@ -93,7 +93,10 @@ spdk_rpc_listen(const char *listen_addr)
|
||||
return -1;
|
||||
}
|
||||
|
||||
unlink(g_rpc_listen_addr_unix.sun_path);
|
||||
if (access(g_rpc_listen_addr_unix.sun_path, F_OK) == 0) {
|
||||
SPDK_ERRLOG("RPC Unix domain socket path already exists.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
g_jsonrpc_server = spdk_jsonrpc_server_listen(AF_UNIX, 0,
|
||||
(struct sockaddr *)&g_rpc_listen_addr_unix,
|
||||
|
@ -46,6 +46,8 @@ export SPDK_GPT_GUID=`grep SPDK_GPT_PART_TYPE_GUID $rootdir/lib/bdev/gpt/gpt.h \
|
||||
# Override the default HUGEMEM in scripts/setup.sh
|
||||
export HUGEMEM=8192
|
||||
|
||||
DEFAULT_RPC_ADDR=/var/tmp/spdk.sock
|
||||
|
||||
case `uname` in
|
||||
FreeBSD)
|
||||
DPDK_FREEBSD_DIR=/usr/local/share/dpdk/x86_64-native-bsdapp-clang
|
||||
@ -179,6 +181,29 @@ function process_core() {
|
||||
}
|
||||
|
||||
function waitforlisten() {
|
||||
# $1 = process pid
|
||||
if [ -z "$1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Waiting for process to start up and listen on UNIX domain socket $DEFAULT_RPC_ADDR..."
|
||||
# turn off trace for this loop
|
||||
set +x
|
||||
ret=1
|
||||
while [ $ret -ne 0 ]; do
|
||||
# if the process is no longer running, then exit the script
|
||||
# since it means the application crashed
|
||||
if ! kill -s 0 $1; then
|
||||
exit
|
||||
fi
|
||||
if netstat -an -x | grep -iw LISTENING | grep -q $DEFAULT_RPC_ADDR; then
|
||||
ret=0
|
||||
fi
|
||||
done
|
||||
set -x
|
||||
}
|
||||
|
||||
function waitforlisten_tcp() {
|
||||
# $1 = process pid
|
||||
# $2 = TCP port number
|
||||
if [ -z "$1" ] || [ -z "$2" ]; then
|
||||
@ -353,7 +378,7 @@ function part_dev_by_gpt () {
|
||||
$rootdir/test/lib/bdev/nbd/nbd -c ${conf}.gpt -b $devname -n /dev/nbd0 &
|
||||
nbd_pid=$!
|
||||
echo "Process nbd pid: $nbd_pid"
|
||||
waitforlisten $nbd_pid 5260
|
||||
waitforlisten $nbd_pid
|
||||
waitfornbd nbd0
|
||||
|
||||
if [ "$operation" = create ]; then
|
||||
|
@ -16,8 +16,8 @@ def print_array(a):
|
||||
print " ".join((quote(v) for v in a))
|
||||
|
||||
parser = argparse.ArgumentParser(description='SPDK RPC command line interface')
|
||||
parser.add_argument('-s', dest='server_addr', help='RPC server address', default='127.0.0.1')
|
||||
parser.add_argument('-p', dest='port', help='RPC port number', default=5260, type=int)
|
||||
parser.add_argument('-s', dest='server_addr', help='RPC server address', default='/var/tmp/spdk.sock')
|
||||
parser.add_argument('-p', dest='port', help='RPC port number (if server_addr is IP address)', default=5260, type=int)
|
||||
parser.add_argument('-v', dest='verbose', help='Verbose mode', action='store_true')
|
||||
subparsers = parser.add_subparsers(help='RPC methods')
|
||||
|
||||
|
@ -100,6 +100,7 @@ main(int argc, char **argv)
|
||||
spdk_app_opts_init(&opts);
|
||||
|
||||
opts.name = "stub";
|
||||
opts.rpc_addr = NULL;
|
||||
|
||||
while ((ch = getopt(argc, argv, "i:m:n:p:s:H")) != -1) {
|
||||
switch (ch) {
|
||||
|
@ -13,7 +13,6 @@ timing_enter calsoft
|
||||
|
||||
# iSCSI target configuration
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
INITIATOR_TAG=2
|
||||
INITIATOR_NAME=ALL
|
||||
NETMASK=$INITIATOR_IP/32
|
||||
@ -36,7 +35,7 @@ echo "Process pid: $pid"
|
||||
|
||||
trap "killprocess $pid; exit 1 " SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
@ -11,6 +11,3 @@
|
||||
ErrorRecoveryLevel 2
|
||||
NopInInterval 10
|
||||
AllowDuplicateIsid Yes
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
@ -16,7 +16,6 @@ $rootdir/scripts/gen_nvme.sh >> $testdir/iscsi.conf
|
||||
|
||||
# iSCSI target configuration
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
INITIATOR_TAG=2
|
||||
INITIATOR_NAME=ALL
|
||||
NETMASK=$INITIATOR_IP/32
|
||||
@ -31,7 +30,7 @@ echo "Process pid: $pid"
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
@ -10,9 +10,6 @@
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
||||
# Do not specify InitiatorGroup, PortalGroup, Malloc,
|
||||
# or TargetNode entries here - the autotest.sh script
|
||||
# will use RPC to set up this part of the configuration.
|
||||
|
@ -9,7 +9,6 @@ timing_enter filesystem
|
||||
|
||||
# iSCSI target configuration
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
INITIATOR_TAG=2
|
||||
INITIATOR_NAME=ALL
|
||||
NETMASK=$INITIATOR_IP/32
|
||||
@ -26,7 +25,7 @@ echo "Process pid: $pid"
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
@ -8,6 +8,3 @@
|
||||
MaxSessions 16
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
@ -34,7 +34,7 @@ function running_config() {
|
||||
pid=$!
|
||||
echo "Process pid: $pid"
|
||||
trap "iscsicleanup; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt2
|
||||
@ -59,7 +59,6 @@ cp $testdir/iscsi.conf.in $testdir/iscsi.conf
|
||||
|
||||
# iSCSI target configuration
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
INITIATOR_TAG=2
|
||||
INITIATOR_NAME=ALL
|
||||
NETMASK=$INITIATOR_IP/32
|
||||
@ -77,7 +76,7 @@ echo "Process pid: $pid"
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
@ -9,9 +9,6 @@
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
||||
[Nvme]
|
||||
RetryCount 4
|
||||
Timeout 0
|
||||
|
@ -9,7 +9,6 @@ timing_enter idle_migration
|
||||
|
||||
# iSCSI target configuration
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
|
||||
fio_py="python $rootdir/scripts/fio.py"
|
||||
|
||||
@ -21,7 +20,7 @@ echo "Process pid: $pid"
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
@ -8,5 +8,3 @@
|
||||
MaxSessions 64
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
@ -51,7 +51,7 @@ do
|
||||
|
||||
trap "kill_all_iscsi_target; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid $port
|
||||
waitforlisten_tcp $pid $port
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt_$i
|
||||
|
@ -11,4 +11,3 @@
|
||||
|
||||
# The RPC section must be the last section in this file.
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
@ -8,6 +8,3 @@
|
||||
MaxSessions 16
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
@ -12,7 +12,6 @@ timing_enter iscsi_lvol
|
||||
|
||||
# iSCSI target configuration
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
INITIATOR_TAG=2
|
||||
INITIATOR_NAME=ALL
|
||||
NETMASK=$INITIATOR_IP/32
|
||||
@ -30,7 +29,7 @@ echo "Process pid: $pid"
|
||||
|
||||
trap "iscsicleanup; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
@ -28,7 +28,7 @@ $rootdir/app/nvmf_tgt/nvmf_tgt -c $rootdir/test/nvmf/nvmf.conf -m 0x2 -p 1 -s 38
|
||||
nvmfpid=$!
|
||||
echo "NVMf target launched. pid: $nvmfpid"
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
waitforlisten $nvmfpid 5260
|
||||
waitforlisten $nvmfpid
|
||||
echo "NVMf target has started."
|
||||
bdevs=$($rpc_py construct_malloc_bdev 64 512)
|
||||
$rpc_py construct_nvmf_subsystem nqn.2016-06.io.spdk:cnode1 "trtype:RDMA traddr:$NVMF_FIRST_TARGET_IP trsvcid:4420" "" -a -s SPDK00000000000001 -n "$bdevs"
|
||||
@ -48,18 +48,18 @@ iscsipid=$!
|
||||
echo "iSCSI target launched. pid: $iscsipid"
|
||||
trap "killprocess $iscsipid; killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
# The configuration file for the iSCSI target told it to use port 5261 for RPC
|
||||
waitforlisten $iscsipid 5261
|
||||
waitforlisten_tcp $iscsipid 5261
|
||||
echo "iSCSI target has started."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
||||
echo "Creating an iSCSI target node."
|
||||
$rpc_py -p 5261 add_portal_group 1 $TARGET_IP:$ISCSI_PORT
|
||||
$rpc_py -p 5261 add_initiator_group 1 ALL $INITIATOR_IP/32
|
||||
$rpc_py -s 127.0.0.1 -p 5261 add_portal_group 1 $TARGET_IP:$ISCSI_PORT
|
||||
$rpc_py -s 127.0.0.1 -p 5261 add_initiator_group 1 ALL $INITIATOR_IP/32
|
||||
if [ $1 -eq 0 ]; then
|
||||
$rpc_py -p 5261 construct_nvme_bdev -b "Nvme0" -t "rdma" -f "ipv4" -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT -n nqn.2016-06.io.spdk:cnode1
|
||||
$rpc_py -s 127.0.0.1 -p 5261 construct_nvme_bdev -b "Nvme0" -t "rdma" -f "ipv4" -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT -n nqn.2016-06.io.spdk:cnode1
|
||||
fi
|
||||
$rpc_py -p 5261 construct_target_node Target1 Target1_alias 'Nvme0n1:0' '1:1' 64 1 0 0 0
|
||||
$rpc_py -s 127.0.0.1 -p 5261 construct_target_node Target1 Target1_alias 'Nvme0n1:0' '1:1' 64 1 0 0 0
|
||||
sleep 1
|
||||
|
||||
echo "Logging in to iSCSI target."
|
||||
|
@ -8,6 +8,3 @@
|
||||
MaxSessions 16
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
@ -13,7 +13,6 @@ BLOCKSIZE=$1
|
||||
RUNTIME=$2
|
||||
PMEM_BDEVS=""
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
INITIATOR_TAG=2
|
||||
INITIATOR_NAME=ALL
|
||||
NETMASK=$INITIATOR_IP/32
|
||||
@ -33,7 +32,7 @@ echo "Process pid: $pid"
|
||||
|
||||
trap "iscsicleanup; killprocess $pid; rm -f /tmp/pool_file*; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
timing_exit start_iscsi_target
|
||||
|
||||
|
@ -8,6 +8,3 @@
|
||||
MaxSessions 16
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
@ -14,7 +14,6 @@ timing_enter rbd
|
||||
|
||||
# iSCSI target configuration
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
INITIATOR_TAG=2
|
||||
INITIATOR_NAME=ALL
|
||||
NETMASK=$INITIATOR_IP/32
|
||||
@ -29,7 +28,7 @@ pid=$!
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
@ -8,6 +8,3 @@
|
||||
MaxSessions 16
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
@ -11,7 +11,6 @@ timing_enter reset
|
||||
|
||||
# iSCSI target configuration
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
INITIATOR_TAG=2
|
||||
INITIATOR_NAME=ALL
|
||||
NETMASK=$INITIATOR_IP/32
|
||||
@ -33,7 +32,7 @@ echo "Process pid: $pid"
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
@ -8,6 +8,3 @@
|
||||
MaxSessions 16
|
||||
ImmediateData Yes
|
||||
ErrorRecoveryLevel 0
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
@ -9,7 +9,6 @@ timing_enter rpc_config
|
||||
|
||||
# iSCSI target configuration
|
||||
PORT=3260
|
||||
RPC_PORT=5260
|
||||
INITIATOR_TAG=2
|
||||
INITIATOR_NAME=ALL
|
||||
NETMASK=$INITIATOR_IP/32
|
||||
@ -27,7 +26,7 @@ echo "Process pid: $pid"
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
echo "iscsi_tgt is listening. Running tests..."
|
||||
|
||||
timing_exit start_iscsi_tgt
|
||||
|
@ -14,8 +14,5 @@
|
||||
AIO /dev/ram0 AIO0
|
||||
AIO /tmp/aiofile AIO1 2048
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
||||
[Ioat]
|
||||
Disable Yes
|
||||
|
@ -950,6 +950,7 @@ main(int argc, char **argv)
|
||||
config_file = argv[1];
|
||||
}
|
||||
bdevtest_init(config_file, "0x7", &opts);
|
||||
opts.rpc_addr = NULL;
|
||||
|
||||
num_failures = spdk_app_start(&opts, start_timer, NULL, NULL);
|
||||
spdk_app_fini();
|
||||
|
@ -757,6 +757,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
bdevtest_init(config_file, core_mask, &opts);
|
||||
opts.rpc_addr = NULL;
|
||||
|
||||
spdk_app_start(&opts, bdevperf_run, NULL, NULL);
|
||||
|
||||
|
@ -10,7 +10,6 @@ test_cases=all
|
||||
x=""
|
||||
|
||||
rpc_py="$TEST_DIR/scripts/rpc.py "
|
||||
RPC_PORT=5260
|
||||
|
||||
function usage() {
|
||||
[[ ! -z $2 ]] && ( echo "$2"; echo ""; )
|
||||
@ -82,7 +81,7 @@ function vhost_start()
|
||||
$TEST_DIR/app/vhost/vhost -c $BASE_DIR/vhost.conf.in &
|
||||
vhost_pid=$!
|
||||
echo $vhost_pid > $BASE_DIR/vhost.pid
|
||||
waitforlisten $vhost_pid $RPC_PORT
|
||||
waitforlisten $vhost_pid
|
||||
}
|
||||
|
||||
### Function stops vhost app
|
||||
|
@ -1,5 +1,2 @@
|
||||
[Global]
|
||||
LogFacility "local7"
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
Listen 127.0.0.1
|
||||
|
@ -3,7 +3,6 @@
|
||||
NVMF_PORT=4420
|
||||
NVMF_IP_PREFIX="192.168.100"
|
||||
NVMF_IP_LEAST_ADDR=8
|
||||
RPC_PORT=5260
|
||||
|
||||
if [ -z "$NVMF_APP" ]; then
|
||||
NVMF_APP=./app/nvmf_tgt/nvmf_tgt
|
||||
|
@ -32,7 +32,7 @@ nvmfpid=$!
|
||||
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $nvmfpid ${RPC_PORT}
|
||||
waitforlisten $nvmfpid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
bdevs="$bdevs $($rpc_py construct_null_bdev Null0 $NULL_BDEV_SIZE $NULL_BLOCK_SIZE)"
|
||||
|
@ -27,7 +27,7 @@ nvmfpid=$!
|
||||
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $nvmfpid ${RPC_PORT}
|
||||
waitforlisten $nvmfpid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
|
||||
|
@ -27,7 +27,7 @@ nvmfpid=$!
|
||||
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $nvmfpid ${RPC_PORT}
|
||||
waitforlisten $nvmfpid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
|
||||
|
@ -24,7 +24,7 @@ nvmfpid=$!
|
||||
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $nvmfpid ${RPC_PORT}
|
||||
waitforlisten $nvmfpid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
bdevs="$bdevs $($rpc_py construct_malloc_bdev 64 512)"
|
||||
|
@ -27,7 +27,7 @@ nvmfpid=$!
|
||||
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $nvmfpid ${RPC_PORT}
|
||||
waitforlisten $nvmfpid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
|
||||
|
@ -29,7 +29,7 @@ nvmfpid=$!
|
||||
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $nvmfpid ${RPC_PORT}
|
||||
waitforlisten $nvmfpid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
bdevs="$bdevs $($rpc_py construct_malloc_bdev 64 512)"
|
||||
|
@ -26,7 +26,7 @@ nvmfpid=$!
|
||||
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $nvmfpid ${RPC_PORT}
|
||||
waitforlisten $nvmfpid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
|
||||
|
@ -32,7 +32,7 @@ nvmfpid=$!
|
||||
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $nvmfpid ${RPC_PORT}
|
||||
waitforlisten $nvmfpid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
|
||||
|
@ -36,7 +36,7 @@ pid=$!
|
||||
|
||||
trap "disconnect_nvmf; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
modprobe -v nvme-rdma
|
||||
|
@ -27,7 +27,7 @@ pid=$!
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
modprobe -v nvme-rdma
|
||||
|
@ -26,7 +26,7 @@ nvmfpid=$!
|
||||
|
||||
trap "killprocess $nvmfpid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $nvmfpid ${RPC_PORT}
|
||||
waitforlisten $nvmfpid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
bdevs="$bdevs $($rpc_py construct_malloc_bdev $MALLOC_BDEV_SIZE $MALLOC_BLOCK_SIZE)"
|
||||
|
@ -1,8 +1,5 @@
|
||||
[Global]
|
||||
Comment "Global section"
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
||||
[Nvmf]
|
||||
MaxQueuesPerSession 4
|
||||
|
@ -1,8 +1,5 @@
|
||||
[Global]
|
||||
Comment "Global section"
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
||||
[Nvmf]
|
||||
MaxQueuesPerSession 16
|
||||
|
@ -49,7 +49,7 @@ pid=$!
|
||||
|
||||
trap "disconnect_nvmf; rm -f /tmp/pool_file*; killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
modprobe -v nvme-rdma
|
||||
|
@ -24,7 +24,7 @@ pid=$!
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
# set times for subsystem construct/delete
|
||||
|
@ -27,7 +27,7 @@ pid=$!
|
||||
|
||||
trap "killprocess $pid; exit 1" SIGINT SIGTERM EXIT
|
||||
|
||||
waitforlisten $pid ${RPC_PORT}
|
||||
waitforlisten $pid
|
||||
timing_exit start_nvmf_tgt
|
||||
|
||||
# Create 10 subsystems
|
||||
|
@ -3,7 +3,6 @@
|
||||
BASE_DIR=$(readlink -f $(dirname $0))
|
||||
[[ -z "$TEST_DIR" ]] && TEST_DIR="$(cd $BASE_DIR/../../ && pwd)"
|
||||
rpc_py="$TEST_DIR/scripts/rpc.py "
|
||||
RPC_PORT=5260
|
||||
|
||||
source $TEST_DIR/scripts/autotest_common.sh
|
||||
|
||||
@ -76,10 +75,9 @@ function pmem_print_tc_name
|
||||
|
||||
function vhost_start()
|
||||
{
|
||||
local vhost_conf_template="$TEST_DIR/test/pmem/vhost.conf.in"
|
||||
local vhost_pid
|
||||
|
||||
$TEST_DIR/app/vhost/vhost -c $vhost_conf_template &
|
||||
$TEST_DIR/app/vhost/vhost &
|
||||
if [ $? != 0 ]; then
|
||||
echo -e "ERROR: Failed to launch vhost!"
|
||||
return 1
|
||||
@ -87,7 +85,7 @@ function vhost_start()
|
||||
|
||||
vhost_pid=$!
|
||||
echo $vhost_pid > $TEST_DIR/test/pmem/vhost.pid
|
||||
waitforlisten $vhost_pid $RPC_PORT
|
||||
waitforlisten $vhost_pid
|
||||
}
|
||||
|
||||
function vhost_kill()
|
||||
|
@ -1,3 +0,0 @@
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
Listen 127.0.0.1
|
@ -41,8 +41,6 @@ mkdir -p $TEST_DIR
|
||||
|
||||
. $COMMON_DIR/autotest.config
|
||||
|
||||
RPC_PORT=5260
|
||||
|
||||
# Trace flag is optional, if it wasn't set earlier - disable it after sourcing
|
||||
# autotest_common.sh
|
||||
if [[ $- =~ x ]]; then
|
||||
@ -162,7 +160,7 @@ function spdk_vhost_run()
|
||||
echo $vhost_pid > $vhost_pid_file
|
||||
|
||||
echo "INFO: waiting for app to run..."
|
||||
waitforlisten "$vhost_pid" ${RPC_PORT}
|
||||
waitforlisten "$vhost_pid"
|
||||
echo "INFO: vhost started - pid=$vhost_pid"
|
||||
|
||||
rm $vhost_conf_file
|
||||
|
@ -132,7 +132,6 @@ echo "Setting up VM"
|
||||
echo ""
|
||||
|
||||
rpc_py="python $SPDK_BUILD_DIR/scripts/rpc.py "
|
||||
rpc_py+="-s 127.0.0.1 "
|
||||
|
||||
for vm_conf in ${vms[@]}; do
|
||||
IFS=',' read -ra conf <<< "$vm_conf"
|
||||
|
@ -1,8 +1,5 @@
|
||||
[Global]
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
||||
[Ioat]
|
||||
Disable Yes
|
||||
|
||||
|
@ -1,7 +1,4 @@
|
||||
[Global]
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
||||
[Ioat]
|
||||
Disable Yes
|
||||
|
@ -1,6 +1,3 @@
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
||||
[Ioat]
|
||||
Disable Yes
|
||||
|
||||
|
@ -9,8 +9,6 @@ qemu_install_dir="$testdir/root"
|
||||
MAKE="make -j$(( $(nproc) * 2 ))"
|
||||
|
||||
rpc_py="python $rootdir/scripts/rpc.py "
|
||||
rpc_py+="-s 127.0.0.1 "
|
||||
RPC_PORT=5260
|
||||
HOST_IP=192.200.200.1
|
||||
VM_IP=192.200.200.254
|
||||
VM_UNAME="root"
|
||||
@ -113,7 +111,7 @@ cd /tmp
|
||||
$rootdir/app/vhost/vhost -c $basedir/vhost.conf &
|
||||
pid=$!
|
||||
echo "Process pid: $pid"
|
||||
waitforlisten "$pid" "$RPC_PORT"
|
||||
waitforlisten "$pid"
|
||||
if [[ "$VHOST_MODE" == "scsi" ]]; then
|
||||
$rpc_py construct_vhost_scsi_controller naa.0
|
||||
$rpc_py add_vhost_scsi_lun naa.0 0 Nvme0n1
|
||||
|
@ -1,7 +1,4 @@
|
||||
[Global]
|
||||
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
|
||||
[Ioat]
|
||||
Disable Yes
|
||||
|
@ -7,7 +7,6 @@ BASE_DIR=$(readlink -f $(dirname $0))
|
||||
. $COMMON_DIR/common.sh
|
||||
|
||||
rpc_py="python $SPDK_BUILD_DIR/scripts/rpc.py "
|
||||
rpc_py+="-s 127.0.0.1 "
|
||||
|
||||
vm_count=1
|
||||
max_disks=""
|
||||
|
@ -1,5 +1,3 @@
|
||||
[Global]
|
||||
[Rpc]
|
||||
Enable Yes
|
||||
[Ioat]
|
||||
Disable Yes
|
||||
|
Loading…
Reference in New Issue
Block a user