From: ogawa.yasufumi@lab.ntt.co.jp
To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 1/3] shared: add vhost-user client support
Date: Wed, 23 Jan 2019 17:14:35 +0900 [thread overview]
Message-ID: <1548231277-24464-2-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>
This update is to add client mode for vhost-user. If it is enabled,
`client` in `devargs` variable is set to `1` to activate this mode in
`add_vhost_pmd()`.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
src/shared/secondary/add_port.c | 6 +++++-
src/shared/secondary/add_port.h | 2 ++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/shared/secondary/add_port.c b/src/shared/secondary/add_port.c
index ca55a04..2841f94 100644
--- a/src/shared/secondary/add_port.c
+++ b/src/shared/secondary/add_port.c
@@ -12,6 +12,8 @@
#include "shared/secondary/add_port.h"
#include "shared/secondary/utils.h"
+int g_enable_vhost_cli;
+
char *
get_vhost_backend_name(unsigned int id)
{
@@ -150,7 +152,9 @@ add_vhost_pmd(int index)
name = get_vhost_backend_name(index);
iface = get_vhost_iface_name(index);
- sprintf(devargs, "%s,iface=%s,queues=%d", name, iface, nr_queues);
+ sprintf(devargs, "%s,iface=%s,queues=%d,client=%d",
+ name, iface, nr_queues, g_enable_vhost_cli);
+ RTE_LOG(DEBUG, SHARED, "devargs for vhost: '%s'\n", devargs);
ret = dev_attach_by_devargs(devargs, &vhost_port_id);
if (ret < 0)
return ret;
diff --git a/src/shared/secondary/add_port.h b/src/shared/secondary/add_port.h
index cfae1af..7012940 100644
--- a/src/shared/secondary/add_port.h
+++ b/src/shared/secondary/add_port.h
@@ -20,6 +20,8 @@
#define RTE_LOGTYPE_SHARED RTE_LOGTYPE_USER1
+extern int g_enable_vhost_cli;
+
/**
* Get unique name used to reserve vhost interface.
*
--
2.17.1
next prev 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 ` ogawa.yasufumi [this message]
2019-01-23 8:14 ` [spp] [PATCH 2/3] spp_nfv: add vhost-client option ogawa.yasufumi
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-2-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).