DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Maxime Coquelin <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbo.xia@intel.com>
Subject: [PATCH 3/3] vhost: remove v23 ABI compatibility
Date: Mon, 31 Jul 2023 11:43:55 +0200	[thread overview]
Message-ID: <20230731094356.1220807-4-david.marchand@redhat.com> (raw)
In-Reply-To: <20230731094356.1220807-1-david.marchand@redhat.com>

v23.11 is a ABI breaking release, remove compatibility code for the
previous major ABI version.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 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


  parent reply	other threads:[~2023-07-31  9:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31  9:43 [PATCH 0/3] version: 23.11-rc0 David Marchand
2023-07-31  9:43 ` [PATCH 1/3] " David Marchand
2023-07-31 10:00   ` Bruce Richardson
2023-07-31 19:03   ` Aaron Conole
2023-07-31  9:43 ` [PATCH 2/3] telemetry: remove v23 ABI compatibility David Marchand
2023-07-31 10:01   ` Bruce Richardson
2023-07-31  9:43 ` David Marchand [this message]
2023-07-31 10:02 ` [PATCH 0/3] version: 23.11-rc0 Bruce Richardson
2023-07-31 10:36   ` Thomas Monjalon
2023-07-31 14:01 ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230731094356.1220807-4-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).