From patchwork Tue Sep 3 16:29:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13789051 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 AE78C18890E for ; Tue, 3 Sep 2024 16:29:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725380993; cv=none; b=k2pMC8RikkS2u3Bt+F1DCoIZUerO8Gd/2xNF7x+2Lwk1OJ5nhbnXMWTH8TN7sjMZiJQgZnljZ7c0OfBGJcFoGPjez7X7TSCGAzcs9IOl6zz/otFaucX8zA/ktdJ1bwt9giIX7Z2O2KaZ5cVdYuNNiSH2WU8HDGNT+18vzGmRL7A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725380993; c=relaxed/simple; bh=Sd5w9XFTXjbRiMlg7X607pJX0T7w9hnXfb2ERWW712A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nf4KlfNELvakoi+kAD9T/nqNG7nVm/SacqOPbbow81xgzn4ndQQY0yPRhC3d++mRBR5hggqZkWdSXwmP1ijARo18bhr6EfklSJQLU099+DUVNpu9jyZsE+1925G9oFnPj9WnyiRIBHTp7BoMsHFamCGWl+4iFCl+hkMc/VglU+o= 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=SCbPwTT+; arc=none smtp.client-ip=209.85.208.46 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="SCbPwTT+" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5bf01bdaff0so5193931a12.3 for ; Tue, 03 Sep 2024 09:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725380990; x=1725985790; 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=UQqPVXsmN3ETPXhJs4cjYSNwhZKHftRjyjECFeKlbuo=; b=SCbPwTT+q02PXaG2d5BkAdnoHh/o+Hx9UUYWZZg0kVml8eOW6xgRSvkp5mIXvarAs2 eiLiSP7nmdwO0nCw7sTI0iYOzm9H+qoAPebzjvp6PDIZf5iiPMkcxXc2X5F8G37kR9eE oOctenKgHWoJWYVOoWlKrkXIqpHVcWZNvLJrblzrrYL8lL/VgoG4/9oyBDRuikvk3eT5 cdCxWc9A0x7DNf/4WGMDOWd7nMxQCz2wXXBDn1ZgIjY51Uw9uWBDQwHQp5wAigURavSk APQjbWAl+Tox944eTUh72rtpM2GUqq6y9J7SadOfuYhAOWEfoKN8QqwR9oOOWe9Ckk/V YfDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725380990; x=1725985790; 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=UQqPVXsmN3ETPXhJs4cjYSNwhZKHftRjyjECFeKlbuo=; b=wd1LIPJVNd8l4YEy0UyeAt3H12PQyNkoEel/u4PHHE3KvM3kRTYkdkgrdFBWpFvaRS hxl+ckCH0Uz9P/J4/m50X04CL6CiVfCXrUyRHfiGItD93nI1dDoYn/tXqgnhHRW+zo39 qjPn0Eb29fAKftb5bxI667Lo30Tuz1YWz3blhZGhrS1ylOOlZDlhrUk0wu27qDjHG1Co dH1G6wv1JsccMPhXWul1l0j80kS/piK6EuPl2OyeuwXtdDvL8F3pKFTu8S4kh/fdabqO Rg2nAaqtPWzvLcb3RapYQkV3ipWnrBu7HDnTfZxqIappPgU1N6stlRFQh1pjG5SLBwqP Xi1w== X-Forwarded-Encrypted: i=1; AJvYcCUx6t0piQ8U49lej8f9Gu7WseEzH38I2aIF6FVaJ9L7eAzDjkWjEgXc6p9D3T8pPPIHTBamACuKbMoO5w==@vger.kernel.org X-Gm-Message-State: AOJu0Yy83ZCw7XDQQDgysveKZFiv/Xbelf+xuj5RwzAM7XFWG4qcFnyc YKIBXJWBeYsr2EuPTr5yaq8DfZFRLqBTi7/riwtErsaU+bOXhiIGhWWjlbVDjb8= X-Google-Smtp-Source: AGHT+IH7yYKLPVeQag7fEGv6/SszKPesauA8u1JjO4CePX3FkM/7vdP8YQ5ERcROMsGS34x+/fJVDw== X-Received: by 2002:a17:907:72d3:b0:a88:a48d:2b9a with SMTP id a640c23a62f3a-a897fa74459mr1319001366b.52.1725380989485; Tue, 03 Sep 2024 09:29:49 -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-a898922259esm701051966b.209.2024.09.03.09.29.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Sep 2024 09:29:49 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Shin'ichiro Kawasaki Cc: Nilay Shroff , Chaitanya Kulkarni , Hannes Reinecke , Daniel Wagner , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck Subject: [PATCH v4 1/3] blktests: nvme/{033-037,039}: skip passthru tests on multipath devices Date: Tue, 3 Sep 2024 18:29:28 +0200 Message-ID: <20240903162930.165018-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 --- v3: improve patch subject (Shinichiro Kawasaki) v2: used more expressive function name for non-multipath test (Daniel Wagner) --- 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..5e05175 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_not_nvme_multipath +} + set_conditions() { _set_nvme_trtype "$@" } diff --git a/tests/nvme/034 b/tests/nvme/034 index 239757c..154fc91 100755 --- a/tests/nvme/034 +++ b/tests/nvme/034 @@ -14,6 +14,10 @@ requires() { _have_fio } +device_requires() { + _require_test_dev_is_not_nvme_multipath +} + set_conditions() { _set_nvme_trtype "$@" } diff --git a/tests/nvme/035 b/tests/nvme/035 index 8286178..ff217d6 100755 --- a/tests/nvme/035 +++ b/tests/nvme/035 @@ -17,6 +17,7 @@ requires() { } device_requires() { + _require_test_dev_is_not_nvme_multipath _require_test_dev_size "${NVME_IMG_SIZE}" } diff --git a/tests/nvme/036 b/tests/nvme/036 index ef6c29d..442ffe7 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_not_nvme_multipath +} + set_conditions() { _set_nvme_trtype "$@" } diff --git a/tests/nvme/037 b/tests/nvme/037 index ef7ac59..f7ddc2d 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_not_nvme_multipath +} + set_conditions() { _set_nvme_trtype "$@" } diff --git a/tests/nvme/039 b/tests/nvme/039 index a0f135c..e8020a7 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_not_nvme_multipath +} + # 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..5c554b6 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -130,6 +130,14 @@ _require_test_dev_is_nvme() { return 0 } +_require_test_dev_is_not_nvme_multipath() { + 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 Tue Sep 3 16:29:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13789052 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.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 D7A1139ADD for ; Tue, 3 Sep 2024 16:29:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725380994; cv=none; b=q0xmbg17O9GPjve5luf1+7Tj0CvRmLAqRmanT7rjHqid2VGT6El4Lvx9wRMyBI5W03OWviOS0Sz+CFcVGBPwwGBA3vy+HiiFfruNQvgaArHLKy6Yp0cd4pVtXdL9VHClQJ7lvid5IoGWvYE81lFk3sNY56o4LagUEvEm7EiSEG8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725380994; c=relaxed/simple; bh=pIR3vM/y29oNJ445O02kZeRZAQ3oVk6XvfNJdo5dza8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nQDqhRbzIaldVJ2n/igduaTd4jKnKx9/JzS/5YaOu0kf/YWZYKjA6COJukH0XskGubN+XSvGMFUSikYsgDMU6UYEr865t6kVnuMoh+yT99Uig9+a1yj5B/+ZxZs9k1iAt/NLeZAMKVrDO4KDypV/sMGnRZZg/sXPg8G9XXAPI8s= 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=LDO/cvpf; arc=none smtp.client-ip=209.85.208.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="LDO/cvpf" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5c26311c6f0so2232529a12.3 for ; Tue, 03 Sep 2024 09:29:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725380991; x=1725985791; 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=qSE07mevysGs4hIlAiWiKLrTdVKJ6Yd2deEW2FZkz/M=; b=LDO/cvpfRVwLDovkfrGIqy3eEUL4yCBOuiZa+MVdVEfjn4VQIKNjMvk2juZ4SkYJUO wJBwjymQbd7zD1hUoy01j3QB7fp/ty9LeJDWshpTD+mTny95qFBTxLVgm+eMf9nI942p ry2SPCIbiD2FXThI4C+kMdurpA6TjBTgQL5xgI1Oyzdm7NpZ/UEt5Sd1gqr5WkCpW5lO An39xd8XUbNIaqOSMB59T6cL6UYaCjkremRh+Ui1f86eR/TEGkitgKTSQK4uVEf91byU RbJCCFoJGwBA7dY4ebg+6S1/8/xNpzQnFpN6I6992GdxVfArTDA97nNyPWc1twuXmBju BPKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725380991; x=1725985791; 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=qSE07mevysGs4hIlAiWiKLrTdVKJ6Yd2deEW2FZkz/M=; b=CZx9hYtnBCaGeeFthKJ+3BEivcOXH4utm1zHCigCxePOUluMaw+VVJQ+FLOYnhNBqF 2Bj9JqgZ9h6/HcsL4H7RFI57WWBqE0TR72AcdAVrGAK7OTCpUwwIlWWEB2pbJ3AFAr1y 7rMxLjOK5IplK2ZMxQXKdNdc++9wVpAQAcCvzGWplpIk96+0lFbAmZUsdw5o/n32/Wj4 s20OjrngsPJNZ8F+KAkIZXT8n40OcPsmwy1goYPz9OwUhqDx8cxVvuCvGWwqH7Bj8GB1 Q7GXOUISNLZfvD6ngdjEf4Oyxs7fhsSVK6k04dNiLePpwrsrURzMYYzIAy9x6xw8w7xB WQ5g== X-Forwarded-Encrypted: i=1; AJvYcCUR5GSFrQlShSDzEzx3aifyVLR7L4ihwOQMC7T7pixMJjVzNJ58Y1NNkryNgHmCUx/iO9zPAZMNQg6AzQ==@vger.kernel.org X-Gm-Message-State: AOJu0YzhoKtYTADdA97qXdJsReitRD0FBuJBUzLs1D6RS0t2Ewiu9orC xHfQ8kJaGjdiryIdwrOD4CVGkJ0yRQ7S22RP6Wyz+o0sM3tTt2caT0+IUlsEwgc= X-Google-Smtp-Source: AGHT+IHtUoACfXNZ0W0C+bZ5247zZGeTkQsGperLhXX0DXaaUPvoiZyijPDr90lFDqYaGmMUUYdyBw== X-Received: by 2002:a17:907:1c03:b0:a7a:b561:3575 with SMTP id a640c23a62f3a-a89fafab356mr646544266b.56.1725380990545; Tue, 03 Sep 2024 09:29:50 -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-a8989221df2sm693736566b.203.2024.09.03.09.29.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Sep 2024 09:29:50 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Shin'ichiro Kawasaki Cc: Nilay Shroff , Chaitanya Kulkarni , Hannes Reinecke , Daniel Wagner , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck Subject: [PATCH v4 2/3] blktests: nvme/032: skip on non-PCI devices Date: Tue, 3 Sep 2024 18:29:29 +0200 Message-ID: <20240903162930.165018-2-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240903162930.165018-1-mwilck@suse.com> References: <20240903162930.165018-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 --- 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 5c554b6..b702a57 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_not_nvme_multipath() { if [[ "$(readlink -f "$TEST_DEV_SYSFS/device")" =~ /nvme-subsystem/ ]]; then SKIP_REASONS+=("$TEST_DEV is a NVMe multipath device") From patchwork Tue Sep 3 16:29:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13789053 Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) (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 215F118BBAE for ; Tue, 3 Sep 2024 16:29:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725380996; cv=none; b=mfauaNqtfYG9mfAZYp11clAQQ9g2LRd+HCybpYqpVjlK2eLQwnxK6ACuY3mH5KhQlD8nV2Seb81peJLHnl3eSqcvvaZzxTfVOysr4r1KpTKiqIPR0KhXFce3CahkE6HEbPPn+C97/vC293zSMae7VVXKsNo+gOclkHCbOP4S/hM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725380996; c=relaxed/simple; bh=yiOBXAAMR2RPq6t3rhDZipLW2RElokEi1yZq0mg2its=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nK1Rc9vZPxOL1GDIpKywyhg14T3AC0pYS32MnmuOi4/5B/C3kwZCsJBjmV78B0R5mOb8ZKOW3hDN2r2Wo0/Ji1AEn2By1nQcaNP8fM9RcA8tjl13/ZcMHWv28U7pw9susewDkVOZD9RVloUPYlUzST2q33Dv4vsMTboHSy2Y1Cg= 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=CO+wSHvO; arc=none smtp.client-ip=209.85.208.47 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="CO+wSHvO" Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5c26815e174so1915088a12.0 for ; Tue, 03 Sep 2024 09:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725380992; x=1725985792; 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=wjBQiSI/EgBU6FriPosIOGq+TtZhMJPpr3ANm85z/c4=; b=CO+wSHvO1Qir2jCmKFztA8PPSBoFRpQkcdHbdMELWGu/i/5L+WlgjhLQW7PBs+fR7l Y2oLneansbuIzOEDcfNvj5q6xGSndw5ifd8pQrhIYLILor4aHVsPHgPbWOtHsoPTmhSm 1/0O+vMtToUOmZsM+nSOKZYoJDWx/dv6kRGw/Y6DEC+482oLHgABfiu/TMcC4ZVUGjcc /m5zAbk/6XzosUnjiegb7Y/hEsnECGivvHRonTmNCd9LYgbgpaLX/MF1OpHcN+fjuglu FaQZFei2gpgiAzQ/F7i3X9DkUi0a3oqx3pkkPQunZhG7/65GlSjue5RvPEolGbIEDx5m YgtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725380992; x=1725985792; 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=wjBQiSI/EgBU6FriPosIOGq+TtZhMJPpr3ANm85z/c4=; b=k0S0yGF07d0nM8TVyJjlt1TfqYwhRoeTr/jWY5saGGLTYSlOtv4Uzt0uJDgfsNc/Bd hAzYrNhKz1Zfrjce5MjT+LEsmQiIHKQJYlSm2qI0O6pqU58CcVKcUBV0kwPMvBPshHXy dOK6FlK2W18Ju/AggdcWKkspOBkkL/W8rQXoUb20n3xOuRiRbv0Se8Ui6X+Up7c0+apz OYqznKViGGGQu28j9VQIoYaa0DvYb8s5g+CC6DtifyOSXPdyHux9u6up2q4H4+D/3b9N MVBOiv3R397CyMd1XKE5xkf0p8ghrwpGPDnSov82wQ13eWo7zBvX57wfY2awWh96vOwZ WOAA== X-Forwarded-Encrypted: i=1; AJvYcCUt2Y9BLm0dYxfBbGjkhf7LTUc8vjeescoxeRzepLfSwT+zXIOv90fn0sTC9I+hAv/xX2+l0QtFZp1sHg==@vger.kernel.org X-Gm-Message-State: AOJu0YxUnGeI3xIZ/k3naXTUyY7NC2NxlYhEbDbhfQp8P9P9O1prxGJR FgfPh7KzAR7YErL/pG59d74MmzHM4dl75fJDncr+l4b/Anhrx4SZf1Fl6wuHSs8= X-Google-Smtp-Source: AGHT+IHlZUobr/C0J2+/9pQ8nTa5nQhyGcKMEPbg1UP4/CUKEz9Hj/g76GDCLJIKRO6LyPd+J7Bumw== X-Received: by 2002:a17:906:f590:b0:a86:f960:411d with SMTP id a640c23a62f3a-a89d872464emr757306466b.2.1725380991815; Tue, 03 Sep 2024 09:29:51 -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-a89891d7368sm701977566b.168.2024.09.03.09.29.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Sep 2024 09:29:51 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Shin'ichiro Kawasaki Cc: Nilay Shroff , Chaitanya Kulkarni , Hannes Reinecke , Daniel Wagner , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck Subject: [PATCH v4 3/3] blktests: nvme: add test for controller rescan under I/O load Date: Tue, 3 Sep 2024 18:29:30 +0200 Message-ID: <20240903162930.165018-3-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240903162930.165018-1-mwilck@suse.com> References: <20240903162930.165018-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. The test uses sub-second sleeps, which can't be easily accomplished in bash because of missing floating-point arithmetic (and because usleep(1) isn't portable). Therefore an awk program is used to trigger the device rescans. Link: https://lore.kernel.org/linux-nvme/20240822201413.112268-1-mwilck@suse.com/ Signed-off-by: Martin Wilck --- v4: - use while loop for array assignment (Shinichiro Kawasaki) - add "blktests" to subject line v3: (all changes suggested by Shinichiro Kawasaki) - add "Link:" tag - add comment with patch description - declare variable "st" local - use "mapfile -t" for array assignment v2: - don't use usleep (Nilay Shroff). Use an awk program to do floating point arithmetic and achieve more accurate sub-second sleep times. - add 053.out (Nilay Shroff). --- tests/nvme/053 | 76 ++++++++++++++++++++++++++++++++++++++++++++++ tests/nvme/053.out | 2 ++ tests/nvme/rc | 18 +++++++++++ 3 files changed, 96 insertions(+) create mode 100755 tests/nvme/053 create mode 100644 tests/nvme/053.out diff --git a/tests/nvme/053 b/tests/nvme/053 new file mode 100755 index 0000000..3ade8d3 --- /dev/null +++ b/tests/nvme/053 @@ -0,0 +1,76 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2024 Martin Wilck, SUSE LLC +# +# Repeatedly rescans nvme controllers while doing IO on an nvme namespace +# connected to these controllers, and make sure that no I/O errors or data +# corruption occurs. + +. tests/nvme/rc + +DESCRIPTION="test controller rescan under I/O load" +TIMED=1 +: "${TIMEOUT:=60}" + +rescan_controller() { + local path + path="$1/rescan_controller" + + [[ -f "$path" ]] || { + echo "cannot rescan $1" + return 1 + } + + awk -f "$TMPDIR/rescan.awk" \ + -v path="$path" -v timeout="$TIMEOUT" -v seed="$2" & +} + +create_rescan_script() { + cat >"$TMPDIR/rescan.awk" < path; + close(path); + } +} +EOF +} + +test_device() { + local -a ctrls + local i st line + + echo "Running ${TEST_NAME}" + create_rescan_script + + while IFS= read -r line; do + ctrls+=("$line") + done < <(_nvme_get_ctrl_list) + _run_fio_verify_io --filename="$TEST_DEV" --time_based &> "$FULL" & + + for i in "${!ctrls[@]}"; do + rescan_controller "${ctrls[$i]}" "$i" + 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/053.out b/tests/nvme/053.out new file mode 100644 index 0000000..e8086ce --- /dev/null +++ b/tests/nvme/053.out @@ -0,0 +1,2 @@ +Running nvme/053 +Test complete diff --git a/tests/nvme/rc b/tests/nvme/rc index b702a57..a877de3 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