vhost: generic vhost API
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest22 patches 6 repliesIn review
- v322 patches 10 repliesSuperseded
- v222 patches 0 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 17 patches | 32 replies | Superseded |
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/22 | vhost: introduce driver features related APIsdoc/ lib/ lib/ +1 more | +157 | 1 reply | |
| 2/22 | net/vhost: remove feature related APIsdoc/ drivers/ drivers/ +1 more | +13 | 0 replies | |
| 3/22 | vhost: use new APIs to handle featuresexamples/ examples/ lib/ +5 more | +83 | 0 replies | |
| 4/22 | vhost: make notify ops per vhost driverdoc/ doc/ drivers/ +7 more | +84 | 0 replies | |
| 5/22 | vhost: export guest memory regionslib/ lib/ lib/ +2 more | +70 | 0 replies | |
| 6/22 | vhost: introduce API to fetch negotiated featureslib/ lib/ lib/ | +26 | 1 reply | |
| 7/22 | vhost: export vhost vring infolib/ lib/ lib/ +1 more | +59 | 0 replies | |
| 8/22 | vhost: export API to translate gpa to vvalib/ lib/ lib/ +1 more | +42 | 0 replies | |
| 9/22 | vhost: turn queue pair to vringlib/ lib/ lib/ +1 more | +42 | 0 replies | |
| 10/22 | vhost: export the number of vringsdoc/ drivers/ lib/ +2 more | +33 | 0 replies | |
| 11/22 | vhost: move the device ready check at proper placelib/ | +18 | 0 replies | |
| 12/22 | vhost: drop the Rx and Tx queue macrodoc/ drivers/ examples/ +2 more | +12 | 1 reply | |
| 13/22 | vhost: do not include net specific headersdoc/ examples/ lib/ +1 more | +13 | 0 replies | |
| 14/22 | vhost: rename device ops structdoc/ doc/ drivers/ +6 more | +15 | 0 replies | |
| 15/22 | vhost: rename virtio-net to vhostdoc/ lib/ | +10 | 0 replies | |
| 16/22 | vhost: add features changed callbackdoc/ lib/ lib/ | +20 | 0 replies | |
| 17/22 | vhost: export APIs for live migration supportlib/ lib/ lib/ +2 more | +114 | 0 replies | |
| 18/22 | vhost: introduce API to start a specific driverdoc/ doc/ drivers/ +7 more | +104 | 0 replies | |
| 19/22 | vhost: rename header filedoc/ doc/ drivers/ +11 more | +438 | 2 replies | |
| 20/22 | vhost: workaround the build dependency on mbuf headerlib/ | +2 | 0 replies | |
| 21/22 | vhost: do not destroy device on repeat mem table messagelib/ | +0 | 0 replies | |
| 22/22 | examples/vhost: demonstrate the new generic vhost APIsexamples/ examples/ examples/ +1 more | +465 | 0 replies |
Reviews trailers per patch
21 of 22 patches have a Reviewed-by or Acked-by.
| Patch | Maxime Coquelin |
|---|---|
| 1/22 | R-b |
| 2/22 | A-b |
| 3/22 | R-b |
| 4/22 | R-b |
| 5/22 | R-b |
| 6/22 | R-b |
| 7/22 | R-b |
| 8/22 | R-b |
| 9/22 | R-b |
| 10/22 | R-b |
| 11/22 | R-b |
| 12/22 | R-b |
| 13/22 | R-b |
| 14/22 | R-b |
| 15/22 | R-b |
| 16/22 | R-b |
| 17/22 | R-b |
| 18/22 | R-b |
| 19/22 | R-b |
| 20/22 | R-b |
| 21/22 | R-b |
| 22/22 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 00/22] vhost: generic vhost API
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.
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
Signature · 1 line
1.9.0