From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id BEF5125D9 for ; Wed, 23 Jan 2019 09:16:55 +0100 (CET) Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x0N8Gsou028603; Wed, 23 Jan 2019 17:16:54 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 2C9BA6395E1; Wed, 23 Jan 2019 17:16:54 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 1EAEB6395D8; Wed, 23 Jan 2019 17:16:54 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: ferruh.yigit@intel.com, spp@dpdk.org, ogawa.yasufumi@lab.ntt.co.jp Date: Wed, 23 Jan 2019 17:14:35 +0900 Message-Id: <1548231277-24464-2-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548231277-24464-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> References: <1548231277-24464-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-TM-AS-MML: disable Subject: [spp] [PATCH 1/3] shared: add vhost-user client support X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 08:16:56 -0000 From: Yasufumi Ogawa 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 --- 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