nvme/example: add shm_id in identify tool under multi-proc case

Change-Id: Ia5427dda190d984edc79603c4b41e74ce49a7a5a
Signed-off-by: GangCao <gang.cao@intel.com>
This commit is contained in:
GangCao 2017-04-15 22:47:23 -04:00 committed by Jim Harris
parent b5b9410da3
commit b3cc183a53
2 changed files with 15 additions and 7 deletions

View File

@ -67,6 +67,8 @@ static struct spdk_nvme_intel_marketing_description_page intel_md_page;
static bool g_hex_dump = false;
static int g_shm_id = -1;
static struct spdk_nvme_transport_id g_trid;
static void
@ -885,6 +887,7 @@ usage(const char *program_name)
spdk_tracelog_usage(stdout, "-t");
printf(" -i shared memory group ID\n");
printf(" -x print hex dump of raw data\n");
printf(" -v verbose (enable warnings)\n");
printf(" -H show this usage\n");
@ -898,8 +901,11 @@ parse_args(int argc, char **argv)
g_trid.trtype = SPDK_NVME_TRANSPORT_PCIE;
snprintf(g_trid.subnqn, sizeof(g_trid.subnqn), "%s", SPDK_NVMF_DISCOVERY_NQN);
while ((op = getopt(argc, argv, "r:t:xH")) != -1) {
while ((op = getopt(argc, argv, "i:r:t:xH")) != -1) {
switch (op) {
case 'i':
g_shm_id = atoi(optarg);
break;
case 'x':
g_hex_dump = true;
break;
@ -955,16 +961,17 @@ int main(int argc, char **argv)
int rc;
struct spdk_env_opts opts;
spdk_env_opts_init(&opts);
opts.name = "identify";
opts.core_mask = "0x1";
spdk_env_init(&opts);
rc = parse_args(argc, argv);
if (rc != 0) {
return rc;
}
spdk_env_opts_init(&opts);
opts.name = "identify";
opts.core_mask = "0x1";
opts.shm_id = g_shm_id;
spdk_env_init(&opts);
rc = 0;
if (spdk_nvme_probe(&g_trid, NULL, probe_cb, attach_cb, NULL) != 0) {
fprintf(stderr, "spdk_nvme_probe() failed\n");

View File

@ -69,7 +69,7 @@ if [ $(uname -s) = Linux ]; then
kill -9 $!
count=0
while [ $count -le 2 ]; do
$rootdir/examples/nvme/perf/perf -i 0 -q 1 -w read -s 4096 -t 1 -c 0x10
$rootdir/examples/nvme/perf/perf -i 0 -q 1 -w read -s 4096 -t 1 -c 0xf
count=$(($count + 1))
done
count=0
@ -77,6 +77,7 @@ if [ $(uname -s) = Linux ]; then
core=$((1 << (($count + 4))))
printf -v hexcore "0x%x" "$core"
$rootdir/examples/nvme/perf/perf -i 0 -q 128 -w read -s 4096 -t 1 -c $hexcore &
$rootdir/examples/nvme/identify/identify -i 0 &
count=$(($count + 1))
done
wait $pid