From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 5047C1B462 for ; Thu, 31 Jan 2019 16:50:26 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D56C90C9C; Thu, 31 Jan 2019 15:50:25 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-200.ams2.redhat.com [10.36.117.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 127B85C23F; Thu, 31 Jan 2019 15:50:23 +0000 (UTC) From: Kevin Traynor To: Tiwei Bie Cc: Maxime Coquelin , dpdk stable Date: Thu, 31 Jan 2019 15:48:35 +0000 Message-Id: <20190131154901.5383-27-ktraynor@redhat.com> In-Reply-To: <20190131154901.5383-1-ktraynor@redhat.com> References: <20190131154901.5383-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 31 Jan 2019 15:50:25 +0000 (UTC) Subject: [dpdk-stable] patch 'vhost: ensure event idx is mapped when negotiated' has been queued to LTS release 18.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: Thu, 31 Jan 2019 15:50:26 -0000 Hi, FYI, your patch has been queued to LTS release 18.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/07/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Kevin Traynor --- >>From 278a62cd2f3378857a57f6198334677b5ce2cc53 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Fri, 4 Jan 2019 12:06:42 +0800 Subject: [PATCH] vhost: ensure event idx is mapped when negotiated [ upstream commit 61ec8f58b040b2822cb5c33bb79e9e17b83fd45f ] Fixes: 30920b1e2b15 ("vhost: ensure all range is mapped when translating QVAs") Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost_user.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 557213491..401c4aa7b 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -542,5 +542,5 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index) struct vhost_virtqueue *vq = dev->virtqueue[vq_index]; struct vhost_vring_addr *addr = &vq->ring_addrs; - uint64_t len; + uint64_t len, expected_len; if (vq_is_packed(dev)) { @@ -608,9 +608,10 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index) len = sizeof(struct vring_avail) + sizeof(uint16_t) * vq->size; + if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) + len += sizeof(uint16_t); + expected_len = len; vq->avail = (struct vring_avail *)(uintptr_t)ring_addr_to_vva(dev, vq, addr->avail_user_addr, &len); - if (vq->avail == 0 || - len != sizeof(struct vring_avail) + - sizeof(uint16_t) * vq->size) { + if (vq->avail == 0 || len != expected_len) { RTE_LOG(DEBUG, VHOST_CONFIG, "(%d) failed to map avail ring.\n", @@ -621,8 +622,10 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index) len = sizeof(struct vring_used) + sizeof(struct vring_used_elem) * vq->size; + if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) + len += sizeof(uint16_t); + expected_len = len; vq->used = (struct vring_used *)(uintptr_t)ring_addr_to_vva(dev, vq, addr->used_user_addr, &len); - if (vq->used == 0 || len != sizeof(struct vring_used) + - sizeof(struct vring_used_elem) * vq->size) { + if (vq->used == 0 || len != expected_len) { RTE_LOG(DEBUG, VHOST_CONFIG, "(%d) failed to map used ring.\n", -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-01-31 15:44:06.375756464 +0000 +++ 0027-vhost-ensure-event-idx-is-mapped-when-negotiated.patch 2019-01-31 15:44:05.000000000 +0000 @@ -1,10 +1,11 @@ -From 61ec8f58b040b2822cb5c33bb79e9e17b83fd45f Mon Sep 17 00:00:00 2001 +From 278a62cd2f3378857a57f6198334677b5ce2cc53 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Fri, 4 Jan 2019 12:06:42 +0800 Subject: [PATCH] vhost: ensure event idx is mapped when negotiated +[ upstream commit 61ec8f58b040b2822cb5c33bb79e9e17b83fd45f ] + Fixes: 30920b1e2b15 ("vhost: ensure all range is mapped when translating QVAs") -Cc: stable@dpdk.org Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin @@ -13,7 +14,7 @@ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c -index 8fec773d5..1843e032f 100644 +index 557213491..401c4aa7b 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -542,5 +542,5 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)