From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id D1A621B799 for ; Wed, 7 Feb 2018 09:59:43 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 8298220CB0; Wed, 7 Feb 2018 03:59:43 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 07 Feb 2018 03:59:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=JjigimHphMAUlGF/X IMwiq0TJ/D/f4fRaPUZh4OrFPs=; b=MZxsnyUePJaFEgMtOkQWFy1gtf83AUc9u 9Akyj6XOav0aH7gi0bZoq0u7uT8Ttf2YYt8W86tZJo72vvAdUATZYGkvvB/+/Ykj RnlPT5POoyiPPcO0yy/Zh3pEXdU3xjkReVKnaOJjJMHsX4rzWvqAGlHmY2ICsoY+ VUy9knwCuwPN8HFVAGtIGJbWQ6xXSYsE8N/Aye+c22TCOu6Lqwuepm8aAXUzDn7f GnaNCu5ICJYRNvuOb2I6bYWq8a0FgQkgBgByDXsBq6Fvs8wfocYfUadN/fAe2KQ1 5MMq6WqR5qxsYRqsl4NWZzEWGetyTgAursF7Q5Lg2/D5cAXxupSaw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=JjigimHphMAUlGF/XIMwiq0TJ/D/f4fRaPUZh4OrFPs=; b=UcjiEN6W /3pOqk/lepVTpPKnWwDyIhzbf56yMJNWvfLjkQbF5sasBjwUipR1nMoPU3rYcCxr 1wcQ7weSoHYUskxOt8YW+QW7yeWlkyRe5yXD7HiS2E4Us0x4Oi3KnPyhvjUY+KX5 T0uzmobOELvSEJ051jnU+rJLVCspwvAe7w6QQMtDCetlo8gwbupmvxFV7Wqadmpa lH6KGOJe91cuctvjCZ4MykvW4hEOp5fail/KlC7rqFGhExWWdmcvI8ZCexE/yE8o xJLYBhrpd5zFyqBDqzxYgJW4JWFqdvSyGrUdy77RU6vtVpUvhTpJLrrN62F2DPke ZULC5AK1uWuR3Q== X-ME-Sender: Received: from localhost.localdomain (unknown [182.84.161.100]) by mail.messagingengine.com (Postfix) with ESMTPA id 57550240DE; Wed, 7 Feb 2018 03:59:41 -0500 (EST) From: Yuanhan Liu To: Maxime Coquelin Cc: Tiwei Bie , dpdk stable Date: Wed, 7 Feb 2018 16:57:03 +0800 Message-Id: <1517993838-26692-9-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517993838-26692-1-git-send-email-yliu@fridaylinux.org> References: <1517993838-26692-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'vhost: remove pending IOTLB entry if miss request failed' has been queued to LTS release 17.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Feb 2018 08:59:44 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/09/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 55811badd15743cb2f12fe248bec64ae4b401753 Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Mon, 5 Feb 2018 16:04:57 +0100 Subject: [PATCH] vhost: remove pending IOTLB entry if miss request failed [ upstream commit 82b9c1540348b6be7996203065e10421e953cea9 ] In case vhost_user_iotlb_miss returns an error, the pending IOTLB entry has to be removed from the list as no IOTLB update will be received. Fixes: fed67a20ac94 ("vhost: introduce guest IOVA to backend VA helper") Suggested-by: Tiwei Bie Signed-off-by: Maxime Coquelin --- lib/librte_vhost/iotlb.c | 2 +- lib/librte_vhost/iotlb.h | 3 +++ lib/librte_vhost/vhost.c | 13 ++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/librte_vhost/iotlb.c b/lib/librte_vhost/iotlb.c index 72cd27d..c11ebca 100644 --- a/lib/librte_vhost/iotlb.c +++ b/lib/librte_vhost/iotlb.c @@ -120,7 +120,7 @@ vhost_user_iotlb_pending_insert(struct vhost_virtqueue *vq, rte_rwlock_write_unlock(&vq->iotlb_pending_lock); } -static void +void vhost_user_iotlb_pending_remove(struct vhost_virtqueue *vq, uint64_t iova, uint64_t size, uint8_t perm) { diff --git a/lib/librte_vhost/iotlb.h b/lib/librte_vhost/iotlb.h index f1a050e..e7083e3 100644 --- a/lib/librte_vhost/iotlb.h +++ b/lib/librte_vhost/iotlb.h @@ -71,6 +71,9 @@ bool vhost_user_iotlb_pending_miss(struct vhost_virtqueue *vq, uint64_t iova, uint8_t perm); void vhost_user_iotlb_pending_insert(struct vhost_virtqueue *vq, uint64_t iova, uint8_t perm); +void vhost_user_iotlb_pending_remove(struct vhost_virtqueue *vq, uint64_t iova, + uint64_t size, uint8_t perm); + int vhost_user_iotlb_init(struct virtio_net *dev, int vq_index); #endif /* _VHOST_IOTLB_H_ */ diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c index dcc42fc..51ea720 100644 --- a/lib/librte_vhost/vhost.c +++ b/lib/librte_vhost/vhost.c @@ -71,7 +71,9 @@ __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq, if (tmp_size == size) return vva; - if (!vhost_user_iotlb_pending_miss(vq, iova + tmp_size, perm)) { + iova += tmp_size; + + if (!vhost_user_iotlb_pending_miss(vq, iova, perm)) { /* * iotlb_lock is read-locked for a full burst, * but it only protects the iotlb cache. @@ -81,8 +83,13 @@ __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq, */ vhost_user_iotlb_rd_unlock(vq); - vhost_user_iotlb_pending_insert(vq, iova + tmp_size, perm); - vhost_user_iotlb_miss(dev, iova + tmp_size, perm); + vhost_user_iotlb_pending_insert(vq, iova, perm); + if (vhost_user_iotlb_miss(dev, iova, perm)) { + RTE_LOG(ERR, VHOST_CONFIG, + "IOTLB miss req failed for IOVA 0x%" PRIx64 "\n", + iova); + vhost_user_iotlb_pending_remove(vq, iova, 1, perm); + } vhost_user_iotlb_rd_lock(vq); } -- 2.7.4