From patchwork Mon Jul 31 09:43:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 129736 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B67B142FA2; Mon, 31 Jul 2023 11:44:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C89DD43257; Mon, 31 Jul 2023 11:44:25 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 3F3DE43256 for ; Mon, 31 Jul 2023 11:44:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690796664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zIC0F5venvNdPkPdpguQIm/VRNsB8aRDwbMavkLIlmw=; b=Ndem+qMMwJkAL5MXPKuHfla07Cby86Htih4BSBBZNBfv7MlwMRSVI4E7zmZXBcTv7BqENt sSaElRrx9dHBJ7K9JyV/THm+b0TmkIJlE73ummW+QvJtlcFzOARYeUJ7rAIDuoyZWvlidK SSETKVwlSuHw45+npUJbqng+YzHyGT0= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-111-bmPfxHZYOVqSxF3jDzi-Ig-1; Mon, 31 Jul 2023 05:44:18 -0400 X-MC-Unique: bmPfxHZYOVqSxF3jDzi-Ig-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9C76738149A1; Mon, 31 Jul 2023 09:44:18 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEA502017DC6; Mon, 31 Jul 2023 09:44:17 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, Maxime Coquelin , Chenbo Xia Subject: [PATCH 3/3] vhost: remove v23 ABI compatibility Date: Mon, 31 Jul 2023 11:43:55 +0200 Message-ID: <20230731094356.1220807-4-david.marchand@redhat.com> In-Reply-To: <20230731094356.1220807-1-david.marchand@redhat.com> References: <20230731094356.1220807-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org v23.11 is a ABI breaking release, remove compatibility code for the previous major ABI version. Signed-off-by: David Marchand --- 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 #include -#include #include #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_ */