Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1400393lqp; Mon, 15 Apr 2024 05:43:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXlp0l+imxaHHvmHanIQlmhAUQ4AUdI+TuczRjpN954JkYmqJ1NSn+WdsO3ZQ9+CaTHZ31QQ6Rn2fhByy9wFlI6eHn00nvFQxAGyxQYTA== X-Google-Smtp-Source: AGHT+IHisPIgxE/lbN2JvHy2SJsFpyn/ArJ5SnmPqO10o/WP1QuF78clbiHlSpPxtA+4eylZvYBn X-Received: by 2002:a17:902:ff01:b0:1e5:562d:425b with SMTP id f1-20020a170902ff0100b001e5562d425bmr10389590plj.22.1713185022690; Mon, 15 Apr 2024 05:43:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713185022; cv=pass; d=google.com; s=arc-20160816; b=d8cpbIaeft7p4+RG6qhhjYN4gxBhZEyujyjRvebwFjdrK5B9FicZG1T/xFIdB1P5kG FU4cUhInV3q7RrezshynXCnqKC/eLU3jXJv8Q26Ca0vzvtgF5uf+mvz/pZDYlviogqik XtsO0GL6J2ckP07OnXt4dVtF/iKa/rbgIYhKzmp+uk+5hVSvTJquyCy0Ygz68Vj8XGop 7YyqtYqqxysTWf0TRMqmnMoobqCwAhbtLlCTzsZSAHpGNyd2K+HA1Ec57hc4F9l/qHqb MhBA2T12PbDzMxmZWtxW36Qqyxkl82z/59lvLaEmDdovatTHCJfErweYYCCjrgp32rke FIaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=xCUjHhPcLIikr2Xjthccw3uC0sbKS2tipG0r76S/jOQ=; fh=DJuiNgwyR0bD8rPMSu/msvIvJ9b4/StdsZoGeLLj0J4=; b=nyik2rRxTYzxb0SS3/sdjLy5bqHsLTHjDV+ogUCUI3x1u3YHSdSGSGNSsF2QDeVkyv H8F1HOczKHR/yaFcV3pyc1qKWHCIuFShnLq9WPbXETdsd9irrwBHC01thY4PcuDDankz ydUjcFmFQHn0XyFwrwqRRdX1KII+kTSTeI7Xbpai5HeUJzOtoWxz+6O/nDhvl0s4MgUU rj4qTVf/lLjv4q4W3CD19weOexiXnuNVSbfipP4vRmFxNiITppf1s8Us3EpavvaepmuD AyECj9mez1TeE6/QGzUFwVZGsa/JYLo7TYJYdgNYjgPaa54UB3FyxX2YefkyqnKYxxlg iT7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Riq6rqQ8; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="kBnk/nnK"; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Riq6rqQ8; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-145087-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e9-20020a170902f10900b001e0b60f9063si7294137plb.369.2024.04.15.05.43.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 05:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145087-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Riq6rqQ8; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b="kBnk/nnK"; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Riq6rqQ8; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-145087-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145087-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (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 5A561283D01 for ; Mon, 15 Apr 2024 12:43:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23D9666B5E; Mon, 15 Apr 2024 12:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Riq6rqQ8"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="kBnk/nnK"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Riq6rqQ8"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="kBnk/nnK" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 6AA367316E for ; Mon, 15 Apr 2024 12:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713184952; cv=none; b=pWNx2aMizRyDIxzDgQFCd1tG4SRUelV/YFp0alXFMn980VDQP6mn25N8PfRbJIOr6G+9uf9AIJL1LFGlYFbcbAs92OB2HlcWcaiezY5dgEUOZD227VpJ22/07CwTTMzI0RXHuz9g7LkfkHmt++3YldsbDM6xgByn5ZOkSSWTsGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713184952; c=relaxed/simple; bh=aO5irizUfsI/C2XrlQPAikT66BIgu0ZNpp3QLqF7ozg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JB2yHlBk9GsIFutb24Bt1xyW13tWgX7WO3KnrZSUwCWIB4Dl6GtuqteADD1oPY7aUvWwEdws6IOjla918Y5BrDe2Cz2WSJjllaZ/xbI1Eam78OAq8kWQuK1uCIrcbB0nJi0jAVh07zCYNp4I65ftIPNEK0r05oZBSYU7h3DPjdc= 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; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Riq6rqQ8; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=kBnk/nnK; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Riq6rqQ8; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=kBnk/nnK; arc=none smtp.client-ip=195.135.223.131 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 [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-out2.suse.de (Postfix) with ESMTPS id 97A025CF88; Mon, 15 Apr 2024 12:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1713184942; 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; bh=xCUjHhPcLIikr2Xjthccw3uC0sbKS2tipG0r76S/jOQ=; b=Riq6rqQ863fIP0WTUEZ9AYHsttx6WtbFG6GhrtY0125ZA1XqBdg05Z+731h0s5j3uLtvxI GMgctyXGuwlBGAPH4IB8AKstPkD1AdnOlfsXzdXrru7uz0UlsBqU4bBL6KkT3/tJES4fr2 pwyyWbUU25CwCSsOnJ2v8hZSiNWkRJ0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1713184942; 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; bh=xCUjHhPcLIikr2Xjthccw3uC0sbKS2tipG0r76S/jOQ=; b=kBnk/nnKfEiUIbOYOphI7IXXBw5HpS8tW5ggSgUAI6iPVvTMaIAPcZebgEVNlCTSi3tQbX zLoN/jLcDZ+NR3Dw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1713184942; 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; bh=xCUjHhPcLIikr2Xjthccw3uC0sbKS2tipG0r76S/jOQ=; b=Riq6rqQ863fIP0WTUEZ9AYHsttx6WtbFG6GhrtY0125ZA1XqBdg05Z+731h0s5j3uLtvxI GMgctyXGuwlBGAPH4IB8AKstPkD1AdnOlfsXzdXrru7uz0UlsBqU4bBL6KkT3/tJES4fr2 pwyyWbUU25CwCSsOnJ2v8hZSiNWkRJ0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1713184942; 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; bh=xCUjHhPcLIikr2Xjthccw3uC0sbKS2tipG0r76S/jOQ=; b=kBnk/nnKfEiUIbOYOphI7IXXBw5HpS8tW5ggSgUAI6iPVvTMaIAPcZebgEVNlCTSi3tQbX zLoN/jLcDZ+NR3Dw== 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 7A8B91386E; Mon, 15 Apr 2024 12:42:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 7pyxHK4gHWYnAwAAD6G6ig (envelope-from ); Mon, 15 Apr 2024 12:42:22 +0000 From: Daniel Wagner To: Christoph Hellwig Cc: Keith Busch , Sagi Grimberg , James Smart , Hannes Reinecke , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Daniel Wagner Subject: [PATCH v6 0/5] nvme-fabrics: short-circuit connect retries Date: Mon, 15 Apr 2024 14:42:15 +0200 Message-ID: <20240415124220.5433-1-dwagner@suse.de> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_SEVEN(0.00)[8]; FROM_HAS_DN(0.00)[] X-Spam-Score: -2.80 X-Spam-Flag: NO I've resorted the series so that the nvmet changes come first instead as the last patch. These changes are necessary to get the host code tested. The second big changes is moving the logic into the existing helper nvmf_should_reconnect, all the transports get updated in one go. And lastely, I've added a retry auth failure patch as requested by Sagi. I explictly decided against to count these error from the normal retry counter (nr_reconnects) as this would make it unnecessary complex to map the two different max limits into one counter. changes: v6: - reorder series - extended nvmf_should_reconnect - added auth retry logic v5: - nvme: do not mix kernel error code with nvme status - nvmet: separate nvme status from dhchap status - https://lore.kernel.org/linux-nvme/20240409093510.12321-1-dwagner@suse.de/ v4: - rebased - added 'nvme: fixes for authentication errors' series - https://lore.kernel.org/all/20240404154500.2101-1-dwagner@suse.de/ v3: - added my SOB tag - fixed indention - https://lore.kernel.org/linux-nvme/20240305080005.3638-1-dwagner@suse.de/ v2: - refresh/rebase on current head - extended blktests (nvme/045) to cover this case (see separate post) - https://lore.kernel.org/linux-nvme/20240304161006.19328-1-dwagner@suse.de/ v1: - initial version - https://lore.kernel.org/linux-nvme/20210623143250.82445-1-hare@suse.de/ Daniel Wagner (1): nvme-fabrics: handle transient auth failures Hannes Reinecke (4): nvmet: lock config semaphore when accessing DH-HMAC-CHAP key nvmet: return DHCHAP status codes from nvmet_setup_auth() nvme: authentication error are always non-retryable nvme-fabrics: short-circuit reconnect retries drivers/nvme/host/auth.c | 4 +- drivers/nvme/host/core.c | 6 +-- drivers/nvme/host/fabrics.c | 58 +++++++++++++++++--------- drivers/nvme/host/fabrics.h | 2 +- drivers/nvme/host/fc.c | 6 +-- drivers/nvme/host/nvme.h | 3 +- drivers/nvme/host/rdma.c | 20 +++++---- drivers/nvme/host/tcp.c | 23 ++++++---- drivers/nvme/target/auth.c | 22 +++++----- drivers/nvme/target/configfs.c | 22 +++++++--- drivers/nvme/target/fabrics-cmd-auth.c | 49 +++++++++++----------- drivers/nvme/target/fabrics-cmd.c | 11 ++--- drivers/nvme/target/nvmet.h | 8 ++-- 13 files changed, 140 insertions(+), 94 deletions(-) -- 2.44.0