Commit 2a463e3e authored by Konrad Sztyber's avatar Konrad Sztyber
Browse files

test/json_config: detach virtio controllers before shutdown



If the controllers are left attached when the application is terminated,
the virtio library might receive notifications about memory being
unregistered from the mem_map.  The apps in json_config test are
preallocating 1GB of memory, which should stop DPDK from releasing the
hugepages back to the system, but if they allocate more, that extra
pages can be released, which would generate the mem_map notifications .

This actually happened in #2951 - spdk_tgt was built with ocf support,
which preallocates an extra ~300MB mempools, exceeding 1GB, which caused
mem_map notifications to be sent when iscsi mempools were destroyed
triggering an assertion in virtio.

Another option to fix this would be to increase the size of the
preallocated memory, but detaching the controllers achieves the same
thing without requiring more resources.

Fixes #2951.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I743af39acfee68caba55ec4fccd593a696ab688b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17265


Reviewed-by: default avatarKarol Latecki <karol.latecki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent e6f5dbb0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -362,6 +362,10 @@ function json_config_test_fini() {
	local ret=0

	if [[ -n "${app_pid[initiator]}" ]]; then
		if [[ $SPDK_TEST_VHOST_INIT -eq 1 ]]; then
			initiator_rpc bdev_virtio_detach_controller VirtioScsiCtrlr0 || :
			initiator_rpc bdev_virtio_detach_controller VirtioBlk0 || :
		fi
		killprocess ${app_pid[initiator]}
	fi