From patchwork Wed Mar 29 09:01:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13192182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BA8AC74A5B for ; Wed, 29 Mar 2023 09:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbjC2JCu (ORCPT ); Wed, 29 Mar 2023 05:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbjC2JCk (ORCPT ); Wed, 29 Mar 2023 05:02:40 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0582F423E for ; Wed, 29 Mar 2023 02:02:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 18E001FDEE; Wed, 29 Mar 2023 09:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1680080525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3DgnundXw3/fWoRWwwxsBqOoYOOJIiKIHvv0PtfL9Cg=; b=agi/1BkpWD2l1Qyo1c2qv3YaQts4+RLvve+8UPQ8bhiKa9Of0fLDzivj5lU1kuc3PnWs+W NoC0xNzkpBj6YyZjFEaxhZ8+vFgDwB/MumYkRF0pzE/TfUzbuNCSYXdWhXS7kzEGp506gy uJB2hoyQCkYRfmZQpmewBrGjPgO5Rrk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1680080525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3DgnundXw3/fWoRWwwxsBqOoYOOJIiKIHvv0PtfL9Cg=; b=5ColjjWeDLLqbxU6XSf6fRh/362uPmUe3bknNlRlEs9n2SV20dlGtuo1l13BaX8QvmitcB 5LRomWgFqqomUnDg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 09FF3138FF; Wed, 29 Mar 2023 09:02:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4rtdAo3+I2RUdgAAMHmgww (envelope-from ); Wed, 29 Mar 2023 09:02:05 +0000 From: Daniel Wagner To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Shin'ichiro Kawasaki , Chaitanya Kulkarni , Keith Busch , Daniel Wagner Subject: [PATCH blktests v3 1/4] nvme/rc: Parse optional arguments in _nvme_connect_subsys() Date: Wed, 29 Mar 2023 11:01:59 +0200 Message-Id: <20230329090202.8351-2-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230329090202.8351-1-dwagner@suse.de> References: <20230329090202.8351-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Extend the nvme_connect_subsys() function to parse optional arguments. This avoids that all test have to pass in always all arguments. Signed-off-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni --- tests/nvme/041 | 7 ++++-- tests/nvme/042 | 10 +++++---- tests/nvme/043 | 10 +++++---- tests/nvme/044 | 23 ++++++++++++------- tests/nvme/045 | 6 +++-- tests/nvme/rc | 61 ++++++++++++++++++++++++++++++++++++++++++-------- 6 files changed, 88 insertions(+), 29 deletions(-) diff --git a/tests/nvme/041 b/tests/nvme/041 index 8ffcf13a500a..03e2dab25918 100755 --- a/tests/nvme/041 +++ b/tests/nvme/041 @@ -55,14 +55,17 @@ test() { # Test unauthenticated connection (should fail) echo "Test unauthenticated connection (should fail)" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" _nvme_disconnect_subsys "${subsys_name}" # Test authenticated connection echo "Test authenticated connection" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle diff --git a/tests/nvme/042 b/tests/nvme/042 index d581bce4a9ee..4ad726f72f5a 100755 --- a/tests/nvme/042 +++ b/tests/nvme/042 @@ -58,8 +58,9 @@ test() { _set_nvmet_hostkey "${hostnqn}" "${hostkey}" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle _nvme_disconnect_subsys "${subsys_name}" @@ -75,8 +76,9 @@ test() { _set_nvmet_hostkey "${hostnqn}" "${hostkey}" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle diff --git a/tests/nvme/043 b/tests/nvme/043 index c8ce292ba2e7..c031cecf34a5 100755 --- a/tests/nvme/043 +++ b/tests/nvme/043 @@ -56,8 +56,9 @@ test() { _set_nvmet_hash "${hostnqn}" "${hash}" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle @@ -71,8 +72,9 @@ test() { _set_nvmet_dhgroup "${hostnqn}" "${dhgroup}" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle diff --git a/tests/nvme/044 b/tests/nvme/044 index c19a9c026711..f2406ecadf7d 100755 --- a/tests/nvme/044 +++ b/tests/nvme/044 @@ -66,8 +66,9 @@ test() { # Step 1: Connect with host authentication only echo "Test host authentication" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" udevadm settle @@ -77,8 +78,10 @@ test() { # and invalid ctrl authentication echo "Test invalid ctrl authentication (should fail)" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" "${hostkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" \ + --dhchap-ctrl-secret "${hostkey}" udevadm settle @@ -88,8 +91,10 @@ test() { # and valid ctrl authentication echo "Test valid ctrl authentication" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" "${ctrlkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" \ + --dhchap-ctrl-secret "${ctrlkey}" udevadm settle @@ -100,8 +105,10 @@ test() { echo "Test invalid ctrl key (should fail)" invkey="DHHC-1:00:Jc/My1o0qtLCWRp+sHhAVafdfaS7YQOMYhk9zSmlatobqB8C:" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" "${invkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" \ + --dhchap-ctrl-secret "${invkey}" udevadm settle diff --git a/tests/nvme/045 b/tests/nvme/045 index a0e6e93ed3c7..612e5f168e3c 100755 --- a/tests/nvme/045 +++ b/tests/nvme/045 @@ -65,8 +65,10 @@ test() { _set_nvmet_dhgroup "${hostnqn}" "ffdhe2048" _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ - "" "" "${hostnqn}" "${hostid}" \ - "${hostkey}" "${ctrlkey}" + --hostnqn "${hostnqn}" \ + --hostid "${hostid}" \ + --dhchap-secret "${hostkey}" \ + --dhchap-ctrl-secret "${ctrlkey}" udevadm settle diff --git a/tests/nvme/rc b/tests/nvme/rc index 210a82aea384..20c5e2fa32cb 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -316,15 +316,58 @@ _nvme_disconnect_subsys() { } _nvme_connect_subsys() { - local trtype="$1" - local subsysnqn="$2" - local traddr="${3:-$def_traddr}" - local host_traddr="${4:-$def_host_traddr}" - local trsvcid="${4:-$def_trsvcid}" - local hostnqn="${5:-$def_hostnqn}" - local hostid="${6:-$def_hostid}" - local hostkey="${7}" - local ctrlkey="${8}" + local positional_args=() + local trtype="" + local subsysnqn="" + local traddr="$def_traddr" + local host_traddr="$def_host_traddr" + local trsvcid="$def_trsvcid" + local hostnqn="$def_hostnqn" + local hostid="$def_hostid" + local hostkey="" + local ctrlkey="" + + while [[ $# -gt 0 ]]; do + case $1 in + -a|--traddr) + traddr="$2" + shift 2 + ;; + -w|--host-traddr) + host_traddr="$2" + shift 2 + ;; + -s|--trsvcid) + trsvcid="$2" + shift 2 + ;; + -n|--hostnqn) + hostnqn="$2" + shift 2 + ;; + -I|--hostid) + hostid="$2" + shift 2 + ;; + -S|--dhchap-secret) + hostkey="$2" + shift 2 + ;; + -C|--dhchap-ctrl-secret) + ctrlkey="$2" + shift 2 + ;; + *) + positional_args+=("$1") + shift + ;; + esac + done + + set -- "${positional_args[@]}" + + trtype="$1" + subsysnqn="$2" ARGS=(-t "${trtype}" -n "${subsysnqn}") if [[ "${trtype}" == "fc" ]] ; then From patchwork Wed Mar 29 09:02:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13192181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF651C6FD18 for ; Wed, 29 Mar 2023 09:02:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbjC2JCt (ORCPT ); Wed, 29 Mar 2023 05:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbjC2JCj (ORCPT ); Wed, 29 Mar 2023 05:02:39 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05AA84688 for ; Wed, 29 Mar 2023 02:02:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B0DF5219E8; Wed, 29 Mar 2023 09:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1680080525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AHWeEdeCHqqBY/im3wOsoSiaR35kDE0egEtQWNVv+UU=; b=MvboyGO1sjp5ugq7nwvlVnGSATJdntH5Q88kFfCRexau2+W+mPLk4QvsbhFz+FOeFvaPIg 4t8iRnkJHwVzzQKvsIAHJGcRxnAaQZHLmwIFi13KT1I2iJatr4y3pxls3km44O6pFaUin6 LibQr0DY4rdHLbh3AqH6CMQI7Jo7Evc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1680080525; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AHWeEdeCHqqBY/im3wOsoSiaR35kDE0egEtQWNVv+UU=; b=/r8Rvlop8Vi5Xgjf1Iip7RPw/CU2MotfIXO5LC1UjKnodXdzY0GHr38UXDyp56UIHAZE2k 7GPSIICktVoXFEBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A326B138FF; Wed, 29 Mar 2023 09:02:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 8m+qJ43+I2RadgAAMHmgww (envelope-from ); Wed, 29 Mar 2023 09:02:05 +0000 From: Daniel Wagner To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Shin'ichiro Kawasaki , Chaitanya Kulkarni , Keith Busch , Daniel Wagner Subject: [PATCH blktests v3 2/4] nvme/rc: Add nr queue parser arguments to _nvme_connect_subsys() Date: Wed, 29 Mar 2023 11:02:00 +0200 Message-Id: <20230329090202.8351-3-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230329090202.8351-1-dwagner@suse.de> References: <20230329090202.8351-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni --- tests/nvme/rc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/nvme/rc b/tests/nvme/rc index 20c5e2fa32cb..c1bb08be511a 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -326,6 +326,9 @@ _nvme_connect_subsys() { local hostid="$def_hostid" local hostkey="" local ctrlkey="" + local nr_io_queues="" + local nr_write_queues="" + local nr_poll_queues="" while [[ $# -gt 0 ]]; do case $1 in @@ -357,6 +360,18 @@ _nvme_connect_subsys() { ctrlkey="$2" shift 2 ;; + -i|--nr-io-queues) + nr_io_queues="$2" + shift 2 + ;; + -W|--nr-write-queues) + nr_write_queues="$2" + shift 2 + ;; + -P|--nr-poll-queues) + nr_poll_queues="$2" + shift 2 + ;; *) positional_args+=("$1") shift @@ -387,6 +402,16 @@ _nvme_connect_subsys() { if [[ -n "${ctrlkey}" ]]; then ARGS+=(--dhchap-ctrl-secret="${ctrlkey}") fi + if [[ -n "${nr_io_queues}" ]]; then + ARGS+=(--nr-io-queues="${nr_io_queues}") + fi + if [[ -n "${nr_write_queues}" ]]; then + ARGS+=(--nr-write-queues="${nr_write_queues}") + fi + if [[ -n "${nr_poll_queues}" ]]; then + ARGS+=(--nr-poll-queues="${nr_poll_queues}") + fi + nvme connect "${ARGS[@]}" 2> /dev/null } From patchwork Wed Mar 29 09:02:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13192180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21E8FC761A6 for ; Wed, 29 Mar 2023 09:02:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229991AbjC2JCt (ORCPT ); Wed, 29 Mar 2023 05:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbjC2JCi (ORCPT ); Wed, 29 Mar 2023 05:02:38 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05B67468B for ; Wed, 29 Mar 2023 02:02:07 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5A3511FDF3; Wed, 29 Mar 2023 09:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1680080526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jk3PG6dsDOaMBSt9to7fTwjCmC0NKhIOpn13Uj2Vb90=; b=HCs1XiXy1XZft0Nw2Qd+IA/J+g31khMYoMuZPzQwqM/ioKZdF8BWvYCYZ/PLbggj5gL53v JDawbF7FHsr1wkKQL8tghoJrK8zO+6Goy7CkDqXahZbzS9eKdfyMFcV/jGCwjI0S1Ei3kh shvdtN+9bWB3elT5q7XbY56YthQt/30= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1680080526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jk3PG6dsDOaMBSt9to7fTwjCmC0NKhIOpn13Uj2Vb90=; b=pSXi2vDw5NKtwrk5OPMUJbmGA+F3uBM1Jgq1ez3J6AgqBbCbMeticYqPuW1HT0FhA0JpO7 NiNtg3QQL/QDJGDw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4DA2C138FF; Wed, 29 Mar 2023 09:02:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Aa7UEo7+I2RcdgAAMHmgww (envelope-from ); Wed, 29 Mar 2023 09:02:06 +0000 From: Daniel Wagner To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Shin'ichiro Kawasaki , Chaitanya Kulkarni , Keith Busch , Daniel Wagner Subject: [PATCH blktests v3 3/4] nvme/rc: Add parametric transport required check Date: Wed, 29 Mar 2023 11:02:01 +0200 Message-Id: <20230329090202.8351-4-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230329090202.8351-1-dwagner@suse.de> References: <20230329090202.8351-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Not all transport support the same features thus we need to be able to express this. Add a transport require check which can be runtime parameterized. While at it also update the existing helpers to test for trtype to with an explicit list of transport types. Signed-off-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni --- tests/nvme/rc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/nvme/rc b/tests/nvme/rc index c1bb08be511a..a3c9b42d91e6 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -93,17 +93,26 @@ _require_test_dev_is_nvme() { return 0 } +_require_nvme_trtype() { + local trtype + for trtype in "$@"; do + if [[ "${nvme_trtype}" == "$trtype" ]]; then + return 0 + fi + done + SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test") + return 1 +} + _require_nvme_trtype_is_loop() { - if [[ "${nvme_trtype}" != "loop" ]]; then - SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test") + if ! _require_nvme_trtype loop; then return 1 fi return 0 } _require_nvme_trtype_is_fabrics() { - if [[ "${nvme_trtype}" == "pci" ]]; then - SKIP_REASONS+=("nvme_trtype=${nvme_trtype} is not supported in this test") + if ! _require_nvme_trtype loop fc rdma tcp; then return 1 fi return 0 From patchwork Wed Mar 29 09:02:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 13192184 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05ACAC74A5B for ; Wed, 29 Mar 2023 09:03:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230461AbjC2JDA (ORCPT ); Wed, 29 Mar 2023 05:03:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbjC2JC4 (ORCPT ); Wed, 29 Mar 2023 05:02:56 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5309423C for ; Wed, 29 Mar 2023 02:02:29 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EC24F219E2; Wed, 29 Mar 2023 09:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1680080526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fJ2cMbhE9n5GVfjaaGV9CfBtF0MZY0yHt+5KA5Ek/K8=; b=wt4lcub9Q2fxfLOgnKlzF2te93wLF4PrvBYjAYeajGP2cMQHvpmL9zhBPm5siC0pm3EunV DPn/+hY38lsMsjDO5pv7lyJETsUgExIjICUvRI3OVzUOgfPJIzmfZL2F2FzqL6NPs5nBL6 zokFEN63RMGv/ZLWpLefCQqlmJdk+pU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1680080526; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fJ2cMbhE9n5GVfjaaGV9CfBtF0MZY0yHt+5KA5Ek/K8=; b=neBq5m714jPJ9FH3U4VL6O8HMo4Qys+ERYB2kH3ITQJ8eF7xvLIn3XfSE2LU+BcCA9LFQJ ljoyn3vVgE6dc9Dw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DD298138FF; Wed, 29 Mar 2023 09:02:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Ne33NY7+I2RgdgAAMHmgww (envelope-from ); Wed, 29 Mar 2023 09:02:06 +0000 From: Daniel Wagner To: linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Shin'ichiro Kawasaki , Chaitanya Kulkarni , Keith Busch , Daniel Wagner Subject: [PATCH blktests v3 4/4] nvme/047: Test different queue types for fabrics transports Date: Wed, 29 Mar 2023 11:02:02 +0200 Message-Id: <20230329090202.8351-5-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230329090202.8351-1-dwagner@suse.de> References: <20230329090202.8351-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Test if the fabrics transports are handling different queues types correctly. Currently, only TCP and RDMA from the fabric transport family support this feature, so limit the test to these two. We also issue some I/O to make sure that not just the plain connect works. For this we have to use a file system which supports direct I/O and hence we use a device backend. Signed-off-by: Daniel Wagner Reviewed-by: Chaitanya Kulkarni --- tests/nvme/047 | 66 ++++++++++++++++++++++++++++++++++++++++++++++ tests/nvme/047.out | 2 ++ 2 files changed, 68 insertions(+) create mode 100755 tests/nvme/047 create mode 100644 tests/nvme/047.out diff --git a/tests/nvme/047 b/tests/nvme/047 new file mode 100755 index 000000000000..d56d3be185b0 --- /dev/null +++ b/tests/nvme/047 @@ -0,0 +1,66 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2023 SUSE LLC +# +# Test if the fabrics transports are handling different queues types correctly. + +. tests/nvme/rc +. common/xfs + +DESCRIPTION="test different queue types for fabric transports" + +requires() { + _nvme_requires + _have_xfs + _have_fio + _require_nvme_trtype tcp rdma + _have_kver 4 21 +} + +test() { + echo "Running ${TEST_NAME}" + + _setup_nvmet + + local port + local nvmedev + local loop_dev + local file_path="$TMPDIR/img" + local subsys_name="blktests-subsystem-1" + + truncate -s 512M "${file_path}" + + loop_dev="$(losetup -f --show "${file_path}")" + + _create_nvmet_subsystem "${subsys_name}" "${loop_dev}" \ + "91fdba0d-f87b-4c25-b80f-db7be1418b9e" + port="$(_create_nvmet_port "${nvme_trtype}")" + _add_nvmet_subsys_to_port "${port}" "${subsys_name}" + + _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ + --nr-write-queues 1 || echo FAIL + + nvmedev=$(_find_nvme_dev "${subsys_name}") + + _xfs_run_fio_verify_io /dev/"${nvmedev}n1" "1m" || echo FAIL + + _nvme_disconnect_subsys "${subsys_name}" >> "$FULL" 2>&1 + + _nvme_connect_subsys "${nvme_trtype}" "${subsys_name}" \ + --nr-write-queues 1 \ + --nr-poll-queues 1 || echo FAIL + + _xfs_run_fio_verify_io /dev/"${nvmedev}n1" "1m" || echo FAIL + + _nvme_disconnect_subsys "${subsys_name}" >> "$FULL" 2>&1 + + _remove_nvmet_subsystem_from_port "${port}" "${subsys_name}" + _remove_nvmet_subsystem "${subsys_name}" + _remove_nvmet_port "${port}" + + losetup -d "${loop_dev}" + + rm "${file_path}" + + echo "Test complete" +} diff --git a/tests/nvme/047.out b/tests/nvme/047.out new file mode 100644 index 000000000000..915d0a2389ca --- /dev/null +++ b/tests/nvme/047.out @@ -0,0 +1,2 @@ +Running nvme/047 +Test complete