Soft Patch Panel
 help / color / mirror / Atom feed
From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 2/3] spp_nfv: add vhost-client option
Date: Wed, 23 Jan 2019 17:14:36 +0900	[thread overview]
Message-ID: <1548231277-24464-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1548231277-24464-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>

From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>

To activate vhost-user client mode, add `--vhost-client` option.

Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
 src/nfv/main.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/src/nfv/main.c b/src/nfv/main.c
index 701a700..54f908d 100644
--- a/src/nfv/main.c
+++ b/src/nfv/main.c
@@ -24,6 +24,22 @@
 
 static sig_atomic_t on = 1;
 
+enum {
+	/*
+	 * Long options mapped to a short option.
+	 *
+	 * First long only option value must be >= 256, so that we won't
+	 * conflict with short options.
+	 */
+	CMD_LINE_OPT_MIN_NUM = 256,
+	CMD_OPT_ENABLE_VHOST_CLI,
+};
+
+static struct option lgopts[] = {
+	{"vhost-client", no_argument, NULL, CMD_OPT_ENABLE_VHOST_CLI},
+	{0}
+};
+
 /*
  * print a usage message
  */
@@ -31,7 +47,9 @@ static void
 usage(const char *progname)
 {
 	RTE_LOG(INFO, SPP_NFV,
-		"Usage: %s [EAL args] -- -n <client_id>\n\n", progname);
+		"Usage: %s [EAL args] -- %s %s %s\n\n",
+		progname, "-n <client_id>", "-s <ipaddr:port>",
+		"--vhost-client");
 }
 
 /*
@@ -43,12 +61,14 @@ parse_app_args(int argc, char *argv[])
 	int option_index, opt;
 	char **argvopt = argv;
 	const char *progname = argv[0];
-	static struct option lgopts[] = { {0} };
 	int ret;
 
 	while ((opt = getopt_long(argc, argvopt, "n:s:", lgopts,
 			&option_index)) != EOF) {
 		switch (opt) {
+		case CMD_OPT_ENABLE_VHOST_CLI:
+			g_enable_vhost_cli = 1;
+			break;
 		case 'n':
 			if (parse_num_clients(&client_id, optarg) != 0) {
 				usage(progname);
@@ -173,6 +193,9 @@ main(int argc, char *argv[])
 	if (parse_app_args(argc, argv) < 0)
 		rte_exit(EXIT_FAILURE, "Invalid command-line arguments\n");
 
+	if (g_enable_vhost_cli == 1)
+		RTE_LOG(INFO, SPP_NFV, "vhost client mode is enabled.\n");
+
 	/* initialize port forward array*/
 	forward_array_init();
 	port_map_init();
-- 
2.17.1

  parent reply	other threads:[~2019-01-23  8:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23  8:14 [spp] [PATCH 0/3] Add vhost-user client mode ogawa.yasufumi
2019-01-23  8:14 ` [spp] [PATCH 1/3] shared: add vhost-user client support ogawa.yasufumi
2019-01-23  8:14 ` ogawa.yasufumi [this message]
2019-01-23  8:14 ` [spp] [PATCH 3/3] shared: fix typo in a log message ogawa.yasufumi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1548231277-24464-3-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
    --to=ogawa.yasufumi@lab.ntt.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=spp@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).