[dpdk-stable] patch 'vhost: fix error handling when mem table gets updated' has been queued to stable release 18.08.1

Kevin Traynor ktraynor at redhat.com
Thu Nov 22 17:49:05 CET 2018


Hi,

FYI, your patch has been queued to stable release 18.08.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 11/28/18. 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. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Kevin Traynor

---
>From 2518ba1105975eddfebdc6ea8114bc60e9f5c7fd Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Fri, 12 Oct 2018 14:40:33 +0200
Subject: [PATCH] vhost: fix error handling when mem table gets updated

[ upstream commit 74ee315e4f1bcbcabae054d310b730be13e49ad4 ]

When the memory table gets updated, the rings addresses need
to be translated again. If it fails, we need to exit cleanly
by unmapping memory regions.

Fixes: d5022533c20a ("vhost: retranslate vring addr when memory table changes")

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Acked-by: Ilya Maximets <i.maximets at samsung.com>
---
 lib/librte_vhost/vhost_user.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 63d145b2d..d19d78ce5 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -937,6 +937,8 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *pmsg)
 
 			dev = translate_ring_addresses(dev, i);
-			if (!dev)
-				return -1;
+			if (!dev) {
+				dev = *pdev;
+				goto err_mmap;
+			}
 
 			*pdev = dev;
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-22 16:47:32.611022398 +0000
+++ 0013-vhost-fix-error-handling-when-mem-table-gets-updated.patch	2018-11-22 16:47:32.000000000 +0000
@@ -1,14 +1,15 @@
-From 74ee315e4f1bcbcabae054d310b730be13e49ad4 Mon Sep 17 00:00:00 2001
+From 2518ba1105975eddfebdc6ea8114bc60e9f5c7fd Mon Sep 17 00:00:00 2001
 From: Maxime Coquelin <maxime.coquelin at redhat.com>
 Date: Fri, 12 Oct 2018 14:40:33 +0200
 Subject: [PATCH] vhost: fix error handling when mem table gets updated
 
+[ upstream commit 74ee315e4f1bcbcabae054d310b730be13e49ad4 ]
+
 When the memory table gets updated, the rings addresses need
 to be translated again. If it fails, we need to exit cleanly
 by unmapping memory regions.
 
 Fixes: d5022533c20a ("vhost: retranslate vring addr when memory table changes")
-Cc: stable at dpdk.org
 
 Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
 Acked-by: Ilya Maximets <i.maximets at samsung.com>
@@ -17,14 +18,14 @@
  1 file changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
-index 1ef02c943..83d3e6321 100644
+index 63d145b2d..d19d78ce5 100644
 --- a/lib/librte_vhost/vhost_user.c
 +++ b/lib/librte_vhost/vhost_user.c
-@@ -954,6 +954,8 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg)
+@@ -937,6 +937,8 @@ vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *pmsg)
  
  			dev = translate_ring_addresses(dev, i);
 -			if (!dev)
--				return VH_RESULT_ERR;
+-				return -1;
 +			if (!dev) {
 +				dev = *pdev;
 +				goto err_mmap;


More information about the stable mailing list