From patchwork Tue Jun 20 13:27: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: 13285867 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 5D0A3EB64D8 for ; Tue, 20 Jun 2023 13:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232463AbjFTN1U (ORCPT ); Tue, 20 Jun 2023 09:27:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231225AbjFTN1T (ORCPT ); Tue, 20 Jun 2023 09:27:19 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8DD1B4; Tue, 20 Jun 2023 06:27:18 -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 7156921846; Tue, 20 Jun 2023 13:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687267637; 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=xdu4SLeXRX96eYJIkjFLNcHQfvWSCAFCqgoWIOGzVEU=; b=VpHAssbZ6FRo5bahpfqMn2JLtxTsbdwQg8XiNVzAWn97FXnm2W4DQ0d0Ut+s3zkXWwPh9+ jtUimsqy1R29joc6RPnp3JJmhuwmybTMHTgD/yOAeKdyCcYoUEON9FxV4TQ5EA8R1kYDvZ p+wheu/EeNaK0wnzNf7kARKfnfjwCnY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687267637; 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=xdu4SLeXRX96eYJIkjFLNcHQfvWSCAFCqgoWIOGzVEU=; b=KX02MQlMHQWX8D3ST42NL2EOoRv3f2X0aZYichzWCZ1f8zSFb8mwk5+Uwc6XodYr/je8+R 65J8aSgfNXeRXSCA== 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 6370B1346D; Tue, 20 Jun 2023 13:27:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id YfhCGDWpkWSdOAAAMHmgww (envelope-from ); Tue, 20 Jun 2023 13:27:17 +0000 From: Daniel Wagner To: linux-nvme@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Sagi Grimberg , Hannes Reinecke , James Smart , Martin Belanger , Daniel Wagner Subject: [PATCH blktests v1 1/3] nvme/048: Check for queue count check directly Date: Tue, 20 Jun 2023 15:27:01 +0200 Message-ID: <20230620132703.20648-2-dwagner@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230620132703.20648-1-dwagner@suse.de> References: <20230620132703.20648-1-dwagner@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The test monitored the state changes live -> resetting -> connecting -> live, to figure out the queue count change was successful. The fc transport is reconnecting very fast and the state transitions are not observed by the current approach. So instead trying to monitor the state changes, let's just wait for the live state and the correct queue number. As queue count is depending on the number of online CPUs we explicitly use 1 and 2 for the max_queue count. This means the queue_count value needs to reach either 2 or 3 (admin queue included). Signed-off-by: Daniel Wagner --- tests/nvme/048 | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/tests/nvme/048 b/tests/nvme/048 index 81084f0440c2..3dc5169132de 100755 --- a/tests/nvme/048 +++ b/tests/nvme/048 @@ -42,6 +42,26 @@ nvmf_wait_for_state() { return 0 } +nvmf_wait_for_queue_count() { + local subsys_name="$1" + local queue_count="$2" + local nvmedev + + nvmedev=$(_find_nvme_dev "${subsys_name}") + + queue_count_file="/sys/class/nvme-fabrics/ctl/${nvmedev}/queue_count" + + nvmf_wait_for_state "${subsys_name}" "live" || return 1 + + queue_count=$((queue_count + 1)) + if grep -q "${queue_count}" "${queue_count_file}"; then + return 0 + fi + + echo "expected queue count ${queue_count} not set" + return 1 +} + set_nvmet_attr_qid_max() { local nvmet_subsystem="$1" local qid_max="$2" @@ -56,10 +76,7 @@ set_qid_max() { local qid_max="$3" set_nvmet_attr_qid_max "${subsys_name}" "${qid_max}" - - # Setting qid_max forces a disconnect and the reconntect attempt starts - nvmf_wait_for_state "${subsys_name}" "connecting" || return 1 - nvmf_wait_for_state "${subsys_name}" "live" || return 1 + nvmf_wait_for_queue_count "${subsys_name}" "${qid_max}" || return 1 return 0 } @@ -77,12 +94,8 @@ test() { _setup_nvmet - hostid="$(uuidgen)" - if [ -z "$hostid" ] ; then - echo "uuidgen failed" - return 1 - fi - hostnqn="nqn.2014-08.org.nvmexpress:uuid:${hostid}" + hostid="${def_hostid}" + hostnqn="${def_hostnqn}" truncate -s "${nvme_img_size}" "${file_path}" @@ -103,7 +116,7 @@ test() { echo FAIL else set_qid_max "${port}" "${subsys_name}" 1 || echo FAIL - set_qid_max "${port}" "${subsys_name}" 128 || echo FAIL + set_qid_max "${port}" "${subsys_name}" 2 || echo FAIL fi _nvme_disconnect_subsys "${subsys_name}"