vhost: added multi-process support

Added -i parameter to vhost that specifies DPDK shared memory id.

Fixes #171

Change-Id: I103eb57886eed2c1663137b5b8195a11039319fa
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/373692
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-08-10 11:09:41 +02:00 committed by Jim Harris
parent cc3c79065c
commit 5b6e67886e

View File

@ -65,6 +65,7 @@ usage(char *executable_name)
printf(" -c config config file (default: %s)\n", defaults.config_file); printf(" -c config config file (default: %s)\n", defaults.config_file);
printf(" -e mask tracepoint group mask for spdk trace buffers (default: 0x0)\n"); printf(" -e mask tracepoint group mask for spdk trace buffers (default: 0x0)\n");
printf(" -f pidfile save pid to file under given path\n"); printf(" -f pidfile save pid to file under given path\n");
printf(" -i shm_id shared memory ID (optional)\n");
printf(" -m mask reactor core mask (default: 0x1)\n"); printf(" -m mask reactor core mask (default: 0x1)\n");
printf(" -N pass --no-pci to DPDK\n"); printf(" -N pass --no-pci to DPDK\n");
printf(" -p core master (primary) core for DPDK\n"); printf(" -p core master (primary) core for DPDK\n");
@ -103,7 +104,7 @@ main(int argc, char *argv[])
vhost_app_opts_init(&opts); vhost_app_opts_init(&opts);
while ((ch = getopt(argc, argv, "c:de:f:m:Np:qs:S:t:h")) != -1) { while ((ch = getopt(argc, argv, "c:de:f:i:m:Np:qs:S:t:h")) != -1) {
switch (ch) { switch (ch) {
case 'c': case 'c':
opts.config_file = optarg; opts.config_file = optarg;
@ -120,6 +121,9 @@ main(int argc, char *argv[])
case 'h': case 'h':
usage(argv[0]); usage(argv[0]);
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
case 'i':
opts.shm_id = strtoul(optarg, NULL, 10);
break;
case 'm': case 'm':
opts.reactor_mask = optarg; opts.reactor_mask = optarg;
break; break;