[dpdk-dev] [PATCH v2] vhost: fix vhost user virtqueue not accessible

Tiwei Bie tiwei.bie at intel.com
Wed Oct 30 07:58:45 CET 2019


On Wed, Oct 30, 2019 at 07:07:23PM +0800, Marvin Liu wrote:
> Log feature is disabled in vhost user, so that log address was invalid
> when checking. Check whether log address is valid can workaround it.
> Also log address should be translated in packed ring virtqueue.
> 
> Fixes: 04cfc7fdbfca ("vhost: translate incoming log address to gpa")
> 
> Signed-off-by: Marvin Liu <yong.liu at intel.com>
> ---
>  lib/librte_vhost/vhost_user.c | 30 +++++++++++++-----------------
>  1 file changed, 13 insertions(+), 17 deletions(-)
> 
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 61ef699ac..759cc795c 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -641,11 +641,23 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)
>  	struct vhost_vring_addr *addr = &vq->ring_addrs;
>  	uint64_t len, expected_len;
>  
> +	dev = numa_realloc(dev, vq_index);
> +	vq = dev->virtqueue[vq_index];
> +	if (addr->log_guest_addr) {

Please use VHOST_VRING_F_LOG to check whether log address
is valid or not.

Thanks,
Tiwei


More information about the dev mailing list