From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 ECD6730F532 for ; Wed, 31 Dec 2025 22:26:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767220001; cv=none; b=rSZ78JVoHd0GFV1N4xGqCtZkWTigfCJd8EyWx1kPIpS8efJejVcgJxPFyCRbppAdUBPq6wMwPyWEKfnRsL9Yhx2GvKIkg51g5mm8tf0lZEyimYOUd7xUxbmF613efas8L1Z7K5pE3JszDUNJtF3NS0aYSxIkLLOAHFnw7CLxXJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767220001; c=relaxed/simple; bh=JjMO6GDhXvbjY3ArcQPdUmJes5ZV6hAKgk6hhZ6lA9g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ePckyfBpME2JqMOmdn7ap/skWkkNAXiwDd/3vc30/puP6RMNmNvD9iFLCZBzfqAxSihW8IZHeeVvfv4izvK0h/eMh6A534NDX8SU+lhVx+tGdtKa2cAr9HyJca6b2kVAh0LpRbZCQdn8eCnOQ2TCV0FsEKKvctrSEaByLp0qiRA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=dJgetjDG; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="dJgetjDG" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-c026e074373so10587566a12.1 for ; Wed, 31 Dec 2025 14:26:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1767219999; x=1767824799; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=V8sVwq9k/KtRJfLNXcngxTISm73sU2fRAv4aVFfLZns=; b=dJgetjDGs+coUlc3QQ/dNlmLlfAM1pLUZ8AokmUxKUb4e1gEGCCPqKL5/UoTmqn/h+ RLDvM8L2Aw9oehIZqjaVA5ul8Fk6u040OnKly6w/BcRSekmvV/kp1a0+EF/R4QOgrTTH Zh/Gy35WDGJaOH1XcpSKGxFTfZLmPDwvWNxOlxJp3EVFGx8Yqbr8LFihU0brwMaGgoE+ qHGhwBrouH6gQ0N4KRBiqTTUhQ4yXdTRJooGDmgsC3xQiGz9F7xuHtuibXoQ/V+RR0FV OiAfJBaVkJOiIf81CP5+ZtHRhuIAWAWbZE/xFN74dJ8ppwxMFX/gSmMm/AEi6UdGgXXj K6Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767219999; x=1767824799; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=V8sVwq9k/KtRJfLNXcngxTISm73sU2fRAv4aVFfLZns=; b=RwiHCgCXW0MDDNGrXaR2/0HhmNxELpHHDcyA9tIzYTD6HJLUtcvCIM9EBgGp0cSeuk wFORGmJ7G5K0oTBgDvlh9WFltEYsfsIh3TgeS7gbEReI4Dx5ONlo7ZIpJv2/Pq/eBybD qDAf2gERLJB27Z60DrZXiefm6CH1fkvHa2IWIkecCVbCSODpcCPxe9jEgTn8CY35vASq 9lB069eSOc5rcw694lkeXE7vnpH1Gle0j2DVFlxCotcAX/HKZDTga0DQbeZd9ViejUFc gC1BzR28STkbLZ2+ppfY3j5FgH/dwn2SLDjivPmWbleUnPPCMXgdJkF9X0K22PcqFRcS DHjQ== X-Forwarded-Encrypted: i=1; AJvYcCX52z5hYB/Pd/POJab8LCK9KNSQ+5C853z9Ov9nDMdBL/awHIZiXZDQx6D+he/Hhr5lC2rMrm4ZQi29kEE=@vger.kernel.org X-Gm-Message-State: AOJu0YwSWhZ6xudHCdSZYdHruB3tW3onOLa/HmQc+GTpLdBXijfVV1T2 AsO9j4vSRaeKld3iTaQKBA8M+TAO+t0brVO/DOgh77OuqHEfRGrDszMNbU3H1x2AnuA= X-Gm-Gg: AY/fxX6YgLjj+hhcs0vFak47xOIKb0O0BOuyCpWsaBty7OYKX85nYgr9jROLmPvfJdt vM7bf4RSPEbIzDdJc93odlEhBemXiytDkwGVYe58pObZiXvkpMpHL9/krXX+av93CD9TBsMkjli qIkuwJMpmibQaupUU95V4cIc4jY5l/eVhIJ8DJFkAFBDlyVYQ2S1EtQrvu0qGEHYahXHTlmnYn0 QNbVjFBDvpNU/ipbjLZzzEAVLfeRpcG5XORZymeWVye1Y77I52/kmIh3/9ELCPNSaDHueZGi/SF BNafnuYJQARepnJSsFNZdrzjGSRxuFmHWOwgYeJ1abe3X5lzdsH1dGjh7uC7SbV8gdOUZcwboCQ JZvk4r1N6USLDgOt3aD/fA+xt51ccL7uO5l1JTIL96PYTblZxxGsuYwf0iIWIy4tpi5zH6YTvAC BJMW2/PGLL+dimDOg3cPpq2ZzA86QN5ig= X-Google-Smtp-Source: AGHT+IHRAs+DBQYbJtFjP7Omh9Gnq6yScKTA7NcBPSWy7KfklUqG+PVIdWZUT9a/t3IWDAACfmz/CQ== X-Received: by 2002:a05:7301:db12:b0:2a4:3594:d54e with SMTP id 5a478bee46e88-2b05ec7417dmr22494164eec.27.1767219998756; Wed, 31 Dec 2025 14:26:38 -0800 (PST) Received: from medusa.lab.kspace.sh ([208.88.152.253]) by smtp.googlemail.com with UTF8SMTPSA id a92af1059eb24-121724dd7f5sm142000984c88.5.2025.12.31.14.26.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Dec 2025 14:26:38 -0800 (PST) Date: Wed, 31 Dec 2025 14:26:37 -0800 From: Mohamed Khalfella To: Randy Jennings Cc: Chaitanya Kulkarni , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Aaron Dailey , John Meneghini , Hannes Reinecke , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 06/14] nvme: Rapid Path Failure Recovery read controller identify fields Message-ID: <20251231222637.GL3864520-mkhalfella@purestorage.com> References: <20251126021250.2583630-1-mkhalfella@purestorage.com> <20251126021250.2583630-7-mkhalfella@purestorage.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu 2025-12-18 07:22:41 -0800, Randy Jennings wrote: > On Tue, Nov 25, 2025 at 6:13 PM Mohamed Khalfella > wrote: > > > > TP2028 Rapid path failure added new fileds to controller identify > TP8028 Fixed. > > response. Read CIU (Controller Instance Uniquifier), CIRN (Controller > > Instance Random Number), and CCRL (Cross-Controller Reset Limit) from > > controller identify response. Expose CIU and CIRN as sysfs attributes > > so the values can be used directrly by user if needed. > > > > TP4129 KATO Corrections and Clarifications defined CQT (Command Quiesce > > Time) which is used along with KATO (Keep Alive Timeout) to set an upper > > limite for attempting Cross-Controller Recovery. > "limite" -> "limit" Fixed. > > > > Signed-off-by: Mohamed Khalfella > > --- > > drivers/nvme/host/core.c | 5 +++++ > > drivers/nvme/host/nvme.h | 11 +++++++++++ > > drivers/nvme/host/sysfs.c | 23 +++++++++++++++++++++++ > > 3 files changed, 39 insertions(+) > > > > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > > index fa4181d7de73..aa007a7b9606 100644 > > --- a/drivers/nvme/host/core.c > > +++ b/drivers/nvme/host/core.c > > @@ -3572,12 +3572,17 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl) > > ctrl->crdt[1] = le16_to_cpu(id->crdt2); > > ctrl->crdt[2] = le16_to_cpu(id->crdt3); > > > > + ctrl->ciu = id->ciu; > > + ctrl->cirn = le64_to_cpu(id->cirn); > > + atomic_set(&ctrl->ccr_limit, id->ccrl); > Seems like it would be good for the target & init to use the same > name for these fields. I have a preference for these over > instance_uniquifier and random because they are more concise, but > the preference is not strong. The field names in the spec are concise, but they are also cryptic. > > > + > > ctrl->oacs = le16_to_cpu(id->oacs); > > ctrl->oncs = le16_to_cpu(id->oncs); > > ctrl->mtfa = le16_to_cpu(id->mtfa); > > ctrl->oaes = le32_to_cpu(id->oaes); > > ctrl->wctemp = le16_to_cpu(id->wctemp); > > ctrl->cctemp = le16_to_cpu(id->cctemp); > > + ctrl->cqt = le16_to_cpu(id->cqt); > > > > atomic_set(&ctrl->abort_limit, id->acl + 1); > > ctrl->vwc = id->vwc; > I cannot discern an ordering to the attributes set here. Any > particular reason, you placed cqt away from the others you added? No reason. Moved ctrl->cqt initialization up with other fields. > > > diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c > > index 29430949ce2f..ae36249ad61e 100644 > > --- a/drivers/nvme/host/sysfs.c > > +++ b/drivers/nvme/host/sysfs.c > > @@ -388,6 +388,27 @@ nvme_show_int_function(queue_count); > > nvme_show_int_function(sqsize); > > nvme_show_int_function(kato); > > > > +static ssize_t nvme_sysfs_uniquifier_show(struct device *dev, > > + struct device_attribute *attr, > > + char *buf) > > +{ > > + struct nvme_ctrl *ctrl = dev_get_drvdata(dev); > > + > > + return sysfs_emit(buf, "%02x\n", ctrl->ciu); > > +} > > +static DEVICE_ATTR(uniquifier, S_IRUGO, nvme_sysfs_uniquifier_show, NULL); > > + > > +static ssize_t nvme_sysfs_random_show(struct device *dev, > > + struct device_attribute *attr, > > + char *buf) > > +{ > > + struct nvme_ctrl *ctrl = dev_get_drvdata(dev); > > + > > + return sysfs_emit(buf, "%016llx\n", ctrl->cirn); > > +} > > +static DEVICE_ATTR(random, S_IRUGO, nvme_sysfs_random_show, NULL); > > + > > + > > static ssize_t nvme_sysfs_delete(struct device *dev, > > struct device_attribute *attr, const char *buf, > > size_t count) > > @@ -734,6 +755,8 @@ static struct attribute *nvme_dev_attrs[] = { > > &dev_attr_numa_node.attr, > > &dev_attr_queue_count.attr, > > &dev_attr_sqsize.attr, > > + &dev_attr_uniquifier.attr, > > + &dev_attr_random.attr, > > &dev_attr_hostnqn.attr, > > &dev_attr_hostid.attr, > > &dev_attr_ctrl_loss_tmo.attr, > > -- > > 2.51.2 > > > > These are the names used in the target code (uniquifer & random. > I'd rather have them match (identify structure will have spec's > abbreviations; ctrl & debug/sysfs for target & initiator either be > ciu/cirn or uniquifer/random. I think it matters for sysfs attributes. I do not know the right thing to do. Should we use spec names like "cirn" or call it "random"? > > But this is small stuff. > > Reviewed-by: Randy Jennings