Skip to content

Commit 0ae35ec

Browse files
vhost: remove v23 ABI compatibility
v23.11 is a ABI breaking release, remove compatibility code for the previous major ABI version. Signed-off-by: David Marchand <[email protected]>
1 parent 51cbeed commit 0ae35ec

File tree

4 files changed

+5
-70
lines changed

4 files changed

+5
-70
lines changed

lib/vhost/meson.build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,3 @@ driver_sdk_headers = files(
4343
'vdpa_driver.h',
4444
)
4545
deps += ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
46-
47-
use_function_versioning = true

lib/vhost/socket.c

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <fcntl.h>
1616
#include <pthread.h>
1717

18-
#include <rte_function_versioning.h>
1918
#include <rte_log.h>
2019

2120
#include "fd_man.h"
@@ -64,7 +63,6 @@ struct vhost_user_socket {
6463
struct rte_vdpa_device *vdpa_dev;
6564

6665
struct rte_vhost_device_ops const *notify_ops;
67-
struct rte_vhost_device_ops *malloc_notify_ops;
6866
};
6967

7068
struct vhost_user_connection {
@@ -880,7 +878,6 @@ vhost_user_socket_mem_free(struct vhost_user_socket *vsocket)
880878
return;
881879

882880
free(vsocket->path);
883-
free(vsocket->malloc_notify_ops);
884881
free(vsocket);
885882
}
886883

@@ -1146,69 +1143,21 @@ rte_vhost_driver_unregister(const char *path)
11461143
/*
11471144
* Register ops so that we can add/remove device to data core.
11481145
*/
1149-
static int
1150-
vhost_driver_callback_register(const char *path,
1151-
struct rte_vhost_device_ops const * const ops,
1152-
struct rte_vhost_device_ops *malloc_ops)
1146+
int
1147+
rte_vhost_driver_callback_register(const char *path,
1148+
struct rte_vhost_device_ops const * const ops)
11531149
{
11541150
struct vhost_user_socket *vsocket;
11551151

11561152
pthread_mutex_lock(&vhost_user.mutex);
11571153
vsocket = find_vhost_user_socket(path);
1158-
if (vsocket) {
1154+
if (vsocket)
11591155
vsocket->notify_ops = ops;
1160-
free(vsocket->malloc_notify_ops);
1161-
vsocket->malloc_notify_ops = malloc_ops;
1162-
}
11631156
pthread_mutex_unlock(&vhost_user.mutex);
11641157

11651158
return vsocket ? 0 : -1;
11661159
}
11671160

1168-
int __vsym
1169-
rte_vhost_driver_callback_register_v24(const char *path,
1170-
struct rte_vhost_device_ops const * const ops)
1171-
{
1172-
return vhost_driver_callback_register(path, ops, NULL);
1173-
}
1174-
1175-
int __vsym
1176-
rte_vhost_driver_callback_register_v23(const char *path,
1177-
struct rte_vhost_device_ops const * const ops)
1178-
{
1179-
int ret;
1180-
1181-
/*
1182-
* Although the ops structure is a const structure, we do need to
1183-
* override the guest_notify operation. This is because with the
1184-
* previous APIs it was "reserved" and if any garbage value was passed,
1185-
* it could crash the application.
1186-
*/
1187-
if (ops && !ops->guest_notify) {
1188-
struct rte_vhost_device_ops *new_ops;
1189-
1190-
new_ops = malloc(sizeof(*new_ops));
1191-
if (new_ops == NULL)
1192-
return -1;
1193-
1194-
memcpy(new_ops, ops, sizeof(*new_ops));
1195-
new_ops->guest_notify = NULL;
1196-
1197-
ret = vhost_driver_callback_register(path, new_ops, new_ops);
1198-
} else {
1199-
ret = vhost_driver_callback_register(path, ops, NULL);
1200-
}
1201-
1202-
return ret;
1203-
}
1204-
1205-
/* Mark the v23 function as the old version, and v24 as the default version. */
1206-
VERSION_SYMBOL(rte_vhost_driver_callback_register, _v23, 23);
1207-
BIND_DEFAULT_SYMBOL(rte_vhost_driver_callback_register, _v24, 24);
1208-
MAP_STATIC_SYMBOL(int rte_vhost_driver_callback_register(const char *path,
1209-
struct rte_vhost_device_ops const * const ops),
1210-
rte_vhost_driver_callback_register_v24);
1211-
12121161
struct rte_vhost_device_ops const *
12131162
vhost_driver_callback_get(const char *path)
12141163
{

lib/vhost/version.map

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
DPDK_23 {
1+
DPDK_24 {
22
global:
33

44
rte_vdpa_find_device_by_name;
@@ -64,12 +64,6 @@ DPDK_23 {
6464
local: *;
6565
};
6666

67-
DPDK_24 {
68-
global:
69-
70-
rte_vhost_driver_callback_register;
71-
} DPDK_23;
72-
7367
EXPERIMENTAL {
7468
global:
7569

lib/vhost/vhost.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,10 +1046,4 @@ mbuf_is_consumed(struct rte_mbuf *m)
10461046

10471047
void mem_set_dump(void *ptr, size_t size, bool enable, uint64_t alignment);
10481048

1049-
/* Versioned functions */
1050-
int rte_vhost_driver_callback_register_v23(const char *path,
1051-
struct rte_vhost_device_ops const * const ops);
1052-
int rte_vhost_driver_callback_register_v24(const char *path,
1053-
struct rte_vhost_device_ops const * const ops);
1054-
10551049
#endif /* _VHOST_NET_CDEV_H_ */

0 commit comments

Comments
 (0)