aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Shin <jonshin@cisco.com>2016-08-18 17:34:52 -0700
committerJohn Lo <loj@cisco.com>2016-08-30 03:07:00 +0000
commiteb5cad76ea8e33352d8af22dbe68f7489af084c7 (patch)
tree4722211cc144adde3f85f2872aea388bda9e61c6
parentd7935e8c422e8e464e2a3062dbc7a9b9d34c4723 (diff)
vhost-user: unmap previously configured memory if necessary
If there's any memory-mapped region configued previously, it should be unmapped before setting up a new vhost memory table. Otherwise, huge page leakage will happen. Change-Id: I375f603ea303919f1502df44a26a7384ab2ea00e Signed-off-by: Steve Shin <jonshin@cisco.com> (cherry picked from commit 5e15c91b6c2b5fbd7f989c5dc4edde506d254926)
-rw-r--r--vnet/vnet/devices/dpdk/vhost_user.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vnet/vnet/devices/dpdk/vhost_user.c b/vnet/vnet/devices/dpdk/vhost_user.c
index 03f84921551..58cff7b940f 100644
--- a/vnet/vnet/devices/dpdk/vhost_user.c
+++ b/vnet/vnet/devices/dpdk/vhost_user.c
@@ -1130,6 +1130,9 @@ dpdk_vhost_user_socket_read (unix_file_t * uf)
goto close_socket;
}
+ /* Unmap previously configured memory if necessary */
+ dpdk_unmap_all_mem_regions (xd);
+
dpdk_vhost_user_set_mem_table (xd->vlib_hw_if_index, &msg.memory, fds);
break;