Skip to content

vhost ABI/API refactoring

Yuanhan Liu dpdk-dev 3 versions – Applied

Status from this message: Applied to dpdk-next-virtio.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest20 patches 11 repliesApplied
  2. v219 patches 2 repliesSuperseded
  3. v116 patches 5 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/20vhost: declare backend with int typelib/librte_vhost/rte_virtio_net.h lib/librte_vhost/virtio-net.c+3 -30 replies
2/20vhost: set/reset dev flags internallydrivers/net/vhost/rte_eth_vhost.c examples/vhost/main.c lib/librte_vhost/vhost_user/virtio-net-user.c +1 more+21 -160 replies
3/20vhost: declare device fh as intexamples/vhost/main.c lib/librte_vhost/rte_virtio_net.h lib/librte_vhost/vhost-net.h +6 more+75 -800 replies
4/20examples/vhost: make a copy of virtio device idexamples/vhost/main.c examples/vhost/main.h+29 -310 replies
5/20vhost: rename device fh to videxamples/vhost/main.c examples/vhost/main.h lib/librte_vhost/rte_virtio_net.h +7 more+83 -830 replies
6/20vhost: get device by vid onlylib/librte_vhost/vhost-net.h lib/librte_vhost/vhost_cuse/vhost-net-cdev.c lib/librte_vhost/vhost_cuse/virtio-net-cdev.c +5 more+132 -1470 replies
7/20vhost: move vhost device ctx to cuselib/librte_vhost/vhost-net.h lib/librte_vhost/vhost_cuse/vhost-net-cdev.c lib/librte_vhost/vhost_cuse/virtio-net-cdev.c +1 more+21 -180 replies
8/20vhost: introduce new API to export numa nodedrivers/net/vhost/rte_eth_vhost.c lib/librte_vhost/rte_vhost_version.map lib/librte_vhost/rte_virtio_net.h +1 more+49 -95 replies
9/20vhost: introduce new API to export number of queuesdrivers/net/vhost/rte_eth_vhost.c lib/librte_vhost/rte_vhost_version.map lib/librte_vhost/rte_virtio_net.h +1 more+24 -10 replies
10/20vhost: introduce new API to export ifnamedrivers/net/vhost/rte_eth_vhost.c lib/librte_vhost/rte_vhost_version.map lib/librte_vhost/rte_virtio_net.h +1 more+42 -40 replies
11/20vhost: introduce new API to export queue free entriesdoc/guides/rel_notes/release_16_07.rst examples/vhost/main.c lib/librte_vhost/rte_vhost_version.map +2 more+35 -130 replies
12/20vhost: remove dependency on priv fielddrivers/net/vhost/rte_eth_vhost.c examples/vhost/main.c+14 -90 replies
13/20vhost: export vid as the only interface to applicationsdoc/guides/rel_notes/release_16_07.rst drivers/net/vhost/rte_eth_vhost.c examples/vhost/main.c +6 more+77 -720 replies
14/20vhost: hide internal structs/macros/functionslib/librte_vhost/rte_virtio_net.h lib/librte_vhost/vhost-net.h lib/librte_vhost/vhost_user/vhost-net-user.h+150 -1390 replies
15/20vhost: remove unnecessary fieldslib/librte_vhost/vhost-net.h+0 -30 replies
16/20vhost: remove virtio-net.hlib/librte_vhost/vhost-net.h lib/librte_vhost/vhost_cuse/virtio-net-cdev.c lib/librte_vhost/vhost_rxtx.c +3 more+3 -470 replies
17/20vhost: reserve few more space for future extensionlib/librte_vhost/rte_virtio_net.h+2 -00 replies
18/20examples/tep_term: adapt to new vhost ABI/API changesexamples/tep_termination/main.c examples/tep_termination/main.h examples/tep_termination/vxlan_setup.c +1 more+57 -570 replies
19/20vhost: per device virtio net header lenlib/librte_vhost/vhost-net.h lib/librte_vhost/vhost_rxtx.c lib/librte_vhost/virtio-net.c+23 -320 replies
20/20vhost: make buf vector for scatter Rx locallib/librte_vhost/vhost-net.h lib/librte_vhost/vhost_rxtx.c+22 -200 replies

Reviews trailers per patch

19 of 20 patches have a Reviewed-by or Acked-by.

PatchRich Lane
1/20T-b A-b
2/20T-b A-b
3/20T-b A-b
4/20T-b A-b
5/20T-b A-b
6/20T-b A-b
7/20T-b A-b
8/20T-b A-b T-b A-b
9/20T-b A-b
10/20T-b A-b
11/20T-b A-b
12/20T-b A-b
13/20T-b A-b
14/20T-b A-b
15/20T-b A-b
16/20T-b A-b
17/20T-b A-b
18/20
19/20T-b A-b
20/20T-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/20] vhost ABI/API refactoring

v3: - adapted the new vhost ABI/API changes to tep_term example, to make
sure not break build at least.
- bumped the ABI version to 3

NOTE: I created a branch at dpdk.org [0] for more conveinient testing:

[0]: git://dpdk.org/next/dpdk-next-virtio for-testing

Every time we introduce a new feature to vhost, we are likely to break ABI. Moreover, some cleanups (such as the one from Ilya to remove vec_buf from vhost_virtqueue struct) also break ABI.

This patch set is meant to resolve above issue ultimately, by hiding virtio_net structure (as well as few others) internaly, and export the virtio_net dev strut to applications by a number, vid, like the way kernel exposes an fd to user space.

Back to the patch set, the first part of this set makes some changes to vhost example, vhost-pmd and vhost, bit by bit, to remove the dependence to "virtio_net" struct. And then do the final change to make the current APIs to adapt to using "vid".

After that, "vrtio_net_device_ops" is the only left open struct that an application can acces, therefore, it's the only place that might introduce potential ABI breakage in future for extension. Hence, I made few more
(5) space reservation, to make sure we will not break ABI for a long time, and hopefuly, forever.

The last bit of this patch set is some cleanups, including the one from Ilya.

v2: - exported ifname as well to fix a vhost-pmd issue reported by Rich
- separated the big patch that introduces several new APIs into some small patches.
- updated release note
- updated version.map

Thanks.

	--yliu

---
Ilya Maximets (1):
vhost: make buf vector for scatter Rx local

Yuanhan Liu (19):
vhost: declare backend with int type
vhost: set/reset dev flags internally
vhost: declare device fh as int examples/vhost: make a copy of virtio device id
vhost: rename device fh to vid
vhost: get device by vid only
vhost: move vhost device ctx to cuse
vhost: introduce new API to export numa node
vhost: introduce new API to export number of queues
vhost: introduce new API to export ifname
vhost: introduce new API to export queue free entries
vhost: remove dependency on priv field
vhost: export vid as the only interface to applications
vhost: hide internal structs/macros/functions
vhost: remove unnecessary fields
vhost: remove virtio-net.h
vhost: reserve few more space for future extension examples/tep_term: adapt to new vhost ABI/API changes
vhost: per device virtio net header len

 doc/guides/rel_notes/release_16_07.rst        |  11 +-
 drivers/net/vhost/rte_eth_vhost.c             |  79 ++++-----
 examples/tep_termination/main.c               |  83 +++++-----
 examples/tep_termination/main.h               |   5 +-
 examples/tep_termination/vxlan_setup.c        |  20 +--
 examples/tep_termination/vxlan_setup.h        |   6 +-
 examples/vhost/main.c                         | 116 +++++++------
 examples/vhost/main.h                         |   3 +-
 lib/librte_vhost/Makefile                     |   2 +-
 lib/librte_vhost/rte_vhost_version.map        |  10 ++
 lib/librte_vhost/rte_virtio_net.h             | 223 +++++++------------------
 lib/librte_vhost/vhost-net.h                  | 201 ++++++++++++++++++----
 lib/librte_vhost/vhost_cuse/vhost-net-cdev.c  |  83 +++++-----
 lib/librte_vhost/vhost_cuse/virtio-net-cdev.c |  30 ++--
 lib/librte_vhost/vhost_cuse/virtio-net-cdev.h |  12 +-
 lib/librte_vhost/vhost_rxtx.c                 | 133 ++++++++-------
 lib/librte_vhost/vhost_user/vhost-net-user.c  |  53 +++---
 lib/librte_vhost/vhost_user/vhost-net-user.h  |   2 +
 lib/librte_vhost/vhost_user/virtio-net-user.c |  64 +++----
 lib/librte_vhost/vhost_user/virtio-net-user.h |  18 +-
 lib/librte_vhost/virtio-net.c                 | 229 +++++++++++++++++---------
 lib/librte_vhost/virtio-net.h                 |  43 -----
 22 files changed, 752 insertions(+), 674 deletions(-)
 delete mode 100644 lib/librte_vhost/virtio-net.h
Signature · 1 line
1.9.0