Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp164914rdb; Wed, 21 Feb 2024 22:46:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWD/6O+2nSvqw3tHo8VhDKorxpFYFUk6WfxjEReqhZr8S/X3pR8O7PthIsyT9nPWj3dlayIUH9b3bVjIp/Zpx954ofQDycLcUL5fPqicw== X-Google-Smtp-Source: AGHT+IF9O6I8cbBKZNlrF5QkbU+WMYuUMGn7tPymO3RX/lBWSvvhwBHH17cnm5iJgNc4gBQLNDHz X-Received: by 2002:a05:6870:51cd:b0:21e:fc35:73ec with SMTP id b13-20020a05687051cd00b0021efc3573ecmr9782924oaj.34.1708584384549; Wed, 21 Feb 2024 22:46:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708584384; cv=pass; d=google.com; s=arc-20160816; b=D4SYSM3E2TYfqiwJaHku2eXmhQGezYLBpMrgiJ9Fe1QW4BTBMJimms3sIXZNfUcMNm UOG3SGkjbfJe3e98flXRG7/6eyoheQx6lmu3rehf4BdRjEN0mdu8re3hniay/vBEBqdW iGGu8C7IVxOU9HkY7+nD1zMdKV+Lfb3HIWRE777VLphhp7bVCYTA5P3bKrkrmarPRGTP 7y3dr3iuZ2yEjiwfAYia8QZLZ3ywBcP0TbbQQt3xAcBTLmLAhLZsjgtnwKTUbQDMAbpC HUxz0lXy0lJYq7/+PHb8NTfl0DilO7ZYkhYhDTZQhVhpPn6lLO2zUPldYKeJ54zlOQRK VZ1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=7f2wOr4WiYsb2yvk0XZ3KfOvOFjASpTy+VG+axdJKjo=; fh=5sV5j48o9MPnjcPcUW0wuskjgm3N5ImQJAIwKAbvZ8I=; b=mwIy1VUnhfQxd/+s6pM1nH8LMjtk2Kg8T1AhW3hTDBvyAP97L5u9SBRH7voprqfdUF yvrb814Ke0WX9sUwYzPVsmisy9TB0IX6uVGgc2FBjM5JwCRdI0N/yyFFTyRMbXzXGsPR A1e1rOo4XOy+U3eABhw2nFNEEtEqB6GbnMRmLcEWQ5dDSzMZEuMXppTYGGJiNjuBQpN8 0e9sS808inZAOy/Ec2Vus35no6dwobUoN8Yi4vd80Bc2kfVY+6c1/5lYpp/+JXSSryXU ig7ga+y+9uY6ijg1oMq8df/qbaR+Mtj66RRvOwQaSSEhPXB/dZLPIpKVlY9GW8UlREjU 6fMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-75987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u5-20020a656705000000b005d3adb65694si9230214pgf.757.2024.02.21.22.46.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 22:46:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-75987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3DC7F2825D9 for ; Thu, 22 Feb 2024 06:46:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B660017743; Thu, 22 Feb 2024 06:46:18 +0000 (UTC) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 461E212E4F for ; Thu, 22 Feb 2024 06:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708584378; cv=none; b=Et6YNO5ytgWKuFGxGuCBgpDGAk4bNYqBrxcAHx27ejw0f0izwHhIW0YVedM0T47pNFBunebMybNrOPD3MDByAR+mE+e+TmElcEPUpFYx6w4LH2lRYxnnjiesKWpTLppxCW4QujR0Twx6YOYj/wQW1hkjvMkGOy9eqKPBOH9ZkWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708584378; c=relaxed/simple; bh=etni9eSsEUBqPWgaCJwLr3P6yofDx35EbKlQDyBCb3o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QRMHdABqNCsVqADbs5RQ93mkQ6oc2MX8Dn3sEFv6aqKoVmzaIUPPDtafLfwOkiAGcy2FgnZVBdfuf/kZDdkE8+ix/MqoflzQfgPce5dxj/xKtUg3/ZBJQVK0o5uV6tNYt2Wi0aTwyUPyovkqJhrwmE50zrdQOCm+917k7cM4GY4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5C6E221F4D; Thu, 22 Feb 2024 06:46:14 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 860B5133DC; Thu, 22 Feb 2024 06:46:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id MZT5HrXt1mWNWAAAD6G6ig (envelope-from ); Thu, 22 Feb 2024 06:46:13 +0000 Message-ID: <609e0031-e97c-466b-8cbd-47755374b117@suse.de> Date: Thu, 22 Feb 2024 07:46:12 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/5] nvme-fc: do not retry when auth fails or connection is refused Content-Language: en-US To: Daniel Wagner Cc: James Smart , Keith Busch , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240221132404.6311-1-dwagner@suse.de> <20240221132404.6311-3-dwagner@suse.de> From: Hannes Reinecke In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Level: Authentication-Results: smtp-out1.suse.de; none X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 5C6E221F4D X-Spam-Flag: NO On 2/21/24 17:37, Daniel Wagner wrote: > On Wed, Feb 21, 2024 at 04:53:44PM +0100, Hannes Reinecke wrote: >> On 2/21/24 14:24, Daniel Wagner wrote: >>> There is no point in retrying to connect if the authentication fails. >>> >>> Connection refused is also issued from the authentication path, thus >>> also do not retry. >>> >>> Reviewed-by: Christoph Hellwig >>> Signed-off-by: Daniel Wagner >>> --- >>> drivers/nvme/host/fc.c | 2 ++ >>> 1 file changed, 2 insertions(+) >>> >>> diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c >>> index a5b29e9ad342..b81046c9f171 100644 >>> --- a/drivers/nvme/host/fc.c >>> +++ b/drivers/nvme/host/fc.c >>> @@ -3312,6 +3312,8 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status) >>> ctrl->cnum, status); >>> if (status > 0 && (status & NVME_SC_DNR)) >>> recon = false; >>> + if (status == NVME_SC_AUTH_REQUIRED || status == -ECONNREFUSED) >>> + recon = false; >>> } else if (time_after_eq(jiffies, rport->dev_loss_end)) >>> recon = false; >> Is this still required after the patchset to retry authentication errors? > > Do you mean > > 48dae46676d1 ("nvme: enable retries for authentication commands") > > ? Yes. > > In this case yes, I've tested on top of this patch. This breaks the loop > where the provided key is invalid or is missing. The loop would happy > retry until reaching max of retries. But that's to be expected, no? After all, that's _precisely_ what NVME_SC_DNR is for; if you shouldn't retry, that bit is set. If it's not set, you should. So why is NVME_SC_AUTH_REQUIRED an exception? Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich