Received: by 2002:ab2:687:0:b0:1f4:6588:b3a7 with SMTP id s7csp28565lqe; Tue, 9 Apr 2024 13:21:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4SIRn/yZpb/RbmeEUYTjvrWwbspSULivn8h9bTw20IT9BV2pRnxBWU5dujcewDBDQGpDACKj0m33FMDUha68YK4qAicsWsBTVqAO0Qw== X-Google-Smtp-Source: AGHT+IHW98e1pKgaBG0QHgi5xgszSIFgqqzufj+UE/S2ZSPsQduuR4uipLlHDcr8hqGl1W4M+Eav X-Received: by 2002:a05:6a00:1903:b0:6ed:4f0e:76a8 with SMTP id y3-20020a056a00190300b006ed4f0e76a8mr737983pfi.6.1712694075922; Tue, 09 Apr 2024 13:21:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712694075; cv=pass; d=google.com; s=arc-20160816; b=PU5I3JQCHE3Fc/oBb8+S0YqiJsLS6TaqufaidhGzeGteEhjm/eKVAgojUFNAbSGkCo HwaUHsjC812HPPH5DVWmREG+UtT/0g0RrWRHV0zTtYsH50SFByk5Ar73T2elU9sPZHIS B5MIbbnNGsg6iS0TQQbN6PxevqoBW9929X4P2AmVTNdZH+O+xxaHk888tSmf5VzmIYae 4/KCXEGcnlE7RuVMB1qLLK9dJmlqRK1/5yMxJrxLo3cyKIyhhWwaq/AQBbrUkKM/dlcT 7Kcbzb7bDToRi5xzX5jIJVpa6GkVvJNOpJa/vNijPEFFqrS0Yw9q1zkSNx5X3QhOWigV pxhw== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=lULEqVs4tWshiKYsjKkDxlfPSKjepcgNdZDCa3C6hZk=; fh=tCUgcIfFDfNETz//d6nsBhSUDrb9+4EN1DDrQtftF/Y=; b=Cidh/5zOp7BiGcOWBjceVzr2mgkvgNhIptUuDcGoVNUYWV+2GtEfAxTelto4bc2tBd KovaevzW0QIz+jduXjm6QwUG7Kdr3IBKuNEqRjsTyJa0ECyuraYIg8txh+F6dTpCsddj tagY2Zs8rbc8lGUUAkyszZxtgm/N49zo69l0TLIHig1A1yU23hzI5vleAsh8nBFY93LM Xogo6J6BffHqD9XftV14S81u9aVg5A7sTc+3mjWSBNQn4SuR96bmFlkj/mADcAV4OUZM lTF5vKqTJeQdPRHBzxga4XKx7yUEuvHysBs1YTwp7Y4Bk2RSCUdlWT9W2eOtl59IdxiJ kEhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-137586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137586-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f19-20020a056a00229300b006e74608ea4esi9506631pfe.344.2024.04.09.13.21.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 13:21:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-137586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137586-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AF5A1B220C8 for ; Tue, 9 Apr 2024 20:21:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32020158206; Tue, 9 Apr 2024 20:21:03 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 12B952770C for ; Tue, 9 Apr 2024 20:21:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712694062; cv=none; b=CqgmI2tavugbYZUaH8BlEPEsU5aMCwyQ1y9k8LsZaHlVD0+NYLszln+fbP/lQIsy2GhyBJuOQgxTw14zXQwzrbfzHwckVxX+V1eh00AHRGXe+upZMDQtJtwS6uMQqO/q6IauyBVs55YmeGHC7YS3zur5HuHWLsEYrfTPZyIHsbo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712694062; c=relaxed/simple; bh=GNpOiMu5hZbOwN8H7l3gt0aUIAcdwQoMsbK2Mat4wlE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QgfXpIiJcsCzj9f4C/Y6zI7MOgrdclSnzAb3qzpEFUPYuUaYObvU5YMwXFThWiGBhV0hXfMc5Gtb8h+FitrAO2/eYLdhtrFtO5NN32CO0JT7GVwbJqGNnsSJTA+4UcBDEEJyVp9cb2cRd2LG/56w9kVss5WLFnXr/AspfIcVZ6Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=grimberg.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-34602c11302so229375f8f.1 for ; Tue, 09 Apr 2024 13:21:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712694059; x=1713298859; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lULEqVs4tWshiKYsjKkDxlfPSKjepcgNdZDCa3C6hZk=; b=u8AmsVlZk0QzZwNQftWWPA/Gzen7DOfBru3iHnwLvDPsHY145coUtU1rcNvPmmTrbL P/NZwdowS60t/inDaV+CJYEswiswj3ySPX/umgXKjOQYp+TTWz8Qa3UoKL1/Buo+hMau R76QYt1ab0FUp65l/2cV/0d24J3CI/BlieFAz/yF4sZOO4sXO4+hcTrv5aR84uZZOpCe SaNaustlTyyNr3E0fCxJGpvAcPrilGoJ1o8uhndvZzJmwNGYd/X2lPW85cEjp+GfnkiX Uq1sGR2mQ1YDVpPxowP+JZzVEtQnEGXjo8ydaix1FZKvYmp40EyJhavy83okXk8pl7mQ wxyw== X-Forwarded-Encrypted: i=1; AJvYcCWQRUZ6TyDvDPEtx3RUpnNEKlcmjfnDxqz24lIgFnnqKV4Q/vdDp0iUHjOOH6+Yz/x1EhRVVaCYylpPedaO+5KFmqy80GzQXHSXIR2V X-Gm-Message-State: AOJu0YyWytXi4ZA/ml+5HMqWkCdUGTTc5/5+pt5AmOTTDJ18T54ux5UW h/9wMUKX794zZ1MRda6DzqhI7poHNAhGkstF3LbWPXTVzdFkYAQQ X-Received: by 2002:a5d:4a4e:0:b0:343:c3b0:ee39 with SMTP id v14-20020a5d4a4e000000b00343c3b0ee39mr439936wrs.5.1712694058954; Tue, 09 Apr 2024 13:20:58 -0700 (PDT) Received: from [10.100.102.74] (85.65.192.64.dynamic.barak-online.net. [85.65.192.64]) by smtp.gmail.com with ESMTPSA id e8-20020a5d4e88000000b003438cc1d2b4sm12253228wru.59.2024.04.09.13.20.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Apr 2024 13:20:58 -0700 (PDT) Message-ID: Date: Tue, 9 Apr 2024 23:20:57 +0300 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 v5 3/6] nvme-tcp: short-circuit reconnect retries To: Daniel Wagner , Christoph Hellwig Cc: Keith Busch , James Smart , Hannes Reinecke , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240409093510.12321-1-dwagner@suse.de> <20240409093510.12321-4-dwagner@suse.de> Content-Language: he-IL, en-US From: Sagi Grimberg In-Reply-To: <20240409093510.12321-4-dwagner@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 09/04/2024 12:35, Daniel Wagner wrote: > From: Hannes Reinecke > > Returning an nvme status from nvme_tcp_setup_ctrl() indicates that the > association was established and we have received a status from the > controller; consequently we should honour the DNR bit. If not any future > reconnect attempts will just return the same error, so we can > short-circuit the reconnect attempts and fail the connection directly. > > Signed-off-by: Hannes Reinecke > [dwagner: add helper to decide to reconnect] > Signed-off-by: Daniel Wagner > --- > drivers/nvme/host/nvme.h | 24 ++++++++++++++++++++++++ > drivers/nvme/host/tcp.c | 23 +++++++++++++++-------- > 2 files changed, 39 insertions(+), 8 deletions(-) > > diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h > index 9b8904a476b8..dfe103283a3d 100644 > --- a/drivers/nvme/host/nvme.h > +++ b/drivers/nvme/host/nvme.h > @@ -701,6 +701,30 @@ static inline bool nvme_is_path_error(u16 status) > return (status & 0x700) == 0x300; > } > > +/* > + * Evaluate the status information returned by the LLDD in order to > + * decided if a reconnect attempt should be scheduled. > + * > + * There are two cases where no reconnect attempt should be attempted: > + * > + * 1) The LLDD reports an negative status. There was an error (e.g. no > + * memory) on the host side and thus abort the operation. > + * Note, there are exception such as ENOTCONN which is > + * not an internal driver error, thus we filter these errors > + * out and retry later. > + * 2) The DNR bit is set and the specification states no further > + * connect attempts with the same set of paramenters should be > + * attempted. > + */ > +static inline bool nvme_ctrl_reconnect(int status) > +{ > + if (status < 0 && status != -ENOTCONN) > + return false; So if the host failed to allocate a buffer it will never attempt another reconnect? doesn't sound right to me..,