v23.11 is a ABI breaking release, remove compatibility code for the previous major ABI version.
Signed-off-by: David Marchand <[email protected]> --- lib/vhost/meson.build | 2 -- lib/vhost/socket.c | 59 +++---------------------------------------- lib/vhost/version.map | 8 +----- lib/vhost/vhost.h | 6 ----- 4 files changed, 5 insertions(+), 70 deletions(-) diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build index 94f3d2535e..41b622a9be 100644 --- a/lib/vhost/meson.build +++ b/lib/vhost/meson.build @@ -43,5 +43,3 @@ driver_sdk_headers = files( 'vdpa_driver.h', ) deps += ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev'] - -use_function_versioning = true diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c index 033f4b3b75..fefe60fae6 100644 --- a/lib/vhost/socket.c +++ b/lib/vhost/socket.c @@ -15,7 +15,6 @@ #include <fcntl.h> #include <pthread.h> -#include <rte_function_versioning.h> #include <rte_log.h> #include "fd_man.h" @@ -64,7 +63,6 @@ struct vhost_user_socket { struct rte_vdpa_device *vdpa_dev; struct rte_vhost_device_ops const *notify_ops; - struct rte_vhost_device_ops *malloc_notify_ops; }; struct vhost_user_connection { @@ -880,7 +878,6 @@ vhost_user_socket_mem_free(struct vhost_user_socket *vsocket) return; free(vsocket->path); - free(vsocket->malloc_notify_ops); free(vsocket); } @@ -1146,69 +1143,21 @@ rte_vhost_driver_unregister(const char *path) /* * Register ops so that we can add/remove device to data core. */ -static int -vhost_driver_callback_register(const char *path, - struct rte_vhost_device_ops const * const ops, - struct rte_vhost_device_ops *malloc_ops) +int +rte_vhost_driver_callback_register(const char *path, + struct rte_vhost_device_ops const * const ops) { struct vhost_user_socket *vsocket; pthread_mutex_lock(&vhost_user.mutex); vsocket = find_vhost_user_socket(path); - if (vsocket) { + if (vsocket) vsocket->notify_ops = ops; - free(vsocket->malloc_notify_ops); - vsocket->malloc_notify_ops = malloc_ops; - } pthread_mutex_unlock(&vhost_user.mutex); return vsocket ? 0 : -1; } -int __vsym -rte_vhost_driver_callback_register_v24(const char *path, - struct rte_vhost_device_ops const * const ops) -{ - return vhost_driver_callback_register(path, ops, NULL); -} - -int __vsym -rte_vhost_driver_callback_register_v23(const char *path, - struct rte_vhost_device_ops const * const ops) -{ - int ret; - - /* - * Although the ops structure is a const structure, we do need to - * override the guest_notify operation. This is because with the - * previous APIs it was "reserved" and if any garbage value was passed, - * it could crash the application. - */ - if (ops && !ops->guest_notify) { - struct rte_vhost_device_ops *new_ops; - - new_ops = malloc(sizeof(*new_ops)); - if (new_ops == NULL) - return -1; - - memcpy(new_ops, ops, sizeof(*new_ops)); - new_ops->guest_notify = NULL; - - ret = vhost_driver_callback_register(path, new_ops, new_ops); - } else { - ret = vhost_driver_callback_register(path, ops, NULL); - } - - return ret; -} - -/* Mark the v23 function as the old version, and v24 as the default version. */ -VERSION_SYMBOL(rte_vhost_driver_callback_register, _v23, 23); -BIND_DEFAULT_SYMBOL(rte_vhost_driver_callback_register, _v24, 24); -MAP_STATIC_SYMBOL(int rte_vhost_driver_callback_register(const char *path, - struct rte_vhost_device_ops const * const ops), - rte_vhost_driver_callback_register_v24); - struct rte_vhost_device_ops const * vhost_driver_callback_get(const char *path) { diff --git a/lib/vhost/version.map b/lib/vhost/version.map index f5d9d68e2c..5bc133dafd 100644 --- a/lib/vhost/version.map +++ b/lib/vhost/version.map @@ -1,4 +1,4 @@ -DPDK_23 { +DPDK_24 { global: rte_vdpa_find_device_by_name; @@ -64,12 +64,6 @@ DPDK_23 { local: *; }; -DPDK_24 { - global: - - rte_vhost_driver_callback_register; -} DPDK_23; - EXPERIMENTAL { global: diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h index f49ce943b0..9723429b1c 100644 --- a/lib/vhost/vhost.h +++ b/lib/vhost/vhost.h @@ -1046,10 +1046,4 @@ mbuf_is_consumed(struct rte_mbuf *m) void mem_set_dump(void *ptr, size_t size, bool enable, uint64_t alignment); -/* Versioned functions */ -int rte_vhost_driver_callback_register_v23(const char *path, - struct rte_vhost_device_ops const * const ops); -int rte_vhost_driver_callback_register_v24(const char *path, - struct rte_vhost_device_ops const * const ops); - #endif /* _VHOST_NET_CDEV_H_ */ -- 2.41.0

