Commit 765cf74d authored by GangCao's avatar GangCao Committed by Jim Harris
Browse files

lib/nvme: only active process to operate the unmap operation



Fix issue: #2320

Only the primary process will do the unmap bar operation as for
the map bar operation.

The DevHandle is process specific and the issue here is the
secondary process's function pointer of DevHandle is not properly
set.

Change-Id: I95dddc76c6ce4be8775b6aaf54699002baffd3b9
Signed-off-by: default avatarGangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11216


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent e0e544bc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -830,7 +830,7 @@ nvme_pcie_ctrlr_free_bars(struct nvme_pcie_ctrlr *pctrlr)
		return -1;
	}

	if (addr) {
	if (addr && spdk_process_is_primary()) {
		/* NOTE: addr may have been remapped here. We're relying on DPDK to call
		 * munmap internally.
		 */
+11 −1
Original line number Diff line number Diff line
@@ -42,13 +42,23 @@ function nvme_fio_test() {
}

function nvme_multi_secondary() {
	$SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x1 &
	# Primary process exits last
	$SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 5 -c 0x1 &
	pid0=$!
	$SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x2 &
	pid1=$!
	$SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x4
	wait $pid0
	wait $pid1

	# Secondary process exits last
	$SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x1 &
	pid0=$!
	$SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x2 &
	pid1=$!
	$SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 5 -c 0x4
	wait $pid0
	wait $pid1
}

if [ $(uname) = Linux ]; then