From patchwork Mon Sep 2 14:27:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13787364 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.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 3B2AC19E977 for ; Mon, 2 Sep 2024 14:28:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725287283; cv=none; b=CXjp6+MQ1fBdLapgqHZdqQmQKMQS5RuM6M+nsQi0Bl299BCdUvkYwIbRkEaJvw8vBorod3ZOpXKTA47IyZIq4ufKXkfgp8ZBwaJCzlJ3IN8v5l/BmghzYVzwtP1og3BTdnrJoX+TqXwNy7Qk118Obs895sL5Fz4OhdgMKLmaH6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725287283; c=relaxed/simple; bh=Sd5w9XFTXjbRiMlg7X607pJX0T7w9hnXfb2ERWW712A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=eadehOCKaSBf7gtWZL6SHrCaHvLdm7EdB/IKIPX9K7Jz3JA8MwEJtFO7wrGJ5I5g2nohj3csd+NTyYApm73n+h9AUmtRoNHmq2XOQ7Te+BXL2hsIAfJFUpr5i8RyOkgBCSgFjRZLRMKa9WFEvMi3jU2eASVvhDQIgS4Oxntn508= 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=VIirKn7I; arc=none smtp.client-ip=209.85.218.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="VIirKn7I" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a8a16c53d3cso56290066b.1 for ; Mon, 02 Sep 2024 07:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725287279; x=1725892079; 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=VIirKn7IUw3TJ9BuunCcOGT8gWIbl5yAFarLCnkbtkaQ8YR4W0QsLNJsZiHXcbE0ON ZLwg8Pxjm9OlXxiL033mEWo233HR5Vf+B9WeW05letxtJxueJUgz2klJbSbZ39LGkLtX X12oMCLC40CvJ1cIVdv0ASnQedlt6jqAuRl+0MZipHTIDaN5dlfcEEY3LWn5+sIdTtUT AHASA6P3iY1PPAupd6sYxvLJfiDMjC/pkem+WuNYSLemQARGHhlU9zLTwZGIuScZ0p+g bUN4sTPePhochLMS5TDgTIQ9wppHFhGn9CPQX+KimyAFXjXlwnqmw2udnLD2tlh3QPPT E/bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725287279; x=1725892079; 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=qXybh//IU0w/Bw6RakKvI50nEStV8B3TtqU8kElBn5Eg99PC64fODsfey66COGlzgq GPDpTwTJVE6PNgfP+X/ORoGj6AWjt/UJsu3PapcqM5P8Lc0dwZWSWg46U23P1y2MWvJ+ 4nAFMUr9f5j24k/2W9S4Nn/M5ppe6NxvtE35jr6REA0Dyu76mnVIleoDJcjJJ6MSqic2 uqLV+vuNUxtvhRarUdc0rBIrBeqi9DHJHNTtqvDkf8dFk6cEgWSRVO/HyQHAsub6KihD tmu37905harywmkMKfvrBB0wE1nZB7IbPkOz3q9L7RM33f8B/PayjA/ipV7Vgteqk2VE 09+A== X-Forwarded-Encrypted: i=1; AJvYcCXk07NcoYXUHJhfpML0FSn56Q9nogDbVcyuIcqBmPbanIFKzWXicgzjFB832wcW6WulwX8GlK+o4yqA/Q==@vger.kernel.org X-Gm-Message-State: AOJu0Yyr+l4yJi/ypAQNg9DniZLt/gSv4cBEHHU9pc8n32rjikzjFKRE 9M7HOyn4F3nX423QZP4bM4xFUMQa0ZKRAIKQ9VpGwsQgXg+Hfh5OclcG47MJDvI= X-Google-Smtp-Source: AGHT+IFwU1bw/XpVW9MjXzWxGVdxxDsb7XOeZDUlCoaSOFEdDqvAv7ft1RhGTlzuaVlVoB1lmeR00A== X-Received: by 2002:a17:907:da2:b0:a7d:e857:1490 with SMTP id a640c23a62f3a-a897f8d51dcmr1054688466b.37.1725287278630; Mon, 02 Sep 2024 07:27:58 -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-a8989022a69sm562225966b.87.2024.09.02.07.27.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Sep 2024 07:27:58 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Shin'ichiro Kawasaki , Nilay Shroff , Daniel Wagner Cc: Chaitanya Kulkarni , Hannes Reinecke , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck Subject: [PATCH v3 1/3] blktests: nvme/{033-037,039}: skip passthru tests on multipath devices Date: Mon, 2 Sep 2024 16:27:45 +0200 Message-ID: <20240902142748.65779-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 Reviewed-by: Daniel Wagner --- 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 Mon Sep 2 14:27:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13787365 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 04C4619C55D for ; Mon, 2 Sep 2024 14:28:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725287284; cv=none; b=TJpzkriflk2hNG4CNcktXXs/kUdFkLc8Qo14wmrY/RpuOWho5f0tHdC7Vb3YH8m0iJydsq+bXL1fnBOo21YDBP84tSMbDSOCfBp1wmXRx8bqr6ZybwRdiaMUsVP/SVM4Bj58ypi/ez4vJ9qfZTZarV8cU6ibzsqNsutj7tJqr2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725287284; c=relaxed/simple; bh=pIR3vM/y29oNJ445O02kZeRZAQ3oVk6XvfNJdo5dza8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B1UQ2JafyH0LXQaNR4cp1Q89csiMeHyZ3QlTT0h/LAljBs+dfQCcfuD5pg9L/0zFh4iI6MIForesKurfTgKal1uhjE6S2hYaFlCTOMZ3w+NYD0ghXbm/Ei3/ycor3cUrilqTTpzVTP1o/N98W1mmqF8H9t/1uxLqMQHpaWzfQPE= 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=GbHi20SZ; arc=none smtp.client-ip=209.85.218.42 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="GbHi20SZ" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a7a843bef98so434954866b.2 for ; Mon, 02 Sep 2024 07:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725287280; x=1725892080; 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=GbHi20SZrlCyf/SM2xGP4MvO/qLwLMkveBjqhADUYBvlDjfLUK5E8KcDMOdtrkK2q0 qkZVgN7A5Wmgd94PUnscu2567BFUtzA6syhB2ePG9XfmWBLLcG1lw8z1G8wgMw0Oafd5 T6gx164JPfkmwUeGHT03CxRg035fra4hCGVBx1lXm7z511gld3FrNww/2YlSQnHo/X+4 2Wmrpif/Jl3MT6W9VS22mMWOvYl6HqFERxlDS1hkIYZqMIdK34s5HC0eW7lO05KFMaXS c0FFws9p4tVBYH716HqwfmHgO9YK6YW0y8s2qenujYs87Tdr7DEBUDPBea42D3csQ9rk qOlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725287280; x=1725892080; 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=kWWoj9+uBeHolGCZy/75dU4mOkfswWftI64jM6K+G+EjI2BkIaZE7YanGXrUybkmTf nepa+juf6YiBIyKYTaUIdCceM27+gNRJ07wnXTVU218Lk3kwBDafz5ommfx1tjkolu4V blZGb8/E6gcEZKNv7Fpq/aRAojd1S3KC3Ee5ycxYZaUfoJgdN2+QRJDzZjt0cPsVsv2m acgB8hDT6Q2jxLlJvrSBN0AfumBzBy2h9DSWsI4pEKpgBfV/H+4D5JyzTYkK5hWrC4JW PH1HASD/DT6WbfmJjno24i6/m+tPTaURKPE1k5maH2fSjcpWqOo3keOChkNmdFSc5TsE yELQ== X-Forwarded-Encrypted: i=1; AJvYcCW756bqsdA8lvFIJOAL1Fb9G1fvv6/jQQLmrUVY5w7pWnDluU/QJUaS8OKBbdwxEFG0Uv98bee3I6W3cw==@vger.kernel.org X-Gm-Message-State: AOJu0YzwELCBGPHzZ+kfufod7poJn8WlERmghuyi755Hba6Dm/pz5kHw 0ggOGs/CxbLGQq+Ze0M8r1Rv4FTMg6zU4SDVHyydmLLg1dOuTcEebUDU2hhzCr8= X-Google-Smtp-Source: AGHT+IHzmM/02a8X0RvNaEpE3DTRzM83VRKSxFjouuZ9q9FeyTnRWM8bE3z6odD+9nYtgHRAaJIUnw== X-Received: by 2002:a17:907:26c2:b0:a86:92a5:247a with SMTP id a640c23a62f3a-a89d8781d07mr538729566b.17.1725287279800; Mon, 02 Sep 2024 07:27:59 -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-a8989196bc4sm564753866b.125.2024.09.02.07.27.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Sep 2024 07:27:59 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Shin'ichiro Kawasaki , Nilay Shroff , Daniel Wagner Cc: Chaitanya Kulkarni , Hannes Reinecke , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck Subject: [PATCH v3 2/3] blktests: nvme/032: skip on non-PCI devices Date: Mon, 2 Sep 2024 16:27:46 +0200 Message-ID: <20240902142748.65779-2-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902142748.65779-1-mwilck@suse.com> References: <20240902142748.65779-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 Mon Sep 2 14:27:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 13787366 Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) (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 1DC2819E977 for ; Mon, 2 Sep 2024 14:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725287286; cv=none; b=ZITJF46xZ/LcyKYEEweZZh8oRXBlL0wedoTNgguYODbGzSge+R5CbBuv/5Aq5HAlKSI9qEWH/SMEuorB4hlw8cTCz0IASW33jG+NXfx68VhD6oayU+oPqIJEBJ78IrkluE8AiOitx91nBcGJGyHAxm4/rr4Zq+Bw9XjUXwnmQZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725287286; c=relaxed/simple; bh=KDplJl/RrUBdZt2PBYnQbFIAOQzTNLGE+ZD3JCo4kSs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XRrdVmTafK49GG3t0RnXweEs5iDYAlQEtOL3ufm6ehOrX4WU6RgupsFxF/ZfQGtQAUV3+fQ7txjlnIPwnF3DvacLTItcUW/z4CUvAd0pq/cTuosl/tt2bZMmpScg8kQmASRfKeOsUV1cOVqIy7IHftxuugjSmAeBEYPWxyoFG/c= 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=Vpq+LbFL; arc=none smtp.client-ip=209.85.218.54 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="Vpq+LbFL" Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a8692bbec79so486479366b.3 for ; Mon, 02 Sep 2024 07:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725287281; x=1725892081; 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=oQ9LsPTxm+VbQGotIboa4weytFmVBj0/VPIq2l60SY0=; b=Vpq+LbFLbTGKOyeVT5B4Ko2lpNhxFy7wDKqIi0WBTkTh0bnhlFr3P9Uu6ic34p9kCy d9II/Qpj0ORYdOjlhM5/3F7z1ilS+rqv+8WXg3Xl7fDMdwqdvh8Xf0OVQwsyUmMR6TmQ u+6jQQv2MPKOWnvVvCSZ1OKM9GxYZKuHhdbE8V8u+QKR1tOmFIUWKh638U2O3lrBTUsm Ws3nBqjVmd776HBVrOBii4nRtYBx1/HIANnn3Uc64WPAgghS8BEZf2jvf94RKwGEMvkv Hua2ix1uDDGIBfTuwWcqnt098XJKU/vnBYN68M5fKpeMFzNz3FRjtgY6lkhMXuXUsFLd ydww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725287281; x=1725892081; 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=oQ9LsPTxm+VbQGotIboa4weytFmVBj0/VPIq2l60SY0=; b=bJb87o+lu7YBrluezL0yf85YYK1hUi/ZuMA9qiqEq6WUzgWKk7pI/ypo9n29Ry6XfM y01uvojUv/KsljqZmiPBXCA0e7ZwCbHeTo248qIk5t7wp+yr5ZzrbypS6GAMGLfUXUWY 1LnVjhOMFPZ6tBB+V9/nlUyIrsqrFuAL4XIM/12arMMXjaD2J2y5JjZPn98GY3ZOzVSI 9paZWfZGCg86C922DfXJu8YnWm9K5kNITS1kkd8mo4sjZ2mQ8MFAvVwv8+Nf/RKYf5io QxrX6oGZaOTsXZwyS7XMsWi0te7V5H/gEzJxUPdo/ZhRcBCF6G6RNlMs7/5xxyY7C5QB 6qbw== X-Forwarded-Encrypted: i=1; AJvYcCV+pIPoG4+Qs/qUM91TkAxhmtqgpZdVoUEat3jOyI4fy8anZ8syacf6PiByzWm9V1JZRWfmRt+sFOdt4w==@vger.kernel.org X-Gm-Message-State: AOJu0Ywnyhxe8vL8vlG0yyftdvaCewnRmwmtoehjSIzvBxuwda5YYxiI AyfACWRK7dyk+Bbv4M5wjNwatdI9cjamZHzUsIZpgPk2cg4NVDSOWur1lm30KyOPMoP7yedleBK R X-Google-Smtp-Source: AGHT+IFNo+U6H0njqtK5FYf7X4oDFyjmGEpzlRSMX+ycejfBh12MlSOr41SNUtIdm7WPwSAjc412zg== X-Received: by 2002:a17:907:d8f:b0:a7a:b781:60ed with SMTP id a640c23a62f3a-a89a35a1159mr655497466b.17.1725287280917; Mon, 02 Sep 2024 07:28:00 -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-a8989222fa8sm565950366b.213.2024.09.02.07.28.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Sep 2024 07:28:00 -0700 (PDT) From: Martin Wilck X-Google-Original-From: Martin Wilck To: Shin'ichiro Kawasaki , Nilay Shroff , Daniel Wagner Cc: Chaitanya Kulkarni , Hannes Reinecke , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Martin Wilck Subject: [PATCH v3 3/3] nvme: add test for controller rescan under I/O load Date: Mon, 2 Sep 2024 16:27:47 +0200 Message-ID: <20240902142748.65779-3-mwilck@suse.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902142748.65779-1-mwilck@suse.com> References: <20240902142748.65779-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 Reviewed-by: Nilay Shroff (nilay@linux.ibm.com) --- 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 | 74 ++++++++++++++++++++++++++++++++++++++++++++++ tests/nvme/053.out | 2 ++ tests/nvme/rc | 18 +++++++++++ 3 files changed, 94 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..df643ec --- /dev/null +++ b/tests/nvme/053 @@ -0,0 +1,74 @@ +#!/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 + + echo "Running ${TEST_NAME}" + create_rescan_script + + mapfile -t ctrls < <(_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