Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp505155rwr; Wed, 3 May 2023 01:48:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6w1V/cYiLqHxCBKzBd3DnWnWXD+Fd3t3mjI8OyaJppHtbVk2N/HZs2tPCGWD9GsVZMv5jG X-Received: by 2002:a05:6a20:c59d:b0:fb:c35a:2a81 with SMTP id gn29-20020a056a20c59d00b000fbc35a2a81mr4294546pzb.54.1683103687450; Wed, 03 May 2023 01:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683103687; cv=none; d=google.com; s=arc-20160816; b=cV1so2DbtQoYNyiQA1FvdqAwcvacosTHGSwzMGB1UlRgAac6S2t+EW057mEaDTotuy Y1H5+0OB53RwUJxb4NtiHfZuSCwf8ml901wxolznrb8eMxj1ISR5iZUsGwygvd/nzs2l 5U7hiNEiqDq9nO3rtbc4UW3Iy+mHZFZP36dUH4lN2dIMfOfzi1jA4GBU/bgYxApN1XDg oUA+lQR7yRlOBAZj18jD72H6uPhVo6N92J4EQEN4MdfBPqvv6L3hRfhF55cn4lj9MVQY h12H/nCszTar2t1jQhVQtl1HjK8OreAd7+d2idX+O70d8my4od+RMPf69BcnOH3hPE1F uIDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=1K7B1ulTvYgPG7Sie5nMsi4gf4h2tfGpVQJI7Dvefpg=; b=W5XTZocCxEk1HwvRkpc7rkL0sxoEnfpg6bimZvmyM6VuTFPVNgVPEikuaaOJpKKSOf 6tuWX7Mh5jUIirUyWejmzyJocwM+lvejUJbf6G6AEyRNT+0Fjr0SQ8nVusNbUwx/shIO naOfri734oCu7P7bpqS40pjZVZPMO2vuWzmuXDHNrgMibEuZfuTvLm8Z0wV/j2eqEzVT idWQWWEivovY5LP7aF1e8RKmjZWjyDfMJoJ0OrnSH1rrd/JcYHbZCRf0g6oBqi66pkPR Z3ueknvpyCcjdS7k6U3yjuR9lE4cWNnm5p9z9r1dkiZnSqMRbIMi3b8gvoWz2eWX+XSi 0Jeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=XIXDrIli; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a63e04c000000b00502f0d858e9si33323993pgj.174.2023.05.03.01.47.53; Wed, 03 May 2023 01:48:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=XIXDrIli; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbjECIkH (ORCPT + 99 others); Wed, 3 May 2023 04:40:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbjECIjc (ORCPT ); Wed, 3 May 2023 04:39:32 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69373524F; Wed, 3 May 2023 01:39:08 -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 511E02246F; Wed, 3 May 2023 08:38:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1683103100; 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=1K7B1ulTvYgPG7Sie5nMsi4gf4h2tfGpVQJI7Dvefpg=; b=XIXDrIli9pt2V82t801AL6ofsvdrmgk5MOQRGziqjipJ6gsLBnzlXuQJ2RQGnFI1whska4 dq0VPixIH5VqZY6Q+tnmkSufhSWthnDa9HQLat9Cc+YofgDlO0kF7Y1Wbaph1unYEWa8ds 3NqmKYxfCqyzRtBXIf+2NtOqC4GDb6Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1683103100; 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=1K7B1ulTvYgPG7Sie5nMsi4gf4h2tfGpVQJI7Dvefpg=; b=QUr0MSESnCfRUDUbjDlYjtBOkz69rCIadklZK/oE4PQUcF5U2GWnexHAtz54vdgZTP/1ZA OJLkAExOz8XEGUBw== 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 43908139F8; Wed, 3 May 2023 08:38:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Uvp7EHwdUmS5dQAAMHmgww (envelope-from ); Wed, 03 May 2023 08:38:20 +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 , Daniel Wagner Subject: [PATCH blktests v3 2/2] nvme/rc: Cleanup fc resource before module unloading Date: Wed, 3 May 2023 10:38:16 +0200 Message-Id: <20230503083816.18792-3-dwagner@suse.de> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230503083816.18792-1-dwagner@suse.de> References: <20230503083816.18792-1-dwagner@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cleanup all fc resources before unloading the module, so it the operations are in reverse order how we setup them. Also unload the nvme-fcloop after usage. Signed-off-by: Daniel Wagner --- tests/nvme/rc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/nvme/rc b/tests/nvme/rc index ec0cc2d8d8cc..24803afe8879 100644 --- a/tests/nvme/rc +++ b/tests/nvme/rc @@ -260,6 +260,11 @@ _cleanup_nvmet() { shopt -u nullglob trap SIGINT + if [[ "${nvme_trtype}" == "fc" ]]; then + _cleanup_fcloop "${def_local_wwnn}" "${def_local_wwpn}" \ + "${def_remote_wwnn}" "${def_remote_wwpn}" + modprobe -rq nvme-fcloop + fi modprobe -rq nvme-"${nvme_trtype}" 2>/dev/null if [[ "${nvme_trtype}" != "loop" ]]; then modprobe -rq nvmet-"${nvme_trtype}" 2>/dev/null @@ -268,10 +273,6 @@ _cleanup_nvmet() { if [[ "${nvme_trtype}" == "rdma" ]]; then stop_soft_rdma fi - if [[ "${nvme_trtype}" == "fc" ]]; then - _cleanup_fcloop "${def_local_wwnn}" "${def_local_wwpn}" \ - "${def_remote_wwnn}" "${def_remote_wwpn}" - fi } _setup_nvmet() { -- 2.40.0