DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v5 resend 00/12] vhost-user multiple queues enabling
@ 2015-09-18 15:10 Yuanhan Liu
  2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 01/12] vhost-user: add protocol features support Yuanhan Liu
                   ` (12 more replies)
  0 siblings, 13 replies; 47+ messages in thread
From: Yuanhan Liu @ 2015-09-18 15:10 UTC (permalink / raw)
  To: dev; +Cc: Michael S. Tsirkin

This patch set enables vhost-user multiple queues.

Overview
========

It depends on some QEMU patches that, hopefully, will be merged soon.
Those qemu patches introduce some new vhost-user messages, for vhost-user
mq enabling negotiation. Here is the main negotiation steps (Qemu
as master, and DPDK vhost-user as slave):

- Master queries features by VHOST_USER_GET_FEATURES from slave

- Check if VHOST_USER_F_PROTOCOL_FEATURES exist. If not, mq is not
  supported. (check patch 1 for why VHOST_USER_F_PROTOCOL_FEATURES
  is introduced)

- Master then sends another command, VHOST_USER_GET_QUEUE_NUM, for
  querying how many queues the slave supports.

  Master will compare the result with the requested queue number.
  Qemu exits if the former is smaller.

- Master then tries to initiate all queue pairs by sending some vhost
  user commands, including VHOST_USER_SET_VRING_CALL, which will
  trigger the slave to do related vring setup, such as vring allocation.


Till now, all necessary initiation and negotiation are done. And master
could send another message, VHOST_USER_SET_VRING_ENABLE, to enable/disable
a specific queue dynamically later.


Patchset
========

Patch 1-7 are all prepare works for enabling mq; they are all atomic
changes, which is designed to not break anything.

Patch 8 acutally enables mq feature, by setting two key feature flags.

Patch 9-12 are for demostrating the mq feature.


Testing
=======

Host side
----------

- # Start vhost-switch

  sudo mount -t hugetlbfs nodev /mnt/huge
  sudo modprobe uio
  sudo insmod $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko

  sudo $RTE_SDK/tools/dpdk_nic_bind.py --bind igb_uio 0000:08:00.0

  sudo $RTE_SDK/examples/vhost/build/vhost-switch -c 0xf0 -n 4     \
       --huge-dir /mnt/huge --socket-mem 2048,0 -- -p 1 --vm2vm 0  \
       --dev-basename usvhost --rxq 2

  # Above common generates a usvhost socket file at PWD. You could also
  # specify "--stats 1" option to enable stats dumping.



- # start qemu


  sudo sudo mount -t hugetlbfs nodev $HOME/hugetlbfs
  $QEMU_DIR/x86_64-softmmu/qemu-system-x86_64 -machine accel=kvm -m 4G \
        -object memory-backend-file,id=mem,size=4G,mem-path=$HOME/hugetlbfs,share=on \
	-numa node,memdev=mem -chardev socket,id=chr0,path=/path/to/usvhost \
	-netdev vhost-user,id=net0,chardev=chr0,vhostforce,queues=2     \
	-device virtio-net-pci,netdev=net0,mq=on,vectors=6,mac=52:54:00:12:34:58,csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off \
	-hda $HOME/iso/fc-22-x86_64.img -smp 10 -cpu core2duo,+sse3,+sse4.1,+sse4.2


Guest side
----------

   modprobe uio
   insmod $RTE_SDK/$RTE_TARGET/kmod/igb_uio.ko
   echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
   ./tools/dpdk_nic_bind.py --bind igb_uio 00:03.0
    
   $RTE_SDK/$RTE_TARGET/app/testpmd -c 1f -n 4 -- --rxq=2 --txq=2 \
        --nb-cores=4 -i --disable-hw-vlan --txqflags 0xf00
 
   > set fwd mac
   > start tx_first
 

After those setups, you then could use packet generator for packet tx/rx testing.

---
Changchun Ouyang (7):
  vhost: rxtx: prepare work for multiple queue support
  vhost: add VHOST_USER_SET_VRING_ENABLE message
  virtio: resolve for control queue
  vhost: add API bind a virtq to a specific core
  ixgbe: support VMDq RSS in non-SRIOV environment
  examples/vhost: demonstrate the usage of vhost mq feature
  examples/vhost: add per queue stats

Yuanhan Liu (5):
  vhost-user: add protocol features support
  vhost-user: add VHOST_USER_GET_QUEUE_NUM message
  vhost: vring queue setup for multiple queue support
  vhost-user: handle VHOST_USER_RESET_OWNER correctly
  vhost-user: enable vhost-user multiple queue

 drivers/net/ixgbe/ixgbe_rxtx.c                |  86 +++++-
 drivers/net/virtio/virtio_ethdev.c            |  12 +-
 examples/vhost/main.c                         | 420 +++++++++++++++++---------
 examples/vhost/main.h                         |   3 +-
 lib/librte_ether/rte_ethdev.c                 |  11 +
 lib/librte_vhost/rte_vhost_version.map        |   7 +
 lib/librte_vhost/rte_virtio_net.h             |  30 +-
 lib/librte_vhost/vhost_rxtx.c                 |  56 +++-
 lib/librte_vhost/vhost_user/vhost-net-user.c  |  27 +-
 lib/librte_vhost/vhost_user/vhost-net-user.h  |   4 +
 lib/librte_vhost/vhost_user/virtio-net-user.c |  79 +++--
 lib/librte_vhost/vhost_user/virtio-net-user.h |  10 +
 lib/librte_vhost/virtio-net.c                 | 158 +++++++---
 13 files changed, 659 insertions(+), 244 deletions(-)

-- 
1.9.0

^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2015-10-13  9:53 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-18 15:10 [dpdk-dev] [PATCH v5 resend 00/12] vhost-user multiple queues enabling Yuanhan Liu
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 01/12] vhost-user: add protocol features support Yuanhan Liu
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 02/12] vhost-user: add VHOST_USER_GET_QUEUE_NUM message Yuanhan Liu
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 03/12] vhost: vring queue setup for multiple queue support Yuanhan Liu
2015-09-20 13:58   ` Marcel Apfelbaum
2015-09-21  2:06     ` Yuanhan Liu
2015-09-21 17:56       ` Marcel Apfelbaum
2015-09-22  7:31         ` Yuanhan Liu
2015-09-22  8:10           ` Marcel Apfelbaum
2015-09-22  8:34             ` Yuanhan Liu
2015-09-22  8:47               ` Marcel Apfelbaum
2015-09-22  9:21                 ` Yuanhan Liu
2015-09-22 10:06                   ` Marcel Apfelbaum
2015-09-22 14:22                     ` Yuanhan Liu
2015-09-22 14:51                       ` Marcel Apfelbaum
2015-09-23  3:46                         ` Yuanhan Liu
2015-09-24  9:51                           ` Marcel Apfelbaum
2015-09-21  9:07     ` Michael S. Tsirkin
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 04/12] vhost: rxtx: prepare work " Yuanhan Liu
2015-09-20  9:29   ` Michael S. Tsirkin
2015-09-21  2:25     ` Yuanhan Liu
2015-09-21  9:04       ` Michael S. Tsirkin
2015-09-22  2:54         ` Yuanhan Liu
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 05/12] vhost: add VHOST_USER_SET_VRING_ENABLE message Yuanhan Liu
2015-09-20  9:37   ` Michael S. Tsirkin
2015-09-21  2:22     ` Yuanhan Liu
2015-09-21  9:02       ` Michael S. Tsirkin
2015-09-22  2:21         ` Yuanhan Liu
2015-09-23  8:43           ` Yuanhan Liu
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 06/12] vhost-user: handle VHOST_USER_RESET_OWNER correctly Yuanhan Liu
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 07/12] virtio: resolve for control queue Yuanhan Liu
2015-09-20  9:21   ` Michael S. Tsirkin
2015-09-21  6:36     ` Yuanhan Liu
2015-10-08 15:32       ` Nikita Kalyazin
2015-10-08 20:51         ` Steffen Bauch
2015-10-09  7:11           ` Nikita Kalyazin
2015-10-12  8:39           ` Yuanhan Liu
2015-10-12  9:31             ` Xie, Huawei
2015-10-12  9:56               ` Xie, Huawei
2015-10-12 20:58             ` Steffen Bauch
2015-10-13  9:54               ` Yuanhan Liu
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 08/12] vhost-user: enable vhost-user multiple queue Yuanhan Liu
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 09/12] vhost: add API bind a virtq to a specific core Yuanhan Liu
2015-09-18 15:10 ` [dpdk-dev] [PATCH v5 resend 10/12] ixgbe: support VMDq RSS in non-SRIOV environment Yuanhan Liu
2015-09-18 15:11 ` [dpdk-dev] [PATCH v5 resend 11/12] examples/vhost: demonstrate the usage of vhost mq feature Yuanhan Liu
2015-09-18 15:11 ` [dpdk-dev] [PATCH v5 resend 12/12] examples/vhost: add per queue stats Yuanhan Liu
2015-09-20 11:48 ` [dpdk-dev] [PATCH v5 resend 00/12] vhost-user multiple queues enabling Marcel Apfelbaum

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).