Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp733099rwp; Wed, 12 Jul 2023 23:22:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlGxiBSNscVnz9DvKLcBXjNAvrFudXXKZ+GNyRuL8NL9YQRIn2eTvfvt43imbT7Ii/VgP+9P X-Received: by 2002:a54:4f93:0:b0:3a3:f45b:aa3d with SMTP id g19-20020a544f93000000b003a3f45baa3dmr953719oiy.39.1689229349747; Wed, 12 Jul 2023 23:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689229349; cv=none; d=google.com; s=arc-20160816; b=PPrv5otlzzQPnt6vJHyg2jHOwHqztViMDo4qq2Xzg5qmiqEudwbj5PzqOmTtbTm5pB DT17Xj/GAKN9Z9uGnKhOTtACKczz+IHGZsFK6Zt6eHN7h8C0LawYdPYpoqJ3YuYlpvwS 9UsFad5qfadittzhRhUb+5R7VXA9+i60lLBF28CjDVLyb6fdwt3f+Mb5kGksmxbGyIPU CckCRKnKiujjv5VuBYSalDX/aR482kp4OXKU8Amm4/seFWD/ZR5VKqjV6wYlaQm4u+93 eqhh+2u2UnEKdZ6wdZmFW5iUlV+YIFkNXNSu8n2znjVRu3e5rWRCCmGWkpgQyv3ws78b AUjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=hsg1G5joSPJI39OwuWt4sG6XYjzgYlB2WIUDA6Hfziw=; fh=nY9nAdwnymC6nGrRmwBP7XIrKg9TgbzuO0TeoemeQeU=; b=auiDiYMlcmPEqRvsVuSU7x7GWS3Zd3rSu4i39eGtN7Clr4x+78YGCJ+tg4HIxaymiz c9Gjc3DGYY+Jb0/5kq0AZat/js/etT5lhqQqTb+ZklNOIm63xXEU67n/M7Y9/MnkHGMv s5ynobZbWfeYY4+lfkin7kLV38USh4t43iZWLMfmctciCO7rYrEO38ICnDIXSrW4bhv0 44espvWAif36mIP8eZ2K/vgWXbWEjc4mSKWnMp0NJV0cIzQ31bD8QjTuY4cG8x60+AYr dReJp7gNckTzrngWolHfuLXu7/rwcrnXn+Xi52jGoaF8hqp9Rns7knm1pTvaTseErN73 JWXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="h/k4GM0B"; dkim=neutral (no key) header.i=@suse.de header.b=6p00FFMz; 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 c5-20020aa78805000000b0066e608447d4si4471772pfo.102.2023.07.12.23.22.12; Wed, 12 Jul 2023 23:22:29 -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="h/k4GM0B"; dkim=neutral (no key) header.i=@suse.de header.b=6p00FFMz; 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 S233867AbjGMGAh (ORCPT + 99 others); Thu, 13 Jul 2023 02:00:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232430AbjGMGAf (ORCPT ); Thu, 13 Jul 2023 02:00:35 -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 09E831FDE; Wed, 12 Jul 2023 23:00:34 -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 50B3322205; Thu, 13 Jul 2023 06:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689228031; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hsg1G5joSPJI39OwuWt4sG6XYjzgYlB2WIUDA6Hfziw=; b=h/k4GM0Bw0b1rZ3bHgXzM3qAgQ+iMIvhchdQEtHxKXkvOxvrPeytyE6EySvB/17uJzFTAr yTFy7eln71yVzOrrF6xVZt+k/vTZAg81FYq19dAis7ePaArW8m7tH4qWLAmeW3bczQz+uK Pwo+M2lRFbQkdC1FXqFxMN4WDIJ0lD4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689228031; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hsg1G5joSPJI39OwuWt4sG6XYjzgYlB2WIUDA6Hfziw=; b=6p00FFMzv6Z/xSs4pTs2QI5obAK2fFt5cbNGOz6BaCSMXwWU7bjf5g5u0p1aRJYXl/Q+DO Ca1UXh/rDTqZyBCQ== 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 AD5791390D; Thu, 13 Jul 2023 06:00:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CUuCKP6Sr2QaNgAAMHmgww (envelope-from ); Thu, 13 Jul 2023 06:00:30 +0000 Message-ID: <95210a8a-c70e-c312-2c47-4f5ee9329586@suse.de> Date: Thu, 13 Jul 2023 08:00:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH blktests v1 2/3] nvme/rc: Avoid triggering host nvme-cli autoconnect Content-Language: en-US To: Max Gurtovoy , Daniel Wagner Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Chaitanya Kulkarni , Shin'ichiro Kawasaki , Sagi Grimberg , James Smart , Martin Belanger References: <20230620132703.20648-1-dwagner@suse.de> <20230620132703.20648-3-dwagner@suse.de> <9c07e4f6-2cf5-b53b-6b48-bd4df8798ee9@nvidia.com> <39f9977e-b34c-f2dd-d356-8c78414a60d1@nvidia.com> <972a06e0-6841-043e-fc00-db7596f664c4@nvidia.com> <6dced1ba-c468-c88e-f861-9c202e803894@nvidia.com> <6fa5ec73-e6c6-cf8e-b11f-1a57f0fc34b4@nvidia.com> From: Hannes Reinecke In-Reply-To: <6fa5ec73-e6c6-cf8e-b11f-1a57f0fc34b4@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 7/13/23 02:12, Max Gurtovoy wrote: > > > On 12/07/2023 15:04, Daniel Wagner wrote: >> On Mon, Jul 10, 2023 at 07:30:20PM +0300, Max Gurtovoy wrote: >>> >>> >>> On 10/07/2023 18:03, Daniel Wagner wrote: >>>> On Mon, Jul 10, 2023 at 03:31:23PM +0300, Max Gurtovoy wrote: >>>>> I think it is more than just commit message. >>>> >>>> Okay, starting to understand what's the problem. >>>> >>>>> A lot of code that we can avoid was added regarding the --context >>>>> cmdline >>>>> argument. >>>> >>>> Correct and it's not optional to get the tests passing for the fc >>>> transport. >>> >>> why the fc needs the --context to pass tests ? >> >> A typical nvme test consists out of following steps (nvme/004): >> >> // nvme target setup (1) >>     _create_nvmet_subsystem "blktests-subsystem-1" "${loop_dev}" \ >>         "91fdba0d-f87b-4c25-b80f-db7be1418b9e" >>     _add_nvmet_subsys_to_port "${port}" "blktests-subsystem-1" >> >> // nvme host setup (2) >>     _nvme_connect_subsys "${nvme_trtype}" blktests-subsystem-1 >> >>     local nvmedev >>     nvmedev=$(_find_nvme_dev "blktests-subsystem-1") >>     cat "/sys/block/${nvmedev}n1/uuid" >>     cat "/sys/block/${nvmedev}n1/wwid" >> >> // nvme host teardown (3) >>     _nvme_disconnect_subsys blktests-subsystem-1 >> >> // nvme target teardown (4) >>     _remove_nvmet_subsystem_from_port "${port}" "blktests-subsystem-1" >>     _remove_nvmet_subsystem "blktests-subsystem-1" >> >> >> The corresponding output with --context >> >>   run blktests nvme/004 at 2023-07-12 13:49:50 >> // (1) >>   loop0: detected capacity change from 0 to 32768 >>   nvmet: adding nsid 1 to subsystem blktests-subsystem-1 >>   nvme nvme2: NVME-FC{0}: create association : host wwpn >> 0x20001100aa000002  rport wwpn 0x20001100aa000001: NQN >> "blktests-subsystem-1" >>   (NULL device *): {0:0} Association created >>   [174] nvmet: ctrl 1 start keep-alive timer for 5 secs >> // (2) >>   nvmet: creating nvm controller 1 for subsystem blktests-subsystem-1 >> for NQN >> nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349. >>   [374] nvmet: adding queue 1 to ctrl 1. >>   [1138] nvmet: adding queue 2 to ctrl 1. >>   [73] nvmet: adding queue 3 to ctrl 1. >>   [174] nvmet: adding queue 4 to ctrl 1. >>   nvme nvme2: NVME-FC{0}: controller connect complete >>   nvme nvme2: NVME-FC{0}: new ctrl: NQN "blktests-subsystem-1" >> // (3) >>   nvme nvme2: Removing ctrl: NQN "blktests-subsystem-1" >> // (4) >>   [1138] nvmet: ctrl 1 stop keep-alive >>   (NULL device *): {0:0} Association deleted >>   (NULL device *): {0:0} Association freed >>   (NULL device *): Disconnect LS failed: No Association >> >> >> and without --context >> >>   run blktests nvme/004 at 2023-07-12 13:50:33 >> // (1) >>   loop1: detected capacity change from 0 to 32768 >>   nvmet: adding nsid 1 to subsystem blktests-subsystem-1 >>   nvme nvme2: NVME-FC{0}: create association : host wwpn >> 0x20001100aa000002  rport wwpn 0x20001100aa000001: NQN >> "nqn.2014-08.org.nvmexpress.discovery" > > why does this association to discovery controller created ? because of > some system service ? > Yes. There are nvme-autoconnect udev rules and systemd services installed per default (in quite some systems now). And it's really hard (if not impossible) to disable these services (as we cannot be sure how they are named, hence we wouldn't know which service to disable. > can we configure the blktests subsystem not to be discovered or add some > access list to it ? > But that's precisely what the '--context' thing is attempting to do ... [ .. ] >>>> >>>> It really solves the problem that the autoconnect setup of nvme-cli is >>>> distrubing the tests (*). The only other way I found to stop the >>>> autoconnect is by disabling the udev rule completely. If autoconnect >>>> isn't enabled the context isn't necessary. >>>> Though changing system configuration from blktests seems at bit >>>> excessive. >>> >>> we should not stop any autoconnect during blktests. The autoconnect >>> and all the system admin services should run normally. >> >> I do not agree here. The current blktests are not designed for run as >> intergration tests. Sure we should also tests this but currently >> blktests is just not there and tcp/rdma are not actually covered anyway. > > what do you mean tcp/rdma not covered ? > Because there is no autoconnect functionality for tcp/rdma. For FC we have full topology information, and the driver can emit udev messages whenever a NVMe port appears in the fabrics (and the systemd machinery will then start autoconnect). For TCP/RDMA we do not have this, so really there's nothing which could send udev events (discounting things like mDNS and nvme-stas for now). > And maybe we should make several changes in the blktests to make it > standalone without interfering the existing configuration make by some > system administrator. > ?? But this is what we are trying with this patches. The '--context' flag only needs to be set for the blktests, to inform the rest of the system that these subsystems/configuration is special and should be exempted from 'normal' system processing. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew Myers, Andrew McDonald, Martje Boudien Moerman