From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id DAD43DE0 for ; Sat, 1 Apr 2017 10:47:24 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP; 01 Apr 2017 01:47:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,256,1486454400"; d="scan'208";a="83414144" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by fmsmga006.fm.intel.com with ESMTP; 01 Apr 2017 01:47:22 -0700 Date: Sat, 1 Apr 2017 16:44:49 +0800 From: Yuanhan Liu To: dev@dpdk.org Cc: Maxime Coquelin , Harris James R , Liu Changpeng Message-ID: <20170401084449.GZ18844@yliu-dev.sh.intel.com> References: <1491031380-1499-1-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1491031380-1499-1-git-send-email-yuanhan.liu@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v4 00/22] vhost: generic vhost API 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: Sat, 01 Apr 2017 08:47:25 -0000 On Sat, Apr 01, 2017 at 03:22:38PM +0800, Yuanhan Liu wrote: > This patchset makes DPDK vhost library generic enough, so that we could > build other vhost-user drivers on top of it. For example, SPDK (Storage > Performance Development Kit) is trying to enable vhost-user SCSI. > > The basic idea is, let DPDK vhost be a vhost-user agent. It stores all > the info about the virtio device (i.e. vring address, negotiated features, > etc) and let the specific vhost-user driver to fetch them (by the API > provided by DPDK vhost lib). With those info being provided, the vhost-user > driver then could get/put vring entries, thus, it could exchange data > between the guest and host. > > The last patch demonstrates how to use these new APIs to implement a > very simple vhost-user net driver, without any fancy features enabled. Series applied to dpdk-next-virtio. --yliu > > > Change log > ========== > > v2: - rebase > - updated release note > - updated API comments > - renamed rte_vhost_get_vhost_memory to rte_vhost_get_mem_table > > - added a new device callback: features_changed(), bascially for live > migration support > - introduced rte_vhost_driver_start() to start a specific driver > - misc fixes > > v3: - rebaseon top of vhost-user socket fix > - fix reconnect > - fix shared build > - fix typos > > v4: - rebase > - let rte_vhost_get.*_features() to return features by parameter and > return -1 on failure > - Follow the style of ring rework to update the release note: use one > entry for all vhost changes and add sub items for each change. > > > Major API/ABI Changes summary > ============================= > > - some renames > * "struct virtio_net_device_ops" ==> "struct vhost_device_ops" > * "rte_virtio_net.h" ==> "rte_vhost.h" > > - driver related APIs are bond with the socket file > * rte_vhost_driver_set_features(socket_file, features); > * rte_vhost_driver_get_features(socket_file, features); > * rte_vhost_driver_enable_features(socket_file, features) > * rte_vhost_driver_disable_features(socket_file, features) > * rte_vhost_driver_callback_register(socket_file, notify_ops); > * rte_vhost_driver_start(socket_file); > This function replaces rte_vhost_driver_session_start(). Check patch > 18 for more information. > > - new APIs to fetch guest and vring info > * rte_vhost_get_mem_table(vid, mem); > * rte_vhost_get_negotiated_features(vid); > * rte_vhost_get_vhost_vring(vid, vring_idx, vring); > > - new exported structures > * struct rte_vhost_vring > * struct rte_vhost_mem_region > * struct rte_vhost_memory > > - a new device ops callback: features_changed(). > > > --yliu > > --- > Yuanhan Liu (22): > vhost: introduce driver features related APIs > net/vhost: remove feature related APIs > vhost: use new APIs to handle features > vhost: make notify ops per vhost driver > vhost: export guest memory regions > vhost: introduce API to fetch negotiated features > vhost: export vhost vring info > vhost: export API to translate gpa to vva > vhost: turn queue pair to vring > vhost: export the number of vrings > vhost: move the device ready check at proper place > vhost: drop the Rx and Tx queue macro > vhost: do not include net specific headers > vhost: rename device ops struct > vhost: rename virtio-net to vhost > vhost: add features changed callback > vhost: export APIs for live migration support > vhost: introduce API to start a specific driver > vhost: rename header file > vhost: workaround the build dependency on mbuf header > vhost: do not destroy device on repeat mem table message > examples/vhost: demonstrate the new generic vhost APIs > > doc/guides/prog_guide/vhost_lib.rst | 42 +-- > doc/guides/rel_notes/deprecation.rst | 9 - > doc/guides/rel_notes/release_17_05.rst | 43 +++ > drivers/net/vhost/rte_eth_vhost.c | 101 ++----- > drivers/net/vhost/rte_eth_vhost.h | 32 +-- > drivers/net/vhost/rte_pmd_vhost_version.map | 3 - > examples/tep_termination/main.c | 23 +- > examples/tep_termination/main.h | 2 + > examples/tep_termination/vxlan_setup.c | 2 +- > examples/vhost/Makefile | 2 +- > examples/vhost/main.c | 100 +++++-- > examples/vhost/main.h | 32 ++- > examples/vhost/virtio_net.c | 405 ++++++++++++++++++++++++++ > lib/librte_vhost/Makefile | 4 +- > lib/librte_vhost/fd_man.c | 9 +- > lib/librte_vhost/fd_man.h | 2 +- > lib/librte_vhost/rte_vhost.h | 427 ++++++++++++++++++++++++++++ > lib/librte_vhost/rte_vhost_version.map | 16 +- > lib/librte_vhost/rte_virtio_net.h | 208 -------------- > lib/librte_vhost/socket.c | 229 ++++++++++++--- > lib/librte_vhost/vhost.c | 230 ++++++++------- > lib/librte_vhost/vhost.h | 113 +++++--- > lib/librte_vhost/vhost_user.c | 121 ++++---- > lib/librte_vhost/vhost_user.h | 2 +- > lib/librte_vhost/virtio_net.c | 71 ++--- > 25 files changed, 1541 insertions(+), 687 deletions(-) > create mode 100644 examples/vhost/virtio_net.c > create mode 100644 lib/librte_vhost/rte_vhost.h > delete mode 100644 lib/librte_vhost/rte_virtio_net.h > > -- > 1.9.0