From: Steve Shin Date: Fri, 19 Aug 2016 00:34:52 +0000 (-0700) Subject: vhost-user: unmap previously configured memory if necessary X-Git-Tag: v17.01-rc0~305 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=5e15c91b6c2b5fbd7f989c5dc4edde506d254926;p=vpp.git 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 --- diff --git a/vnet/vnet/devices/dpdk/vhost_user.c b/vnet/vnet/devices/dpdk/vhost_user.c index c153e2ede78..11a81c2d7cb 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;