From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 522288E9F for ; Wed, 21 Oct 2015 05:48:02 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 20 Oct 2015 20:48:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,709,1437462000"; d="scan'208";a="831786409" Received: from yliu-dev.sh.intel.com ([10.239.66.49]) by fmsmga002.fm.intel.com with ESMTP; 20 Oct 2015 20:48:00 -0700 From: Yuanhan Liu To: dev@dpdk.org Date: Wed, 21 Oct 2015 11:48:06 +0800 Message-Id: <1445399294-18826-1-git-send-email-yuanhan.liu@linux.intel.com> X-Mailer: git-send-email 1.9.0 Cc: "Michael S. Tsirkin" , marcel@redhat.com Subject: [dpdk-dev] [PATCH v7 0/8] vhost-user multiple queues enabling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2015 03:48:02 -0000 This patch set enables vhost-user multiple queues. v7: - Removed vhost-user mq examples in this patch set Because the example leverages the hardware VMDq feature to demonstrate the mq feature, which introduces too much limitation, yet it's turned out to be not elegant. - Commit log fixes - Dropped the patch to fix RESET_OWNER handling, as I found Jerome's solution works as well, and it makes more sense to me: http://dpdk.org/dev/patchwork/project/dpdk/list/?submitter=354 Overview ======== It depends on some QEMU patches that has already been merged to upstream. 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-5 are all prepare works for enabling mq; they are all atomic changes, with "do not breaking anything" beared in mind while making them. Patch 6 actually enables mq feature, by setting two key feature flags. Patch 7 handles VHOST_USER_SET_VRING_ENABLE message, which is for enabling disabling a specific virt queue pair, and there is only one queue pair is enabled by default. Test with OVS ============= Marcel created a simple yet quite clear test guide with OVS at: http://wiki.qemu.org/Features/vhost-user-ovs-dpdk Cc: Jerome Jutteau --- Changchun Ouyang (3): vhost: rxtx: use queue id instead of constant ring index virtio: fix deadloop due to reading virtio_net_config incorrectly vhost: add VHOST_USER_SET_VRING_ENABLE message 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: enable vhost-user multiple queue doc: update release note for vhost-user mq support doc/guides/rel_notes/release_2_2.rst | 4 + drivers/net/virtio/virtio_ethdev.c | 16 ++- lib/librte_vhost/rte_virtio_net.h | 13 ++- lib/librte_vhost/vhost_rxtx.c | 56 ++++++--- lib/librte_vhost/vhost_user/vhost-net-user.c | 25 ++++- lib/librte_vhost/vhost_user/vhost-net-user.h | 4 + lib/librte_vhost/vhost_user/virtio-net-user.c | 83 ++++++++++---- lib/librte_vhost/vhost_user/virtio-net-user.h | 10 ++ lib/librte_vhost/virtio-net.c | 156 ++++++++++++++++---------- 9 files changed, 269 insertions(+), 98 deletions(-) -- 1.9.0