[dpdk-dev] [PATCH v6 00/25] user space vhost library
Hi Huawei, 2014-10-09 02:54, Huawei Xie: > This set of patches transforms and refactors vhost example to a user > space vhost 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. > > vhost lib consists of five APIs plus several helper routines > for feature disable/enable. > 1) rte_vhost_driver_register initializes vhost driver. > 2) rte_vhost_driver_callback_register registers the callbacks. > Callbacks are called from vhost driver when a virtio device is ready > to be added to the data processing core or is de-activated by guest. > 3) rte_vhost_driver_session_start, a blocking API to start vhost > message handler session loop. > 4) rte_vhost_enqueue_burst and rte_vhost_dequeue_burst for > enqueue/dequeue packets to/from virtio ring respectively. > > v2) turn off vhost lib by default > > v3) fixed checkpatch issues > > v4) split the patch per thomas' requirement > > v5) fine granularity split of the patch > regenerate patches based on latest commit > this patchset removes vhost example patches, which will be > submitted later. > > Huawei Xie (25): > move src files from examples/vhost to lib/librte_vhost > rename main.c to vhost_rxtx.c and virtio-net.h to rte_vhost_net.h > keep virtio_dev_(merge_)rx, copy_from_mbuf_to_vring and > virtio_dev_merge_tx; remove anything else in vhost_rxtx.c > remove mac learning, mac/vlan, VMDQ and other switching related logic > remove host memory region region related logic > remove retry > patch virtio_dev_merge_tx to make it return packets to app > patch vhost_dev_merge_tx about buf_size > add queue_id parameter to vhost rx/tx functions > define PACKET_BURST > rte_vhost_en/dequeue_burst API > move virtio_net_config_ll strcture to virtio_net.c > remove index > call get_virtio_net_callbacks to get the ops in register_cuse_device > rte_vhost_driver_register and rte_vhost_session_start API > rte_vhost_callback_register API > add debug print > define VHOST_SUPPORTED_FEATURES > header file cleanup > static fix > add priv field in virtio_net to store application specific context > coding style fixes > add TODO/FIXME > add vhost support in Makefile Thanks for your hard work. There are still few things to clean in this patch splitting but I've did it to apply them. I won't describe all the changes I've done, you can check them in the git repository. In short, some split or merge were needed, some lines were removed and re-added later, build dependencies were not correct and doc generation was missing. You did the big work by really splitting all these stuff. Working on small commits was far easier. Thanks Applied Now you can add the new example. I hope we'll have more reviews and cleanup now that the first version of this library is integrated. -- Thomas
[dpdk-dev] [PATCH v6 00/25] user space vhost library
> -Original Message- > From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com] > Sent: Monday, October 13, 2014 12:52 PM > To: Xie, Huawei > Cc: dev at dpdk.org > Subject: Re: [dpdk-dev] [PATCH v6 00/25] user space vhost library > > Hi Huawei, > > 2014-10-09 02:54, Huawei Xie: > > This set of patches transforms and refactors vhost example to a user > > space vhost 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. > > > > vhost lib consists of five APIs plus several helper routines > > for feature disable/enable. > > 1) rte_vhost_driver_register initializes vhost driver. > > 2) rte_vhost_driver_callback_register registers the callbacks. > > Callbacks are called from vhost driver when a virtio device is ready > > to be added to the data processing core or is de-activated by guest. > > 3) rte_vhost_driver_session_start, a blocking API to start vhost > > message handler session loop. > > 4) rte_vhost_enqueue_burst and rte_vhost_dequeue_burst for > > enqueue/dequeue packets to/from virtio ring respectively. > > > > v2) turn off vhost lib by default > > > > v3) fixed checkpatch issues > > > > v4) split the patch per thomas' requirement > > > > v5) fine granularity split of the patch > > regenerate patches based on latest commit > > this patchset removes vhost example patches, which will be > > submitted later. > > > > Huawei Xie (25): > > move src files from examples/vhost to lib/librte_vhost > > rename main.c to vhost_rxtx.c and virtio-net.h to rte_vhost_net.h > > keep virtio_dev_(merge_)rx, copy_from_mbuf_to_vring and > virtio_dev_merge_tx; remove anything else in vhost_rxtx.c > > remove mac learning, mac/vlan, VMDQ and other switching related logic > > remove host memory region region related logic > > remove retry > > patch virtio_dev_merge_tx to make it return packets to app > > patch vhost_dev_merge_tx about buf_size > > add queue_id parameter to vhost rx/tx functions > > define PACKET_BURST > > rte_vhost_en/dequeue_burst API > > move virtio_net_config_ll strcture to virtio_net.c > > remove index > > call get_virtio_net_callbacks to get the ops in register_cuse_device > > rte_vhost_driver_register and rte_vhost_session_start API > > rte_vhost_callback_register API > > add debug print > > define VHOST_SUPPORTED_FEATURES > > header file cleanup > > static fix > > add priv field in virtio_net to store application specific context > > coding style fixes > > add TODO/FIXME > > add vhost support in Makefile > > Thanks for your hard work. > There are still few things to clean in this patch splitting > but I've did it to apply them. > I won't describe all the changes I've done, you can check them in the > git repository. In short, some split or merge were needed, some lines were > removed and re-added later, build dependencies were not correct and doc > generation was missing. > You did the big work by really splitting all these stuff. Working on small > commits was far easier. Thanks > > Applied > > Now you can add the new example. > I hope we'll have more reviews and cleanup now that the first version of > this library is integrated. Thanks! Would check and submit the example patch soon. Yes, this is the first step, next we would have code cleanup, bug fix, performance tuning, interfaces refine, new qemu us-vhost support, etc. > > -- > Thomas
[dpdk-dev] [PATCH v6 00/25] user space vhost library
> -Original Message- > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Huawei Xie > Sent: Thursday, October 9, 2014 2:55 AM > To: dev at dpdk.org > Subject: [dpdk-dev] [PATCH v6 00/25] user space vhost library > > This set of patches transforms and refactors vhost example to a user space > vhost 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. > > vhost lib consists of five APIs plus several helper routines for feature > disable/enable. > 1) rte_vhost_driver_register initializes vhost driver. > 2) rte_vhost_driver_callback_register registers the callbacks. > Callbacks are called from vhost driver when a virtio device is ready to be > added to the data processing core or is de-activated by guest. > 3) rte_vhost_driver_session_start, a blocking API to start vhost message > handler session loop. > 4) rte_vhost_enqueue_burst and rte_vhost_dequeue_burst for > enqueue/dequeue packets to/from virtio ring respectively. > > v2) turn off vhost lib by default > > v3) fixed checkpatch issues > > v4) split the patch per thomas' requirement > > v5) fine granularity split of the patch > regenerate patches based on latest commit > this patchset removes vhost example patches, which will be submitted > later. > > Huawei Xie (25): > move src files from examples/vhost to lib/librte_vhost > rename main.c to vhost_rxtx.c and virtio-net.h to rte_vhost_net.h > keep virtio_dev_(merge_)rx, copy_from_mbuf_to_vring and > virtio_dev_merge_tx; remove anything else in vhost_rxtx.c > remove mac learning, mac/vlan, VMDQ and other switching related logic > remove host memory region region related logic > remove retry > patch virtio_dev_merge_tx to make it return packets to app > patch vhost_dev_merge_tx about buf_size > add queue_id parameter to vhost rx/tx functions > define PACKET_BURST > rte_vhost_en/dequeue_burst API > move virtio_net_config_ll strcture to virtio_net.c > remove index > call get_virtio_net_callbacks to get the ops in register_cuse_device > rte_vhost_driver_register and rte_vhost_session_start API > rte_vhost_callback_register API > add debug print > define VHOST_SUPPORTED_FEATURES > header file cleanup > static fix > add priv field in virtio_net to store application specific context > coding style fixes > add TODO/FIXME > add vhost support in Makefile > > config/common_linuxapp |8 + > examples/vhost/Makefile | 60 - > 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| 3727 > -- > examples/vhost/main.h| 86 - > 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/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| 208 ++ > lib/librte_vhost/vhost-net-cdev.c| 360 +++ > lib/librte_vhost/vhost-net-cdev.h| 113 + > lib/librte_vhost/vhost_rxtx.c| 733 + > lib/librte_vhost/virtio-net.c| 1028 +++ > mk/rte.app.mk|5 + > 23 files changed, 3146 insertions(+), 6339 deletions(-) delete mode 100644 > examples/vhost/Makefile 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/main.c delete mode 100644 > examples/vhost/main.h 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/eventfd_link/Makefile > create mode 100644 lib/librte_vhost/eventfd_link/eventfd_link.c > create mode 100644 lib/librt
[dpdk-dev] [PATCH v6 00/25] user space vhost library
Hi Thomas: Comments to this way of split? > -Original Message- > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Huawei Xie > Sent: Wednesday, October 08, 2014 11:55 AM > To: dev at dpdk.org > Subject: [dpdk-dev] [PATCH v6 00/25] user space vhost library > > This set of patches transforms and refactors vhost example to a user > space vhost 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. > > vhost lib consists of five APIs plus several helper routines > for feature disable/enable. > 1) rte_vhost_driver_register initializes vhost driver. > 2) rte_vhost_driver_callback_register registers the callbacks. > Callbacks are called from vhost driver when a virtio device is ready > to be added to the data processing core or is de-activated by guest. > 3) rte_vhost_driver_session_start, a blocking API to start vhost > message handler session loop. > 4) rte_vhost_enqueue_burst and rte_vhost_dequeue_burst for > enqueue/dequeue packets to/from virtio ring respectively. > > v2) turn off vhost lib by default > > v3) fixed checkpatch issues > > v4) split the patch per thomas' requirement > > v5) fine granularity split of the patch > regenerate patches based on latest commit > this patchset removes vhost example patches, which will be > submitted later. > > Huawei Xie (25): > move src files from examples/vhost to lib/librte_vhost > rename main.c to vhost_rxtx.c and virtio-net.h to rte_vhost_net.h > keep virtio_dev_(merge_)rx, copy_from_mbuf_to_vring and > virtio_dev_merge_tx; remove anything else in vhost_rxtx.c > remove mac learning, mac/vlan, VMDQ and other switching related logic > remove host memory region region related logic > remove retry > patch virtio_dev_merge_tx to make it return packets to app > patch vhost_dev_merge_tx about buf_size > add queue_id parameter to vhost rx/tx functions > define PACKET_BURST > rte_vhost_en/dequeue_burst API > move virtio_net_config_ll strcture to virtio_net.c > remove index > call get_virtio_net_callbacks to get the ops in register_cuse_device > rte_vhost_driver_register and rte_vhost_session_start API > rte_vhost_callback_register API > add debug print > define VHOST_SUPPORTED_FEATURES > header file cleanup > static fix > add priv field in virtio_net to store application specific context > coding style fixes > add TODO/FIXME > add vhost support in Makefile > > config/common_linuxapp |8 + > examples/vhost/Makefile | 60 - > 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| 3727 > -- > examples/vhost/main.h| 86 - > 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/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| 208 ++ > lib/librte_vhost/vhost-net-cdev.c| 360 +++ > lib/librte_vhost/vhost-net-cdev.h| 113 + > lib/librte_vhost/vhost_rxtx.c| 733 + > lib/librte_vhost/virtio-net.c| 1028 +++ > mk/rte.app.mk|5 + > 23 files changed, 3146 insertions(+), 6339 deletions(-) > delete mode 100644 examples/vhost/Makefile > 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/main.c > delete mode 100644 examples/vhost/main.h > 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/eventfd_link/Makefile > create mode 100644 lib/librte_vhost/eventfd_link/eventfd
[dpdk-dev] [PATCH v6 00/25] user space vhost library
This set of patches transforms and refactors vhost example to a user space vhost 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. vhost lib consists of five APIs plus several helper routines for feature disable/enable. 1) rte_vhost_driver_register initializes vhost driver. 2) rte_vhost_driver_callback_register registers the callbacks. Callbacks are called from vhost driver when a virtio device is ready to be added to the data processing core or is de-activated by guest. 3) rte_vhost_driver_session_start, a blocking API to start vhost message handler session loop. 4) rte_vhost_enqueue_burst and rte_vhost_dequeue_burst for enqueue/dequeue packets to/from virtio ring respectively. v2) turn off vhost lib by default v3) fixed checkpatch issues v4) split the patch per thomas' requirement v5) fine granularity split of the patch regenerate patches based on latest commit this patchset removes vhost example patches, which will be submitted later. Huawei Xie (25): move src files from examples/vhost to lib/librte_vhost rename main.c to vhost_rxtx.c and virtio-net.h to rte_vhost_net.h keep virtio_dev_(merge_)rx, copy_from_mbuf_to_vring and virtio_dev_merge_tx; remove anything else in vhost_rxtx.c remove mac learning, mac/vlan, VMDQ and other switching related logic remove host memory region region related logic remove retry patch virtio_dev_merge_tx to make it return packets to app patch vhost_dev_merge_tx about buf_size add queue_id parameter to vhost rx/tx functions define PACKET_BURST rte_vhost_en/dequeue_burst API move virtio_net_config_ll strcture to virtio_net.c remove index call get_virtio_net_callbacks to get the ops in register_cuse_device rte_vhost_driver_register and rte_vhost_session_start API rte_vhost_callback_register API add debug print define VHOST_SUPPORTED_FEATURES header file cleanup static fix add priv field in virtio_net to store application specific context coding style fixes add TODO/FIXME add vhost support in Makefile config/common_linuxapp |8 + examples/vhost/Makefile | 60 - 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| 3727 -- examples/vhost/main.h| 86 - 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/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| 208 ++ lib/librte_vhost/vhost-net-cdev.c| 360 +++ lib/librte_vhost/vhost-net-cdev.h| 113 + lib/librte_vhost/vhost_rxtx.c| 733 + lib/librte_vhost/virtio-net.c| 1028 +++ mk/rte.app.mk|5 + 23 files changed, 3146 insertions(+), 6339 deletions(-) delete mode 100644 examples/vhost/Makefile 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/main.c delete mode 100644 examples/vhost/main.h 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/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