[dpdk-dev] [PATCH] vhost: fix return avail ring position in get vring base
Tan, Jianfeng
jianfeng.tan at intel.com
Sun Feb 11 05:09:44 CET 2018
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Tomasz Kulasek
> Sent: Saturday, February 10, 2018 1:28 AM
> To: yliu at fridaylinux.org
> Cc: dev at dpdk.org; Xie, Huawei; stable at dpdk.org; Wodkowski, PawelX
> Subject: [dpdk-dev] [PATCH] vhost: fix return avail ring position in get vring
> base
>
> According to the "Vhost-user Protocol" document,
> VHOST_USER_GET_VRING_BASE should get the available vring base offset.
>
> Fixes: 8f972312b8f4 ("vhost: support vhost-user")
> Cc: huawei.xie at intel.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Pawel Wodkowski <pawelx.wodkowski at intel.com>
> Signed-off-by: Tomasz Kulasek <tomaszx.kulasek at intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan at intel.com>
Nice catch!
> ---
> lib/librte_vhost/vhost_user.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 65ee33919..04eee3a3a 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -881,8 +881,8 @@ vhost_user_get_vring_base(struct virtio_net *dev,
>
> dev->flags &= ~VIRTIO_DEV_READY;
>
> - /* Here we are safe to get the last used index */
> - msg->payload.state.num = vq->last_used_idx;
> + /* Here we are safe to get the last avail index */
> + msg->payload.state.num = vq->last_avail_idx;
>
> RTE_LOG(INFO, VHOST_CONFIG,
> "vring base idx:%d file:%d\n", msg->payload.state.index,
> --
> 2.14.1
More information about the dev
mailing list