Commit 2725b519 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

virtio/user: don't send SET_VRING_ADDR after updating the memory table



Our internal rte_vhost lib requires SET_VRING_ADDR to
flush a pending SET_MEM_TABLE. On the other hand, the
upstream rte_vhost will invalidate the entire queue
upon receiving SET_VRING_ADDR message, so we mustn't
send it at runtime. Both behaviors are strictly
implementation specific, but this message isn't needed
by the spec, so send it only if vhost was compiled
with our internal lib.

Change-Id: I200b99a1dd5124bdebd104e69ae1b012a974ab6f
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446087


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 89c1dc77
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -165,13 +165,19 @@ virtio_user_map_notify(void *cb_ctx, struct spdk_mem_map *map,
		return ret;
	}

	/* We have to send SET_VRING_ADDR to make rte_vhost flush a pending
	 * SET_MEM_TABLE...
#ifdef SPDK_CONFIG_VHOST_INTERNAL_LIB
	/* Our internal rte_vhost lib requires SET_VRING_ADDR to flush a pending
	 * SET_MEM_TABLE. On the other hand, the upstream rte_vhost will invalidate
	 * the entire queue upon receiving SET_VRING_ADDR message, so we mustn't
	 * send it here. Both behaviors are strictly implementation specific, but
	 * this message isn't needed from the point of the spec, so send it only
	 * if vhost is compiled with our internal lib.
	 */
	ret = virtio_user_queue_setup(vdev, virtio_user_set_vring_addr);
	if (ret < 0) {
		return ret;
	}
#endif

	/* Since we might want to use that mapping straight away, we have to
	 * make sure the guest has already processed our SET_MEM_TABLE message.