Commit 1ba7396e authored by Pravin M Bathija's avatar Pravin M Bathija Committed by Tomasz Zawadzki
Browse files

vhost_user: add & remove memory regions



modify function extern_vhost_post_msg_handler to include
support for add memory region.
add enums in header file to:
add & remove memory regions.
get memory slots/regions.

Change-Id: Ie1216fd2d880805d727826485d61231a09445ffa
Signed-off-by: default avatarPravin M Bathija <pravin.bathija@dell.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26344


Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarBoris Glimcher <Boris.Glimcher@emc.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Reviewed-by: default avatarChangpeng Liu <changpeliu@tencent.com>
Community-CI: Mellanox Build Bot
parent af5a744d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -69,6 +69,9 @@ enum vhost_user_request {
	VHOST_USER_POSTCOPY_ADVISE = 28,
	VHOST_USER_POSTCOPY_LISTEN = 29,
	VHOST_USER_POSTCOPY_END = 30,
	VHOST_USER_GET_MAX_MEM_SLOTS = 36,
	VHOST_USER_ADD_MEM_REG = 37,
	VHOST_USER_REM_MEM_REG = 38,
	VHOST_USER_MAX
};

+1 −0
Original line number Diff line number Diff line
@@ -1561,6 +1561,7 @@ extern_vhost_post_msg_handler(int vid, void *_msg)
		pthread_mutex_unlock(&user_dev->lock);
		break;
	case VHOST_USER_SET_MEM_TABLE:
	case VHOST_USER_ADD_MEM_REG:
		vhost_register_memtable_if_required(vsession, vid);
		pthread_mutex_lock(&user_dev->lock);
		if (vsession->needs_restart) {