Skip to contentSkip to conversation

vhost: ABI/API change announcement due to refactor

PATCH Applied Yuanhan Liu 3 participants 4 messages Apr 6, 2016 – Apr 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: ABI/API change announcement due to refactor

We currently exposed way too many fields (or even structures) than necessary. For example, vhost_virtqueue struct should NOT be exposed to user at all: application just need to tell the right queue id to locate a specific queue, and that's all. Instead, the structure should be defined in an internal header file. With that, we could do any changes to it we want, without worrying about that we may offense the painful ABI rules.

Similar changes could be done to virtio_net struct as well, just exposing very few fields that are necessary and moving all others to an internal structure.

Huawei then suggested a more radical yet much cleaner one: just exposing a virtio_net handle to application, just like the way kernel exposes an fd to user for locating a specific file, and exposing some new functions to access those old fields, such as flags, virt_qp_nb.

With this change, we're likely to be free from ABI violations forever (well, except when we have to extend the virtio_net_device_ops struct). For example, following nice cleanup would not be a blocking one then:

    http://dpdk.org/ml/archives/dev/2016-February/033528.html
---
 doc/guides/rel_notes/deprecation.rst | 7 +++++++
 1 file changed, 7 insertions(+)
doc/guides/rel_notes/deprecation.rst +7 -0
index ad31355..7d16d86 100644
@@ -40,3 +40,10 @@ Deprecation Notices
   The existing API will be backward compatible, but there will be new API
   functions added to facilitate the creation of mempools using an external
   handler. The 16.07 release will contain these changes.
+
+* A librte_vhost public structures refactor is planned for DPDK 16.07
+  that requires both ABI and API change.
+  The proposed refactor would expose DPDK vhost dev to applications as
+  a handle, like the way kernel exposes an fd to user for locating a
+  specific file, and to keep all major structures internally, so that
+  we are likely to be free from ABI violations in future.
Signature · 1 line
1.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 36 lines · Yuanhan Liu

We currently exposed way too many fields (or even structures) than necessary. For example, vhost_virtqueue struct should NOT be exposed to user at all: application just need to tell the right queue id to locate a specific queue, and that's all. Instead, the structure should be defined in an internal header file. With that, we could do any changes to it we want, without worrying about that we may offense the painful ABI rules.

Similar changes could be done to virtio_net struct as well, just exposing very few fields that are necessary and moving all others to an internal structure.

Huawei then suggested a more radical yet much cleaner one: just exposing a virtio_net handle to application, just like the way kernel exposes an fd to user for locating a specific file, and exposing some new functions to access those old fields, such as flags, virt_qp_nb.

With this change, we're likely to be free from ABI violations forever (well, except when we have to extend the virtio_net_device_ops struct). For example, following nice cleanup would not be a blocking one then:

     http://dpdk.org/ml/archives/dev/2016-February/033528.html
---
  doc/guides/rel_notes/deprecation.rst | 7 +++++++
  1 file changed, 7 insertions(+)
doc/guides/rel_notes/deprecation.rst +0 -0
index ad31355..7d16d86 100644

doc/guides/rel_notes/deprecation.rst Deprecation Notices · line 49

Quoted 10 lines
doc/guides/rel_notes/deprecation.rst +7 -0
@@ -40,3 +40,10 @@ Deprecation Notices
    The existing API will be backward compatible, but there will be new API
    functions added to facilitate the creation of mempools using an external
    handler. The 16.07 release will contain these changes.
+
+* A librte_vhost public structures refactor is planned for DPDK 16.07
+  that requires both ABI and API change.
+  The proposed refactor would expose DPDK vhost dev to applications as
+  a handle, like the way kernel exposes an fd to user for locating a
+  specific file, and to keep all major structures internally, so that
+  we are likely to be free from ABI violations in future.

I applaud the initiative, public structs are by far the worst offender when trying to maintain a stable ABI because they're so hard to correctly version that hardly anybody besides glibc bothers.

- Panu -

#2 lore raw

2016-04-07 10:12, Panu Matilainen:

Quoted 8 lines · Yuanhan Liu

doc/guides/rel_notes/deprecation.rst Deprecation Notices · line 49

Quoted 6 lines
doc/guides/rel_notes/deprecation.rst +6 -0
+* A librte_vhost public structures refactor is planned for DPDK 16.07
+  that requires both ABI and API change.
+  The proposed refactor would expose DPDK vhost dev to applications as
+  a handle, like the way kernel exposes an fd to user for locating a
+  specific file, and to keep all major structures internally, so that
+  we are likely to be free from ABI violations in future.
Quoted 5 lines

I applaud the initiative, public structs are by far the worst offender when trying to maintain a stable ABI because they're so hard to correctly version that hardly anybody besides glibc bothers.

Yes, nice cleanup to do.

#3 lore raw
Quoted 9 lines
Quoted 9 lines

doc/guides/rel_notes/deprecation.rst Deprecation Notices · line 49

Quoted 6 lines
doc/guides/rel_notes/deprecation.rst +6 -0
+* A librte_vhost public structures refactor is planned for DPDK 16.07
+  that requires both ABI and API change.
+  The proposed refactor would expose DPDK vhost dev to applications as
+  a handle, like the way kernel exposes an fd to user for locating a
+  specific file, and to keep all major structures internally, so that
+  we are likely to be free from ABI violations in future.
Quoted 7 lines
Quoted 3 lines

I applaud the initiative, public structs are by far the worst offender when trying to maintain a stable ABI because they're so hard to correctly version that hardly anybody besides glibc bothers.

Yes, nice cleanup to do.

Applied, thanks