nvme: sysfs: emit the marginal path state in show_state()
PATCH v6 6/6 nvme: sysfs: emit the marginal path state in show_state()
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.
--- drivers/nvme/host/sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/nvme/host/sysfs.c +3 -1
@@ -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" ); }
Signature · 1 line
2.49.0
Quoted 16 lines · Bryan Gurney
If a controller has received a link integrity or congestion event, and has the
NVME_CTRL_MARGINALflag set, emit "marginal" in the state instead of "live", to identify the marginal paths.Co-developed-by John Meneghini <[email protected]>Signed-off-by John Meneghini <[email protected]>Signed-off-by Bryan Gurney <[email protected]>--- drivers/nvme/host/sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/nvme/host/sysfs.c +0
-0
drivers/nvme/host/sysfs.c static ssize_t nvme_sysfs_show_state(struct device *dev, · line 438
Quoted 10 lines
drivers/nvme/host/sysfs.c +3
-1@@ -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" ); }
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +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
Quoted 7 lines · Bryan Gurney
If a controller has received a link integrity or congestion event, and has the
NVME_CTRL_MARGINALflag set, emit "marginal" in the state instead of "live", to identify the marginal paths.Co-developed-by John Meneghini<[email protected]>Signed-off-by John Meneghini<[email protected]>Signed-off-by Bryan Gurney<[email protected]>
Looks good.
-ck