From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx5.zte.com.cn (mx5.zte.com.cn [63.217.80.70]) by dpdk.org (Postfix) with ESMTP id B9DE62B91 for ; Tue, 27 Dec 2016 06:33:13 +0100 (CET) X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20161227133017 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 27 Dec 2016 05:30:17 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id uBR5X3BU045561 for ; Tue, 27 Dec 2016 13:33:03 +0800 (GMT-8) (envelope-from wang.yong19@zte.com.cn) To: dev@dpdk.org MIME-Version: 1.0 X-KeepSent: D1256FEB:A164AEF1-48258096:001DA07F; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3 September 15, 2011 Message-ID: From: wang.yong19@zte.com.cn Date: Tue, 27 Dec 2016 13:33:14 +0800 X-MIMETrack: Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2016-12-27 13:32:47, Serialize complete at 2016-12-27 13:32:47 X-MAIL: mse01.zte.com.cn uBR5X3BU045561 X-HQIP: 127.0.0.1 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] examples/vhost: how to use vhost-switch between VMs? Anybody who can help? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 05:33:14 -0000 ICBUaGVyZSBhcmUgc29tZSBkZXNjcmlwdGlvbnMgaW4gDQpkcGRrLTE2LjExXGRvY1xndWlkZXNc c2FtcGxlX2FwcF91Z1x2aG9zdC5yc3QsDQoiVGhlIHNhbXBsZSBh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WYgDQonZGV2X2luZm8ubWF4X3ZtZHFfcG9vbHMnDQp3 YXMgMCwgYnV0IHRoZXJlIHdlcmUgc3RpbGwgb3RoZXIgZXJyb3JzIHdoZW4gcnVubmluZyB2aG9z dC1zd2l0Y2guIA0KICBBZnRlciB3ZSBmaXhlZCBhbGwgdGhlIGVycm9ycyB3aGlsZSBydW5uaW5n IHZob3N0LXN3aXRjaCBhcyBzZXJ2ZXIsIHdlIA0KZGlkbid0DQprbm93IGhvdyB0byBydW4gdGhl IHZob3N0LXN3aXRjaCBhcyBjbGllbnQgaW4gYW5vdGhlciBWTSwgaG93IGNvdWxkIHRoZSANCmNs aWVudCANCmdldCB0aGUgc29ja2V0LCB0aGUgbmV0ZGV2IGFuZCB0aGUgdmlydGlvIHBvcnQgdGhh dCB0aGUgc2VydmVyIA0Kdmhvc3Qtc3dpdGNoIA0KY3JlYXRlZD8NCiAgU28sIHdlIGRvdWJ0ZWQg d2hldGhlciB3ZSB1c2UgdGhlIHZob3N0LXN3aXRjaCBpbiBhIHdyb25nIHdheS4gQ291bGQgeW91 DQpwbGVhc2UgZ2l2ZSB1cyBzb21lIGFkdmljZSB0aGF0IGhvdyB0byB1c2UgdGhlIHZob3N0LXN3 aXRjaCBiZXR3ZWVuIHR3byBvciANCm1vcmUNCiBWTXM/DQogIEFueWJvZHkgd2hvIGNhbiBoZWxw IHVzIHdpdGggdGhpcz8NCg0K >From yuanhan.liu@linux.intel.com Tue Dec 27 06:58:52 2016 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 7DBA22B91 for ; Tue, 27 Dec 2016 06:58:52 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 26 Dec 2016 21:58:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,414,1477983600"; d="scan'208";a="46714908" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga005.jf.intel.com with ESMTP; 26 Dec 2016 21:58:50 -0800 Date: Tue, 27 Dec 2016 14:00:37 +0800 From: Yuanhan Liu To: wang.yong19@zte.com.cn Cc: dev@dpdk.org Message-ID: <20161227060037.GA21789@yliu-dev.sh.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] examples/vhost: how to use vhost-switch between VMs? Anybody who can help? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 05:58:52 -0000 On Tue, Dec 27, 2016 at 01:33:14PM +0800, wang.yong19@zte.com.cn wrote: > There are some descriptions in > dpdk-16.11\doc\guides\sample_app_ug\vhost.rst, > "The sample application performs simple packet switching between virtual > machines based on Media Access Control (MAC) address or Virtual Local Area > > Network (VLAN) tag." So, we want to use vhost-switch between two VMs, one > work as server and another as client. > We runned the vhost-switch sample in a VM with three virtio ports. > First, we > binded one virtio port to igb_uio. Then we runned the command > "./vhost-switch -c f -n 4 --socket-mem 1024 -- --socket-file /tmp/sock0 > ?C-vm2vm 1 ?C-dequeue-zero-copy" > And then error occured. We found that the 'dev_info.max_vmdq_pools' of the > virtio > port was 0, and division by zero error occured at the statement > 'queues_per_pool = dev_info.vmdq_queue_num / dev_info.max_vmdq_pools;' > We fixed this by assigning 'queues_per_pool' to 0 if > 'dev_info.max_vmdq_pools' > was 0, but there were still other errors when running vhost-switch. > After we fixed all the errors while running vhost-switch as server, we > didn't > know how to run the vhost-switch as client in another VM, how could the vhost-switch runs on the host but not guest, and there is no such thing like "vhost-switch as client". Just think it's (pretty simple) switch, that could link VMs together. If you are interested in DPDK virtio PMD, we normally run testpmd inside the guest. If not, you could just use the virtio-net driver from the linux kernel, whereas you normally should set the IP address manually. --yliu > client > get the socket, the netdev and the virtio port that the server > vhost-switch > created? > So, we doubted whether we use the vhost-switch in a wrong way. Could you > please give us some advice that how to use the vhost-switch between two or > more > VMs? > Anybody who can help us with this? >