From c47edd040a6a409de6bc86a31f44e86e5fa55b19 Mon Sep 17 00:00:00 2001 From: Jin Yu Date: Wed, 25 Dec 2019 22:18:35 +0800 Subject: [PATCH] vhost: fix inflight resubmit check The frontend may not send the get_inflight_fd and set_inflight_fd although we negotiate the protocol feature. When we meet this situation just return OK. Fixes: ad0a4ae491fe ("vhost: checkout resubmit inflight information") Cc: stable@dpdk.org Signed-off-by: Jin Yu Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost_user.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 91482ccd67..9a7b8b3088 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1645,8 +1645,11 @@ vhost_check_queue_inflights_split(struct virtio_net *dev, (1ULL << VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD))) return RTE_VHOST_MSG_RESULT_OK; + /* The frontend may still not support the inflight feature + * although we negotiate the protocol feature. + */ if ((!vq->inflight_split)) - return RTE_VHOST_MSG_RESULT_ERR; + return RTE_VHOST_MSG_RESULT_OK; if (!vq->inflight_split->version) { vq->inflight_split->version = INFLIGHT_VERSION; @@ -1726,8 +1729,11 @@ vhost_check_queue_inflights_packed(struct virtio_net *dev, (1ULL << VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD))) return RTE_VHOST_MSG_RESULT_OK; + /* The frontend may still not support the inflight feature + * although we negotiate the protocol feature. + */ if ((!vq->inflight_packed)) - return RTE_VHOST_MSG_RESULT_ERR; + return RTE_VHOST_MSG_RESULT_OK; if (!vq->inflight_packed->version) { vq->inflight_packed->version = INFLIGHT_VERSION; -- 2.20.1