From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0EB19A04F8; Wed, 25 Dec 2019 07:40:02 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 073DB1BE90; Wed, 25 Dec 2019 07:40:00 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id E73BA3977; Wed, 25 Dec 2019 07:39:57 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Dec 2019 22:39:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,353,1571727600"; d="scan'208";a="212052253" Received: from storage36.sh.intel.com ([10.67.110.177]) by orsmga008.jf.intel.com with ESMTP; 24 Dec 2019 22:39:55 -0800 From: Jin Yu To: Maxime Coquelin , Tiwei Bie , Zhihong Wang Cc: dev@dpdk.org, changpeng.liu@intel.com, Jin Yu , stable@dpdk.org Date: Wed, 25 Dec 2019 22:18:35 +0800 Message-Id: <20191225141835.65587-1-jin.yu@intel.com> X-Mailer: git-send-email 2.17.2 Subject: [dpdk-dev] [PATCH] vhost: fix the inflight resubmit check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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 0cfb8b792..eb0f27c29 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -1629,8 +1629,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; @@ -1710,8 +1713,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.17.2