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 210217DF7 for ; Fri, 26 Sep 2014 11:39:59 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 26 Sep 2014 02:46:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,603,1406617200"; d="scan'208";a="597179612" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 26 Sep 2014 02:46:01 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id s8Q9k1iw005736 for ; Fri, 26 Sep 2014 17:46:01 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s8Q9jwfq027523 for ; Fri, 26 Sep 2014 17:46:00 +0800 Received: (from hxie5@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id s8Q9jwkR027519 for dev@dpdk.org; Fri, 26 Sep 2014 17:45:58 +0800 From: Huawei Xie To: dev@dpdk.org Date: Fri, 26 Sep 2014 17:45:47 +0800 Message-Id: <1411724758-27488-1-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH v5 00/11] user space vhost library and vhost example 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: Fri, 26 Sep 2014 09:40:00 -0000 This set of patches transforms and refactors vhost example to a user space vhost library and a new vhost example based on this library. This library implements a user space vhost cuse driver, and provides generic APIs for user space ethernet vSwitch to integrate us-vhost for fast packet switching with guest virtio. The vhost lib consists of five APIs puls several other helper routines. 1) rte_vhost_driver_register initialises vhost driver. 2) rte_vhost_driver_callback_register registers new_device/destroy_device callbacks. Those callbacks should be implemented in ethernet switch application. new_device is called when a virtio_device is ready for processing. destroy_device is called when a virtio_device is de-activated by guest. 3) rte_vhost_driver_session_start starts vhost driver 4) rte_vhost_enqueue_burst and rte_vhost_dequeue_burst for enqueue/dequeue to/from virtio ring. Change notes: v2) Turn of vhost lib by default v3) Fixed checkpatch issues v4) Split the monolithic patch v5) Merge merge-able rx/tx and mbuf change. Lots of coding style fixes. Huawei Xie (11): 1) move src files in vhost example to vhost lib directory. 2) copy vhost rx/tx functions from main.c to a new file vhost_rxtx.c. 3) remove main.c and main.h in vhost lib. 4) rename virtio-net.h to rte_virtio_net.h as API header file. 5) VMDQ, MAC learning related switching logic are removed from library. 6) zero copy logic isn't generic enough at this stage, and is moved to example. 7) retry logic is moved from vhost rx functions in vhost lib to switch_worker switching function in example. 8) add TODOs/FIXME -allow application to disable cmpset reserve in rte_vhost_enqueue_burst in case there is no contention. -fix memcpy from mbuf to vring desc when mbuf is chained and the desc couldn't hold all the data -fix vhost_set_mem_table possible race condition: two vqs concurrently calls set_mem_table which cause saved mem_temp to be overided. 9) merge vhost merge-able rx 10) for vhost tx, previous vhost merge-able feature introduces another version of virtio_dev_merge_tx, and calls virtio_dev_tx and vritio_dev_merge_tx respectively depends on whether the vhost device supports merge-able feature. Actually "merge-able" tx is the fix for memcpy from chained vring desc to mbuf. will use virtio_dev_merge_tx as the base for vhost tx. 11) merge mbuf patch in vhost lib. 12) fixes serious coding style issues. 13) add vhost lib Makefile and vhost lib support in DPDK makefile. vhost lib is turned off by default as it requires fuse-devel package. 14) copy old vhost example files main.c and main.h as the base for new vhost example 15) modify vhost example to use vhost lib API, and merge Oliver's mbuf patch. config/common_linuxapp | 8 + examples/vhost/Makefile | 10 +- examples/vhost/eventfd_link/Makefile | 39 - examples/vhost/eventfd_link/eventfd_link.c | 205 ---- examples/vhost/eventfd_link/eventfd_link.h | 79 -- examples/vhost/libvirt/qemu-wrap.py | 367 ------- examples/vhost/main.c | 1465 +++++++------------------- examples/vhost/main.h | 47 +- examples/vhost/vhost-net-cdev.c | 367 ------- examples/vhost/vhost-net-cdev.h | 83 -- examples/vhost/virtio-net.c | 1165 -------------------- examples/vhost/virtio-net.h | 161 --- lib/Makefile | 1 + lib/librte_vhost/Makefile | 48 + lib/librte_vhost/eventfd_link/Makefile | 39 + lib/librte_vhost/eventfd_link/eventfd_link.c | 205 ++++ lib/librte_vhost/eventfd_link/eventfd_link.h | 79 ++ lib/librte_vhost/libvirt/qemu-wrap.py | 367 +++++++ lib/librte_vhost/rte_virtio_net.h | 207 ++++ lib/librte_vhost/vhost-net-cdev.c | 362 +++++++ lib/librte_vhost/vhost-net-cdev.h | 113 ++ lib/librte_vhost/vhost_rxtx.c | 737 +++++++++++++ lib/librte_vhost/virtio-net.c | 1029 ++++++++++++++++++ mk/rte.app.mk | 5 + 24 files changed, 3636 insertions(+), 3552 deletions(-) delete mode 100644 examples/vhost/eventfd_link/Makefile delete mode 100644 examples/vhost/eventfd_link/eventfd_link.c delete mode 100644 examples/vhost/eventfd_link/eventfd_link.h delete mode 100755 examples/vhost/libvirt/qemu-wrap.py delete mode 100644 examples/vhost/vhost-net-cdev.c delete mode 100644 examples/vhost/vhost-net-cdev.h delete mode 100644 examples/vhost/virtio-net.c delete mode 100644 examples/vhost/virtio-net.h create mode 100644 lib/librte_vhost/Makefile create mode 100644 lib/librte_vhost/eventfd_link/Makefile create mode 100644 lib/librte_vhost/eventfd_link/eventfd_link.c create mode 100644 lib/librte_vhost/eventfd_link/eventfd_link.h create mode 100755 lib/librte_vhost/libvirt/qemu-wrap.py create mode 100644 lib/librte_vhost/rte_virtio_net.h create mode 100644 lib/librte_vhost/vhost-net-cdev.c create mode 100644 lib/librte_vhost/vhost-net-cdev.h create mode 100644 lib/librte_vhost/vhost_rxtx.c create mode 100644 lib/librte_vhost/virtio-net.c -- 1.8.1.4