linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 6/6] nvme: sysfs: emit the marginal path state in show_state()
@ 2025-06-20 17:58 Bryan Gurney
  2025-06-21 13:36 ` Hannes Reinecke
  2025-06-25  4:33 ` Chaitanya Kulkarni
  0 siblings, 2 replies; 3+ messages in thread
From: Bryan Gurney @ 2025-06-20 17:58 UTC (permalink / raw)
  To: linux-nvme, kbusch, hch, sagi, axboe
  Cc: james.smart, dick.kennedy, njavali, linux-scsi, hare, bgurney,
	jmeneghi

If a controller has received a link integrity or congestion event, and
has the NVME_CTRL_MARGINAL flag set, emit "marginal" in the state
instead of "live", to identify the marginal paths.

Co-developed-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: John Meneghini <jmeneghi@redhat.com>
Signed-off-by: Bryan Gurney <bgurney@redhat.com>
---
 drivers/nvme/host/sysfs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index 29430949ce2f..4a6135c2f9cb 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -430,7 +430,9 @@ static ssize_t nvme_sysfs_show_state(struct device *dev,
 	};
 
 	if (state < ARRAY_SIZE(state_name) && state_name[state])
-		return sysfs_emit(buf, "%s\n", state_name[state]);
+		return sysfs_emit(buf, "%s\n",
+			(nvme_ctrl_is_marginal(ctrl)) ? "marginal" :
+			state_name[state]);
 
 	return sysfs_emit(buf, "unknown state\n");
 }
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v6 6/6] nvme: sysfs: emit the marginal path state in show_state()
  2025-06-20 17:58 [PATCH v6 6/6] nvme: sysfs: emit the marginal path state in show_state() Bryan Gurney
@ 2025-06-21 13:36 ` Hannes Reinecke
  2025-06-25  4:33 ` Chaitanya Kulkarni
  1 sibling, 0 replies; 3+ messages in thread
From: Hannes Reinecke @ 2025-06-21 13:36 UTC (permalink / raw)
  To: Bryan Gurney, linux-nvme, kbusch, hch, sagi, axboe
  Cc: james.smart, dick.kennedy, njavali, linux-scsi, jmeneghi

On 6/20/25 19:58, Bryan Gurney wrote:
> If a controller has received a link integrity or congestion event, and
> has the NVME_CTRL_MARGINAL flag set, emit "marginal" in the state
> instead of "live", to identify the marginal paths.
> 
> Co-developed-by: John Meneghini <jmeneghi@redhat.com>
> Signed-off-by: John Meneghini <jmeneghi@redhat.com>
> Signed-off-by: Bryan Gurney <bgurney@redhat.com>
> ---
>   drivers/nvme/host/sysfs.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
> index 29430949ce2f..4a6135c2f9cb 100644
> --- a/drivers/nvme/host/sysfs.c
> +++ b/drivers/nvme/host/sysfs.c
> @@ -430,7 +430,9 @@ static ssize_t nvme_sysfs_show_state(struct device *dev,
>   	};
>   
>   	if (state < ARRAY_SIZE(state_name) && state_name[state])
> -		return sysfs_emit(buf, "%s\n", state_name[state]);
> +		return sysfs_emit(buf, "%s\n",
> +			(nvme_ctrl_is_marginal(ctrl)) ? "marginal" :
> +			state_name[state]);
>   
>   	return sysfs_emit(buf, "unknown state\n");
>   }
Reviewed-by: Hannes Reinecke <hare@suse.de>

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v6 6/6] nvme: sysfs: emit the marginal path state in show_state()
  2025-06-20 17:58 [PATCH v6 6/6] nvme: sysfs: emit the marginal path state in show_state() Bryan Gurney
  2025-06-21 13:36 ` Hannes Reinecke
@ 2025-06-25  4:33 ` Chaitanya Kulkarni
  1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2025-06-25  4:33 UTC (permalink / raw)
  To: Bryan Gurney, linux-nvme@lists.infradead.org, kbusch@kernel.org,
	hch@lst.de, sagi@grimberg.me, axboe@kernel.dk
  Cc: james.smart@broadcom.com, dick.kennedy@broadcom.com,
	njavali@marvell.com, linux-scsi@vger.kernel.org, hare@suse.de,
	jmeneghi@redhat.com

On 6/20/25 10:58, Bryan Gurney wrote:
> If a controller has received a link integrity or congestion event, and
> has the NVME_CTRL_MARGINAL flag set, emit "marginal" in the state
> instead of "live", to identify the marginal paths.
>
> Co-developed-by: John Meneghini<jmeneghi@redhat.com>
> Signed-off-by: John Meneghini<jmeneghi@redhat.com>
> Signed-off-by: Bryan Gurney<bgurney@redhat.com>

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-25  4:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-20 17:58 [PATCH v6 6/6] nvme: sysfs: emit the marginal path state in show_state() Bryan Gurney
2025-06-21 13:36 ` Hannes Reinecke
2025-06-25  4:33 ` Chaitanya Kulkarni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).