From patchwork Thu Aug 22 19:38:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13774135 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F4B428EA for ; Thu, 22 Aug 2024 19:38:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724355522; cv=none; b=CE4SJFUJRXXEAP0qNOTN2OD5m1krRGJ5sSqed5d3RyiB0aj+/qvxslXzR5MZSh2aLIAPfKgFUR2sF17SMA4pF47PiyUaofBsd4uZSSk/Yl7ASEHP6k/gwNvF0A7Z7FNJzN1hL9tZdFnh5mGu1LZucH/W0kddJVAvte8hlHLXs1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724355522; c=relaxed/simple; bh=tyCKfu/4aJCufmoPcvrqRjgeK45lNgAoIhFwd7hYEng=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=YAoZO2EgSkj8qyl4i/XNpTLH7O1A0slSFEvX/qtcrW4o7pqAmF5BD9tE74t7zCDv65TpSQRPVxMCgMc0VDdIEK2M3dNaq7J+qmRP2SxrqeHETncqw6A0K58XZyTnjJXAXa7kUqrnybUeP63kF97FpwvtYzZnxP2FPH2SxdYRIsQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=SMNoJGdK; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="SMNoJGdK" Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5bed83488b3so1756715a12.0 for ; Thu, 22 Aug 2024 12:38:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1724355518; x=1724960318; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=T9cnv+MdXwy4zAHoFrkb8mhAg31ASXI3YdjEyMyWEjg=; b=SMNoJGdKrjslooSIcDcztDFKWUo5p1C8Mg6GEkdj4XtbuGsIy7Jrtrfyr8Lw6QBJua v7X+pJ8FBau+kAAbOJ+3mYyVhlqDtNdyaLJAf4EoY5wrCNOGfsz2iS8EkJfTIZImTQ1E C1h926U4bV1LgS4cSOAclJAZuR98vm0CYUHmYFv1KzJ7vVDTaQC/0rgB7lg03zrZXpCX HpVu93xYcs3y126zwPwZmks54VS5oIcMVikwfq1zGq0WOsV0H0gegjxQeWkyNQ+WvsvZ nN3gagfPCPjd2l/f3tzfR/JqrBRIFcPsDQ8B6KzeIdnRqZ4Jrsi4RCHkkjW3yGlem4mS Wz6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724355518; x=1724960318; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=T9cnv+MdXwy4zAHoFrkb8mhAg31ASXI3YdjEyMyWEjg=; b=BjBhg3uazke32pwTVM5xMIR5NTOMj/ORkLKRYuuEAtJ2xc6VekbAa3ilaXjwQ66I+6 p6AtCsRuimbKZcBSR6Qt4sv6CaLkMgzui5ZGSTkLtwk0xJoybYX4VIHea1sMvz+Kvy4r cJlhz/sI+sH+vp5QHR6/lXVZArI5pUIA+XXCJc+cB9x1VucLNMo6QGZJLj8qyK+EA0GN a1e2VfZEOus9ud9AqnHouLfJnqk0RwrnrF8clka3acwmjAq5HEi55/VPXVrhe3WA5/tY pviltxoFALS6vP2Bw0MOFxjCrOlmgRsTYEvny6n21EnvzkZRKGOsTFk8YmYsf+OD2pbl 75XQ== X-Forwarded-Encrypted: i=1; AJvYcCUClc9grPDBCsRN9VG+A+2cV6imOndZzKOg+w830Y5y0GWYAUQ0ZnEShop2MImXvxe5JM4BsRGhsBQMkw==@vger.kernel.org X-Gm-Message-State: AOJu0Yyi3hHZwKMucB1BzrfsEamd7FUXMmVWnpu6IrU1to+b2V8uLnby bj3V4SnQTQsdettybkkvyTNQXzMuT151AxgnvY8b46XCZ9uBJCWqP/zWvr+/F0E= X-Google-Smtp-Source: AGHT+IH9qlKGYHZCb4YNYmE00kgmI8xojuOxfpDY7bV3fdw2VD8FzFJOuPsUodin3Se8Inlu8aJP4Q== X-Received: by 2002:a17:907:7251:b0:a86:993a:93db with SMTP id a640c23a62f3a-a86993adc45mr136738766b.39.1724355518045; Thu, 22 Aug 2024 12:38:38 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a868f2202fdsm156968666b.13.2024.08.22.12.38.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2024 12:38:37 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Shin'ichiro Kawasaki Cc: Chaitanya Kulkarni , Hannes Reinecke , Daniel Wagner , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck Subject: [PATCH 1/3] blktests: nvme: skip passthru tests on multipath devices Date: Thu, 22 Aug 2024 21:38:12 +0200 Message-ID: <20240822193814.106111-1-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 NVMe multipath devices have no associated character device that can be used for NVMe passtrhu. Skip them. Signed-off-by: Martin Wilck --- tests/nvme/033 | 4 ++++ tests/nvme/034 | 4 ++++ tests/nvme/035 | 1 + tests/nvme/036 | 4 ++++ tests/nvme/037 | 4 ++++ tests/nvme/039 | 4 ++++ tests/nvme/rc | 8 ++++++++ 7 files changed, 29 insertions(+) diff --git a/tests/nvme/033 b/tests/nvme/033 index 7a69b94..dda0763 100755 --- a/tests/nvme/033 +++ b/tests/nvme/033 @@ -13,6 +13,10 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU } +device_requires() { + _require_test_dev_is_nvme_no_mpath +} + set_conditions() { _set_nvme_trtype "$@" } diff --git a/tests/nvme/034 b/tests/nvme/034 index 239757c..41f1542 100755 --- a/tests/nvme/034 +++ b/tests/nvme/034 @@ -14,6 +14,10 @@ requires() { _have_fio } +device_requires() { + _require_test_dev_is_nvme_no_mpath +} + set_conditions() { _set_nvme_trtype "$@" } diff --git a/tests/nvme/035 b/tests/nvme/035 index 8286178..4357efa 100755 --- a/tests/nvme/035 +++ b/tests/nvme/035 @@ -17,6 +17,7 @@ requires() { } device_requires() { + _require_test_dev_is_nvme_no_mpath _require_test_dev_size "${NVME_IMG_SIZE}" } diff --git a/tests/nvme/036 b/tests/nvme/036 index ef6c29d..3a28cb7 100755 --- a/tests/nvme/036 +++ b/tests/nvme/036 @@ -13,6 +13,10 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU } +device_requires() { + _require_test_dev_is_nvme_no_mpath +} + set_conditions() { _set_nvme_trtype "$@" } diff --git a/tests/nvme/037 b/tests/nvme/037 index ef7ac59..557d491 100755 --- a/tests/nvme/037 +++ b/tests/nvme/037 @@ -12,6 +12,10 @@ requires() { _have_kernel_option NVME_TARGET_PASSTHRU } +device_requires() { + _require_test_dev_is_nvme_no_mpath +} + set_conditions() { _set_nvme_trtype "$@" } diff --git a/tests/nvme/039 b/tests/nvme/039 index a0f135c..ff8c1eb 100755 --- a/tests/nvme/039 +++ b/tests/nvme/039 @@ -18,6 +18,10 @@ requires() { _have_kernel_option FAULT_INJECTION_DEBUG_FS } +device_requires() { + _require_test_dev_is_nvme_no_mpath +} + # Get the last dmesg lines as many as specified. Exclude the lines to indicate # suppression by rate limit. last_dmesg() diff --git a/tests/nvme/rc b/tests/nvme/rc index dedc412..b3b1149 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -130,6 +130,14 @@ _require_test_dev_is_nvme() { return 0 } +_require_test_dev_is_nvme_no_mpath() { + if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-subsystem/ ]]; then + SKIP_REASONS+=("$TEST_DEV is a NVMe multipath device") + return 1 + fi + return 0 +} + _require_nvme_test_img_size() { local require_sz_mb local nvme_img_size_mb From patchwork Thu Aug 22 19:38:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13774136 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B91B1474D3 for ; Thu, 22 Aug 2024 19:38:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724355524; cv=none; b=EqZUxI8UUfFClJlls7Aml4tyIHmIsrCblO800WHJXRYafUaVMWm7jEEH+a2MNFSM0al6T0LCASCMV7ggz7j31/i88EI6DcsmO1JnvElMKpRguimkxB5cxc3dJU6AfVxT9J7RZK0DECCwSNwrUVUK6Bo/PEfLDoaNjM8l1P93xrA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724355524; c=relaxed/simple; bh=3QgRViehynAhzu12q3fRCWz17v++8mYnVtz86i/+WK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fdLd1x8sErQBavFZBZy/DrGCOrznhly6zw47nDtsLFa/umFKXsAGHEmhvUkcpo0auyUOtK/DHh9548o7CnXyf3tjFTGaWh/XW4GlDVpy011DaQkBl77V44vwQ+lq7kzxqDByqmrU3ufvqTgEp5BimH5ToJskpeUXJrmX+gfiXkE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=C0ZoN5Fi; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="C0ZoN5Fi" Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-5bef4d9e7f8so1670380a12.2 for ; Thu, 22 Aug 2024 12:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1724355520; x=1724960320; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GrI6YvPwrcq19wxadBi4aL0IQgdlikB2v8gTv3oD1Yg=; b=C0ZoN5FidJ71cJM/9TiRBncJ4wm2Ox8rVfatmVfu5eJomwBlSayT+y/BqOw+Na0egy NzCQ+fKdgvzL03yy2slsxbSsWHI3HcjbkhihrIp984oMDNpAaQ8VqYC5UWYTbgpmDZsR ND0yD8d43WQaJzhqJE7sZWysC975FkuL1kBAFbHjOPMYjTnny7ERngmK+nehLMETfrj9 l3BFoZruDWZjoQa8UGGKFQyu0LYrf14iuEZulodCt2dpY0uFPQuy74d59QpReZvuAPJu 7LUBofksAQHsTtqngVVR7ISSFBfyvQL5RBIuROzf8QQNlcawCtcM90un/aB11yrjMDzt 2itQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724355520; x=1724960320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GrI6YvPwrcq19wxadBi4aL0IQgdlikB2v8gTv3oD1Yg=; b=C/wkfh/nJIftej36IN9hbB6H6jioXLfu6lzaDmXMDqCYOIk3NHADwJpIFA+anQRrhm TBJC620loqci4kOw5DCQrr+9dN/Cm8o263CzGN9uqaYm1FRN+w5y1uSz4wNRD5VrkDG1 LHFnZmCZzsRh/zGadVsryZrcqXQTxVl+Ecg23y3gvQ0f/KoA6xMbPWmR2Ol346Sy8J2s cPPb/vNJJiIr2Ug23/vEDgPOIH7sWEQln+DGzfL8eDbpQu5vyAtxzwPseM1u9ZXdma3+ 004D/EPlNf+PcZunYmLdRLhpz2Nkgq8bng5zZ1irNW9pn8cdVOXkjMq11bYSL3/+DrMr ivyw== X-Forwarded-Encrypted: i=1; AJvYcCU7GCJJZSPvYgHnQ9YMiC/209DkWy3N0DlzMix1vZtcHiifLvIS64VYjaAq9zFBosXPMNbGuQebO94Vag==@vger.kernel.org X-Gm-Message-State: AOJu0YxKzZKV2ozg21hn7md4reUs4opeVUoojje5okXrtkStiFtcB2TB nulG+pA0eOretTbthI1BE07bj63wym6aMhVP43odrTP/2DyX9nVqSPTWrhRhWYg= X-Google-Smtp-Source: AGHT+IGzlmYJLVymI/kyifxveNK/LfgQ+Xnjpvu8Tjcs/wSWITIV+fhUxqMJXvR2teMx2nC851dxiA== X-Received: by 2002:a05:6402:2743:b0:5be:ec27:f304 with SMTP id 4fb4d7f45d1cf-5bf1f0dcafemr4222212a12.15.1724355519317; Thu, 22 Aug 2024 12:38:39 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id 4fb4d7f45d1cf-5c04a4ca7fbsm1218344a12.67.2024.08.22.12.38.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2024 12:38:39 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Shin'ichiro Kawasaki Cc: Chaitanya Kulkarni , Hannes Reinecke , Daniel Wagner , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck Subject: [PATCH 2/3] blktests: nvme/032: skip on non-PCI devices Date: Thu, 22 Aug 2024 21:38:13 +0200 Message-ID: <20240822193814.106111-2-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240822193814.106111-1-mwilck@suse.com> References: <20240822193814.106111-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 nvme/032 is a PCI-specific test. Signed-off-by: Martin Wilck Reviewed-by: Daniel Wagner --- tests/nvme/032 | 2 +- tests/nvme/rc | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/nvme/032 b/tests/nvme/032 index 5353e96..512d7ea 100755 --- a/tests/nvme/032 +++ b/tests/nvme/032 @@ -24,7 +24,7 @@ requires() { } device_requires() { - _require_test_dev_is_nvme + _require_test_dev_is_nvme_pci } test_device() { diff --git a/tests/nvme/rc b/tests/nvme/rc index b3b1149..e7d2ab1 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -130,6 +130,14 @@ _require_test_dev_is_nvme() { return 0 } +_require_test_dev_is_nvme_pci() { + if [[ ! "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ devices/pci ]]; then + SKIP_REASONS+=("$TEST_DEV is not a PCI NVMe device") + return 1 + fi + return 0 +} + _require_test_dev_is_nvme_no_mpath() { if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-subsystem/ ]]; then SKIP_REASONS+=("$TEST_DEV is a NVMe multipath device") From patchwork Thu Aug 22 19:38:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13774137 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16FB11CB334 for ; Thu, 22 Aug 2024 19:38:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724355526; cv=none; b=UcJ6WHDqo2XvkvL8tSPwsuBHdzCIcXmw1eutL3Tq3QOyM3nrJVRyxs1Ih12yr0VjdgeDIHFPO8JHgECqQjTahG3mch88bqqz3f13VA75SkuLRCeQkoyhU82SgzSZndAMc+fiJP6jzDhdNbt5jsBSYsiIfDJ92g4mfTtZartcSxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724355526; c=relaxed/simple; bh=EH6DGw3oIGH6mn74/zAp6eRMaKqGcnnNiq/AnrbpyYU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iCD4jiM932eR/G8IS8Vq30+wX385/zSHdQEZ4ZcJB0p3//I46AEXSURi/odLMg6PbgbeK0p9K7fnO2zHCvRYsejsaPRLOoazBOXkc5hF/tWAGc8Xcnuue7lU344CqzI9bJ/6Q6zHbwimhBgoliN7hMZNEAKoa4QHQgyvpwnGn4w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=D492xFOY; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="D492xFOY" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5343617fdddso998913e87.0 for ; Thu, 22 Aug 2024 12:38:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1724355521; x=1724960321; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3glpGU9x1kcJJgX+l/inQq4k3AYAsir0suA9GFYY2co=; b=D492xFOYbFfepR4zjZT6UeCsOQP/OXpRHXQQIL8f3/ub9hmOfZi5nqM3iWVNdljerM 8rHsQPie0+2nOHayNTiXp+NF7bRDcUITxc0ddMhRDGWmfEGOm3ezDfio4NhWZJCv5i2a Dl+Uq+RtVls/MUKFWkotqv9+I5fqPr7nE84wROr1sc4N2nJQWmMDA3ztJrwxpHf3SaUD z1kUl4Ntj20MpGFbe/axPAi9NQZ5T8tOVixMjXdpvZODCCXJLXg5W57aYsZCdtkDvR6L Q1gWsJo3VbJzBinqkFBjbbMcpeTOKkUkZzv6sGRvauciSmK2FJ/SpRzF7IWrd8Aq55og 4cQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724355521; x=1724960321; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3glpGU9x1kcJJgX+l/inQq4k3AYAsir0suA9GFYY2co=; b=Mlb592Q8x7kyXGutC2/JnNg6aZMS+LU0X536RD0BsraTOFKmqz6+MWcGdP5fqWVGYY MQR3UPnhvh5ap5t/IN7I4BDQC1uSCyPzQKZ5oc6cDuo5fhuTuaMxtzM/JJzvuVoCRJm4 V2ZauEV2JVn5d69UH9FhuR8OVTnKRPpGTXsZS8ZtQ0w9j4NJ8/g9/ugOqyjeEH6R5cmf Tpa43fKhnW/Rfs/GyMUbNB5XkAaXxXwft46VXCY5PRySbNXcH3DWneV1aIpszIfE5u+E 2iXkQM5JtCt5rGCITW5bfZzvipLyfNdTQIgyf/AdstrI56ye+fCOY0vjf0XUEgkUR0Gt eIEw== X-Forwarded-Encrypted: i=1; AJvYcCV2LMwIP2uiAM2uiw3fZXikqM04Di87rukNKqUcYWupIlKIn3I51Agh5ny/AaTFHzEsSjbtDyB4NttNxQ==@vger.kernel.org X-Gm-Message-State: AOJu0YzB6MVHfnqVzU9vAL/Q8y9RUW3TwPEIi6Hiyxmcf6VroynsA6SS 8BDgBYJwMfRz151N25IGRzlLtUzPUF4BLyOSo0vWj7bD6gykYABIzg8NWLjM7bQ= X-Google-Smtp-Source: AGHT+IHqvYbFPPhwdBEjAHOuESxTgY/1gVffG8gG/TzIbACUog4K/qu6fYhtERnRe8AF4PZoWif7ZQ== X-Received: by 2002:a05:6512:2212:b0:533:45c9:67fe with SMTP id 2adb3069b0e04-534387bad1dmr31454e87.48.1724355520505; Thu, 22 Aug 2024 12:38:40 -0700 (PDT) Received: from localhost (p200300de37360a00d7e56139e90929dd.dip0.t-ipconnect.de. [2003:de:3736:a00:d7e5:6139:e909:29dd]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-a868f4ebdc6sm155987166b.188.2024.08.22.12.38.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Aug 2024 12:38:40 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Shin'ichiro Kawasaki Cc: Chaitanya Kulkarni , Hannes Reinecke , Daniel Wagner , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck Subject: [PATCH 3/3] nvme: add test for controller rescan under I/O load Date: Thu, 22 Aug 2024 21:38:14 +0200 Message-ID: <20240822193814.106111-3-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240822193814.106111-1-mwilck@suse.com> References: <20240822193814.106111-1-mwilck@suse.com> Precedence: bulk X-Mailing-List: linux-block@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a test that repeatedly rescans nvme controllers while doing IO on an nvme namespace connected to these controllers. The purpose of the test is to make sure that no I/O errors or data corruption occurs because of the rescan operations. Signed-off-by: Martin Wilck Reviewed-by: Daniel Wagner --- tests/nvme/053 | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/nvme/rc | 18 ++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100755 tests/nvme/053 diff --git a/tests/nvme/053 b/tests/nvme/053 new file mode 100755 index 0000000..41dc8f2 --- /dev/null +++ b/tests/nvme/053 @@ -0,0 +1,56 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Martin Wilck, SUSE LLC + +. tests/nvme/rc + +DESCRIPTION="test controller rescan under I/O load" +TIMED=1 +: "${TIMEOUT:=60}" + +rescan_controller() { + local finish + + [[ -f "$1/rescan_controller" ]] || { + echo "cannot rescan $1" + return 1 + } + + finish=$(($(date +%s) + TIMEOUT)) + while [[ $(date +%s) -le $finish ]]; do + # sleep interval between 0.1 and 5s + usleep "$(((RANDOM%50 + 1)*100000))" + echo 1 >"$1/rescan_controller" + done +} + +test_device() { + local -a ctrls + local c + + echo "Running ${TEST_NAME}" + ctrls=($(_nvme_get_ctrl_list)) + + _run_fio_verify_io --filename="$TEST_DEV" --time_based &> "$FULL" & + + for c in "${ctrls[@]}"; do + rescan_controller "$c" & + done + + while true; do + wait -n &>/dev/null + st=$? + case $st in + 127) + break + ;; + 0) + ;; + *) + echo "child process exited with $st!" + ;; + esac + done + + echo "Test complete" +} diff --git a/tests/nvme/rc b/tests/nvme/rc index e7d2ab1..93b0571 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -192,6 +192,24 @@ _test_dev_nvme_nsid() { cat "${TEST_DEV_SYSFS}/nsid" } +_nvme_get_ctrl_list() { + local subsys + local c + + subsys=$(readlink "${TEST_DEV_SYSFS}/device/subsystem") + case $subsys in + */nvme) + readlink -f "${TEST_DEV_SYSFS}/device" + ;; + */nvme-subsystem) + for c in "${TEST_DEV_SYSFS}"/device/nvme*; do + [[ -L "$c" ]] || continue + [[ -f "$c/dev" ]] && readlink -f "$c" + done + ;; + esac +} + _nvme_calc_rand_io_size() { local img_size_mb local io_size_kb