From: "Xu, Qian Q" <qian.q.xu@intel.com>
To: Linhaifeng <haifeng.lin@huawei.com>,
"Xie, Huawei" <huawei.xie@intel.com>
Cc: "liuyongan@huawei.com" <liuyongan@huawei.com>,
"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] vhost: notify guest to fill buffer when there is no buffer
Date: Wed, 4 Feb 2015 01:38:30 +0000 [thread overview]
Message-ID: <82F45D86ADE5454A95A89742C8D1410E01CA3873@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <54D0926D.9010304@huawei.com>
Haifeng
1. Get the latest dpdk master branch code, apply huawei's patchset of vhost-user. The first patch is http://dpdk.org/dev/patchwork/patch/2796/, totally 12patches, date is 1/30/2015.
2. Update the config/common_linuxapp and build the samples, see my script for reference. If
cd ./dpdk
export RTE_SDK=$PWD
export RTE_TARGET=x86_64-native-linuxapp-gcc
sed -i 's/CONFIG_RTE_LIBRTE_VHOST=.*$/CONFIG_RTE_LIBRTE_VHOST=y/' ./config/commo n_linuxapp
make install -j38 T=x86_64-native-linuxapp-gcc
cd $RTE_SDK/lib/librte_vhost
make
cd ./eventfd_link
make
cd $RTE_SDK/examples/vhost
make
3. Launch the vhost-user sample, then you will see there is a vhost-net under you dpdk folder for socket use. If you meet error as can't setup mempool, you can update one line in examples/vhost/main.c, '#define MAX_QUEUES 512'--->' #define MAX_QUEUE 128'.
#!/bin/sh
modprobe kvm
modprobe kvm_intel
awk '/Hugepagesize/ {print $2}' /proc/meminfo
awk '/HugePages_Total/ { print $2 }' /proc/meminfo
umount `awk '/hugetlbfs/ { print $2 }' /proc/mounts`
mkdir -p /mnt/huge
mount -t hugetlbfs nodev /mnt/huge -o pagesize=1G #1G or 2M page, both ok.
rm -f /dev/vhost-net
rmmod vhost-net
modprobe fuse
modprobe cuse
rmmod eventfd_link
rmmod igb_uio
cd ./dpdk
pwd
insmod lib/librte_vhost/eventfd_link/eventfd_link.ko
modprobe uio
rmmod rte_kni
rmmod igb_uio
insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko
./tools/dpdk_nic_bind.py --bind=igb_uio 0000:08:00.1
taskset -c 1-3 examples/vhost/build/vhost-switch -c 0xf -n 4 --huge-dir /mnt/huge --socket-mem 1024,1024 -- -p 1 --mergeable 0 --zero-copy 0 --vm2vm 2
#Make sure the vm2vm is 1 or 2 to make vm to vm communication work. Mergeable can be 1(to enable jumbo frame) or 0(disable jumbo frame).
4. Launch the VM1 and VM2 with virtio device, note: you need use qemu version>2.1 to enable the vhost-user server's feature. Old qemu such as 1.5,1.6 didn't support it.
Below is my VM1 startup command, for your reference, similar for VM2.
/home/qemu-2.2.0/x86_64-softmmu/qemu-system-x86_64 -name us-vhost-vm1 -cpu host -enable-kvm -m 2048 -object memory-backend-file,id=mem,size=2048M,mem-path=/mnt/huge,share=on -numa node,memdev=mem -mem-prealloc -smp 2 -drive file=/home/img/dpdk1-vm1.img -chardev socket,id=char0,path=/home/dpdk-vhost/vhost-net -netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce -device virtio-net-pci,mac=00:00:00:00:00:01, -nographic
5. Then in the VM, you can have the same operations as before, send packet from virtio1 to virtio2.
Pls let me know if any questions, issues.
-----Original Message-----
From: Linhaifeng [mailto:haifeng.lin@huawei.com]
Sent: Tuesday, February 03, 2015 5:19 PM
To: Xu, Qian Q; Xie, Huawei
Cc: lilijun; liuyongan@huawei.com
Subject: Re: [dpdk-dev] [PATCH] vhost: notify guest to fill buffer when there is no buffer
Yes,the lasted codes will not happen.
On 2015/2/3 16:53, Xu, Qian Q wrote:
> If you'd like to use DPDK plus vhost-user's patch, I can send you my steps for setup, do u need it?
of course! pls!
I'd like to use it.Thank you very much!
--
Regards,
Haifeng
next prev parent reply other threads:[~2015-02-04 1:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 10:30 linhaifeng
2015-01-29 10:39 ` Xie, Huawei
2015-01-29 12:39 ` Linhaifeng
2015-01-29 13:00 ` Xie, Huawei
2015-01-29 13:50 ` Linhaifeng
2015-01-30 8:20 ` Xu, Qian Q
2015-01-30 10:33 ` Linhaifeng
2015-02-01 6:04 ` Linhaifeng
[not found] ` <82F45D86ADE5454A95A89742C8D1410E01CA1DA3@shsmsx102.ccr.corp.intel.com>
[not found] ` <54CF6BB3.7080002@huawei.com>
[not found] ` <C37D651A908B024F974696C65296B57B0F37C3F7@SHSMSX101.ccr.corp.intel.com>
[not found] ` <54D08AFA.2030404@huawei.com>
[not found] ` <82F45D86ADE5454A95A89742C8D1410E01CA3197@shsmsx102.ccr.corp.intel.com>
[not found] ` <54D0926D.9010304@huawei.com>
2015-02-04 1:38 ` Xu, Qian Q [this message]
2015-02-06 4:02 ` Linhaifeng
2015-02-06 5:54 ` Xu, Qian Q
2015-02-06 11:02 ` Linhaifeng
2015-02-07 4:26 ` Linhaifeng
2015-02-09 2:57 ` Xu, Qian Q
2015-02-09 4:11 ` Linhaifeng
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=82F45D86ADE5454A95A89742C8D1410E01CA3873@shsmsx102.ccr.corp.intel.com \
--to=qian.q.xu@intel.com \
--cc=dev@dpdk.org \
--cc=haifeng.lin@huawei.com \
--cc=huawei.xie@intel.com \
--cc=liuyongan@huawei.com \
/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).