multipath: set rport port_state on NVMe FPIN events
Benjamin Marzinski
maintainercover multipath: set rport port_state on NVMe FPIN events
When multipathd handles link integrity FPIN events, it sets the rport associated with the effected SCSI paths to Marginal. These patches make it do the same thing for NVMe paths.
I actually have a stupid Fibre Channel question. Does the host number and the target wwpn uniquely identfy an rport? I never see the channel set to anything other than 0, but I don't think that it MUST be 0. But if we knew that there was only one rport for a given host number and target WWPN, we could stop checking as soon as we found one. These patches don't do that. They check all the rports.
Benjamin Marzinski (2):
libmultipath: export udev pthread cleanup functions
multipathd: set rport port_state to marginal for NVMe devices
libmultipath/discovery.c | 4 +- libmultipath/discovery.h | 2 + libmultipath/libmultipath.version | 6 +++ multipathd/fpin_handlers.c | 74 ++++++++++++++++++++++++++++--- 4 files changed, 78 insertions(+), 8 deletions(-)
Signature · 1 line
2.46.2
Benjamin Marzinski
maintainerPATCH 1/2 libmultipath: export udev pthread cleanup functions
A future patch will make use of cleanup_udev_enumerate_ptr() and cleanup_udev_device_ptr().
--- libmultipath/discovery.c | 4 ++-- libmultipath/discovery.h | 2 ++ libmultipath/libmultipath.version | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-)
libmultipath/discovery.c +2 -2
@@ -146,7 +146,7 @@ path_discover (vector pathvec, struct config * conf,return pathinfo (pp, conf, flag); } -static void cleanup_udev_enumerate_ptr (void *arg) +void cleanup_udev_enumerate_ptr (void *arg) {struct udev_enumerate *ue;
@@ -157,7 +157,7 @@ static void cleanup_udev_enumerate_ptr(void *arg) (void )udev_enumerate_unref (ue); } -static void cleanup_udev_device_ptr (void *arg) +void cleanup_udev_device_ptr (void *arg) {struct udev_device *ud;
libmultipath/discovery.h +2 -0
@@ -59,6 +59,8 @@ bool has_uid_fallback(struct path *pp);int get_uid (struct path * pp,int path_state,struct udev_device *udev,int allow_fallback);bool is_vpd_page_supported (int fd,int pg); +void cleanup_udev_enumerate_ptr (void *arg); +void cleanup_udev_device_ptr (void *arg);/* * discovery bitmask
libmultipath/libmultipath.version +6 -0
@@ -244,3 +244,9 @@ global: local: *; }; + +LIBMULTIPATH_27.1.0 { +global: + cleanup_udev_enumerate_ptr; + cleanup_udev_device_ptr; +} LIBMULTIPATH_27.0.0;
Signature · 1 line
2.46.2
RE: [PATCH 1/2] libmultipath: export udev pthread cleanup functions
Hi Benjamin,
Change's looks good.
-----Original Message-----
From: Benjamin Marzinski <[email protected]>
Sent: Friday, December 20, 2024 7:33 AM
To: Christophe Varoqui <[email protected]>
Cc: device-mapper development <[email protected]>; Martin Wilck <[email protected]>; Muneendra Kumar <[email protected]>
Subject: [PATCH 1/2] libmultipath: export udev pthread cleanup functions
A future patch will make use of cleanup_udev_enumerate_ptr() and cleanup_udev_device_ptr().
--- libmultipath/discovery.c | 4 ++-- libmultipath/discovery.h | 2 ++ libmultipath/libmultipath.version | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-)
libmultipath/discovery.c index renamed from libmultipath/discovery.c +0 -0
b5851561..72ea0c98 100644
libmultipath/discovery.c +2 -2
@@ -146,7 +146,7 @@ path_discover (vector pathvec, struct config * conf,return pathinfo (pp, conf, flag); } -static void cleanup_udev_enumerate_ptr (void *arg) +void cleanup_udev_enumerate_ptr (void *arg) {struct udev_enumerate *ue;
@@ -157,7 +157,7 @@ static void cleanup_udev_enumerate_ptr(void *arg) (void )udev_enumerate_unref (ue); } -static void cleanup_udev_device_ptr (void *arg) +void cleanup_udev_device_ptr (void *arg) {struct udev_device *ud;
libmultipath/discovery.h index renamed from libmultipath/discovery.h +0 -0
7d42eae5..1f7a6e20 100644
libmultipath/discovery.h +0 -0
@@ -59,6 +59,8 @@ bool has_uid_fallback(struct path *pp); int
get_uid(struct path * pp, int path_state, struct udev_device *udev,
int allow_fallback);
bool is_vpd_page_supported(int fd, int pg);
+void cleanup_udev_enumerate_ptr(void *arg); void +cleanup_udev_device_ptr(void *arg);
/*
* discovery bitmask
(quoted diff) +0 -0
b/libmultipath/libmultipath.version
index 6bdf6944..63f970b7 100644
libmultipath/libmultipath.version +6 -0
@@ -244,3 +244,9 @@ global: local: *; }; + +LIBMULTIPATH_27.1.0 { +global: + cleanup_udev_enumerate_ptr; + cleanup_udev_device_ptr; +} LIBMULTIPATH_27.0.0;
--
2.46.2
Signature · 11 lines
This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.
Benjamin Marzinski
maintainerPATCH 2/2 multipathd: set rport port_state to marginal for NVMe devices
In reply to Benjamin MarzinskiWhen a scsi path device is set to marginal, it updates the rport state. Do this for NVMe devices as well.
--- multipathd/fpin_handlers.c | 74 ++++++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 6 deletions(-)
multipathd/fpin_handlers.c +68 -6
@@ -15,6 +15,7 @@#include "debug.h" #include "util.h" #include "sysfs.h" +#include "discovery.h" #include "fpin.h" #include "devmapper.h"
@@ -253,7 +254,7 @@ static int extract_nvme_addresses_chk_path_pwwn(const char *address,* with the els wwpn ,attached_wwpn and sets the path state to * Marginal */ -static void fpin_check_set_nvme_path_marginal (uint16_t host_num,struct path *pp, +static bool fpin_check_set_nvme_path_marginal (uint16_t host_num,struct path *pp,uint64_t els_wwpn,uint64_t attached_wwpn) {struct udev_device *ctl =NULL ;
@@ -263,21 +264,79 @@ static void fpin_check_set_nvme_path_marginal(uint16_t host_num, struct path *pp ctl =udev_device_get_parent_with_subsystem_devtype (pp->udev,"nvme" ,NULL );if (ctl ==NULL ) {condlog (2 ,"%s: No parent device for " , pp->dev); -return ; +return false; } address =udev_device_get_sysattr_value (ctl,"address" );if (!address) {condlog (2 ,"%s: unable to get the address " , pp->dev); -return ; +return false; }condlog (4 ,"\n address %s: dev :%s\n" , address, pp->dev); ret =extract_nvme_addresses_chk_path_pwwn (address, els_wwpn, attached_wwpn);if (ret <=0 ) -return ; +return false; ret =fpin_add_marginal_dev_info (host_num, pp->dev);if (ret <0 ) -return ; +return false;fpin_path_setmarginal (pp); +return true; +} + +static void fpin_nvme_set_rport_marginal (uint16_t host_num,uint64_t els_wwpn) +{ +struct udev_enumerate *udev_enum =NULL ; +struct udev_list_entry *entry; + +pthread_cleanup_push (cleanup_udev_enumerate_ptr, &udev_enum); + udev_enum =udev_enumerate_new (udev); +if (!udev_enum) { +condlog (0 ,"fpin: rport udev_enumerate_new() failed: %m" ); + goto out; + } +if (udev_enumerate_add_match_subsystem (udev_enum,"fc_remote_ports" ) <0 || +udev_enumerate_add_match_is_initialized (udev_enum) <0 || +udev_enumerate_scan_devices (udev_enum) <0 ) { +condlog (0 ,"fpin: error setting up rport enumeration: %m" ); + goto out; + } +udev_list_entry_foreach (entry, + udev_enumerate_get_list_entry(udev_enum)) { +const char *devpath; +const char *rport_id, *value; +struct udev_device *rport_dev =NULL ; +uint16_t rport_hostnum; +uint64_t rport_wwpn; +unsigned int unused; + +pthread_cleanup_push (cleanup_udev_device_ptr, &rport_dev); + devpath =udev_list_entry_get_name (entry); +if (!devpath) + goto next; + rport_id =libmp_basename (devpath); +if (sscanf (rport_id,"rport-%hu:%u-%u" , &rport_hostnum, &unused, + &unused) !=3 || rport_hostnum != host_num) + goto next; + + rport_dev =udev_device_new_from_syspath (udev, devpath); +if (!rport_dev) { +condlog (0 ,"%s: error getting rport dev: %m" , rport_id); + goto next; + } + value =udev_device_get_sysattr_value (rport_dev,"port_name" ); +if (!value) { +condlog (0 ,"%s: error getting port_name: %m" , rport_id); + goto next; + } + + rport_wwpn =strtol (value,NULL ,16 ); +/* If the rport wwpn matches, set the port state to marginal */ +if (rport_wwpn == els_wwpn) +fpin_set_rport_marginal (rport_dev); +next: +pthread_cleanup_pop (1 ); + } +out: +pthread_cleanup_pop (1 ); }/*
@@ -338,6 +397,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t host_num, struct vectors *vestruct multipath *mpp;int i, k;int ret =0 ; +bool found_nvme = false;pthread_cleanup_push (cleanup_lock, &vecs->lock);lock (&vecs->lock);
@@ -348,7 +408,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t host_num, struct vectors *vecontinue ;/*checks if the bus type is nvme and the protocol is FC-NVMe*/ if ((pp->bus ==SYSFS_BUS_NVME ) && (pp->sg_id.proto_id ==NVME_PROTOCOL_FC )) { -fpin_check_set_nvme_path_marginal (host_num, pp, els_wwpn, attached_wwpn); + found_nvme =fpin_check_set_nvme_path_marginal (host_num, pp, els_wwpn, attached_wwpn) || found_nvme; }else if ((pp->bus ==SYSFS_BUS_SCSI ) && (pp->sg_id.proto_id ==SCSI_PROTOCOL_FCP ) && (host_num == pp->sg_id.host_no)) {
@@ -356,6 +416,8 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t host_num, struct vectors *vefpin_check_set_scsi_path_marginal (host_num, pp, els_wwpn); } } +if (found_nvme) +fpin_nvme_set_rport_marginal (host_num, els_wwpn);/* walk backwards because reload_and_sync_map() can remove mpp */ vector_foreach_slot_backwards(vecs->mpvec, mpp, i) {if (mpp->fpin_must_reload) {
Signature · 1 line
2.46.2
RE: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
Hi Benjamin,
Thanks for the changes.
But below is the reason why we didn't add support to set the rport port_state to marginal for NVMe devices
In the case of SCSI once rport-state is set to Marginal ,
If any pending I/O's on the marginal path hit's the scsi-timeout (after abort success) the scsi-layer checks the rport-state and If the rport-state is set to Marginal it will not do any retries on the Marginal path instead the I/O
Will be retried on the other Active paths.
This particular functionality(checking the rport-state and acting accordingly) we didn't add( as far I know) in the case of NVME and we need to check how we can handle this in the case of NVME .
That's the reason we didn't set the port state to Marginal in the case of NVMe.
In a brief SCSI layer handles the case when the rport-state is set to Marginal whereas in NVMe it doesn't(AFIK).
Atleast with the below changes we make sure that once we get the FPIN-LI notification we will set the affected path , as well as the rport-state to Marginal irrespective of SCSI and NVMe.
I am just thinking that until we have some changes in the NVME driver to handle (the rport-state to marginal) this changes doesn't show any impact in the case of NVMe
other then keeping it on par with SCSI implementation.
Please let me know your opinion on the same.
Regards,
Muneendra.
-----Original Message-----
From: Benjamin Marzinski <[email protected]>
Sent: Friday, December 20, 2024 7:33 AM
To: Christophe Varoqui <[email protected]>
Cc: device-mapper development <[email protected]>; Martin Wilck <[email protected]>; Muneendra Kumar <[email protected]>
Subject: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
When a scsi path device is set to marginal, it updates the rport state. Do this for NVMe devices as well.
FC-NVMe")
--- multipathd/fpin_handlers.c | 74 ++++++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 6 deletions(-)
multipathd/fpin_handlers.c index renamed from multipathd/fpin_handlers.c +0 -0
6b56f9b7..8b436067 100644
multipathd/fpin_handlers.c +1 -0
@@ -15,6 +15,7 @@#include "debug.h" #include "util.h" #include "sysfs.h" +#include "discovery.h" #include "fpin.h" #include "devmapper.h"
@@ -253,7 +254,7 @@ static int extract_nvme_addresses_chk_path_pwwn(const
char *address,
* with the els wwpn ,attached_wwpn and sets the path state to
* Marginal
*/
-static void fpin_check_set_nvme_path_marginal(uint16_t host_num, struct path *pp,
+static bool fpin_check_set_nvme_path_marginal(uint16_t host_num, struct +path *pp,
uint64_t els_wwpn, uint64_t attached_wwpn) {
struct udev_device *ctl = NULL;
@@ -263,21 +264,79 @@ static void fpin_check_set_nvme_path_marginal(uint16_t host_num, struct path *pp
ctl = udev_device_get_parent_with_subsystem_devtype(pp->udev,
"nvme", NULL);
if (ctl == NULL) {
condlog(2, "%s: No parent device for ", pp->dev);
- return;
+ return false;
}
address = udev_device_get_sysattr_value(ctl, "address"); if (!address) {
condlog(2, "%s: unable to get the address ", pp->dev);
- return;
+ return false;
}
condlog(4, "\n address %s: dev :%s\n", address, pp->dev); ret = extract_nvme_addresses_chk_path_pwwn(address, els_wwpn,attached_wwpn);
if (ret <= 0)
- return;
+ return false;
ret = fpin_add_marginal_dev_info(host_num, pp->dev); if (ret < 0)
- return;
+ return false;
fpin_path_setmarginal(pp);
+ return true;
+}
+
+static void fpin_nvme_set_rport_marginal(uint16_t host_num, uint64_t +els_wwpn) {
+ struct udev_enumerate *udev_enum = NULL;
+ struct udev_list_entry *entry;
+
+ pthread_cleanup_push(cleanup_udev_enumerate_ptr, &udev_enum);
+ udev_enum = udev_enumerate_new(udev);
+ if (!udev_enum) {
+ condlog(0, "fpin: rport udev_enumerate_new() failed: %m");
+ goto out;
+ }
+ if (udev_enumerate_add_match_subsystem(udev_enum,
"fc_remote_ports") < 0 ||
+ udev_enumerate_add_match_is_initialized(udev_enum) < 0 ||
+ udev_enumerate_scan_devices(udev_enum) < 0) {
+ condlog(0, "fpin: error setting up rport enumeration:
%m");
+ goto out;
+ }
+ udev_list_entry_foreach(entry,
+ udev_enumerate_get_list_entry(udev_enum))
{
+ const char *devpath;
+ const char *rport_id, *value;
+ struct udev_device *rport_dev = NULL;
+ uint16_t rport_hostnum;
+ uint64_t rport_wwpn;
+ unsigned int unused;
+
+ pthread_cleanup_push(cleanup_udev_device_ptr, &rport_dev);
+ devpath = udev_list_entry_get_name(entry);
+ if (!devpath)
+ goto next;
+ rport_id = libmp_basename(devpath);
+ if (sscanf(rport_id, "rport-%hu:%u-%u", &rport_hostnum,
&unused,
+ &unused) != 3 || rport_hostnum != host_num)
+ goto next;
+
+ rport_dev = udev_device_new_from_syspath(udev, devpath);
+ if (!rport_dev) {
+ condlog(0, "%s: error getting rport dev: %m",rport_id);
+ goto next;
+ }
+ value = udev_device_get_sysattr_value(rport_dev,
"port_name");
+ if (!value) {
+ condlog(0, "%s: error getting port_name: %m",rport_id);
+ goto next;
+ }
+
+ rport_wwpn = strtol(value, NULL, 16);
+ /* If the rport wwpn matches, set the port state to
marginal */
+ if (rport_wwpn == els_wwpn)
+ fpin_set_rport_marginal(rport_dev);
+next:
+ pthread_cleanup_pop(1);
+ }
+out:
+ pthread_cleanup_pop(1);
}
/*
@@ -338,6 +397,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t host_num, struct vectors *ve
struct multipath *mpp;
int i, k;
int ret = 0;
+ bool found_nvme = false;
pthread_cleanup_push(cleanup_lock, &vecs->lock); lock(&vecs->lock);
@@ -348,7 +408,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t host_num, struct vectors *ve
continue;
/*checks if the bus type is nvme and the protocol is
FC-NVMe*/
if ((pp->bus == SYSFS_BUS_NVME) && (pp->sg_id.proto_id ==NVME_PROTOCOL_FC)) {
- fpin_check_set_nvme_path_marginal(host_num, pp,els_wwpn, attached_wwpn);
+ found_nvme =
fpin_check_set_nvme_path_marginal(host_num, pp,
+els_wwpn, attached_wwpn) || found_nvme;
} else if ((pp->bus == SYSFS_BUS_SCSI) &&
(pp->sg_id.proto_id == SCSI_PROTOCOL_FCP) && (host_num == pp->sg_id.host_no)) {
@@ -356,6 +416,8 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t host_num, struct vectors *ve
fpin_check_set_scsi_path_marginal(host_num, pp,els_wwpn);
}
}
+ if (found_nvme)
+ fpin_nvme_set_rport_marginal(host_num, els_wwpn);
/* walk backwards because reload_and_sync_map() can remove mpp */ vector_foreach_slot_backwards(vecs->mpvec, mpp, i) {
if (mpp->fpin_must_reload) {
--
2.46.2
Signature · 11 lines
This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.
Benjamin Marzinski
maintainerRe: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
Quoted 27 lines · Muneendra Kumar M
Hi Benjamin,
Thanks for the changes.
But below is the reason why we didn't add support to set the rportport_stateto marginal for NVMe devicesIn the case of SCSI once rport-state is set to Marginal ,
If any pending I/O's on the marginal path hit's the scsi-timeout (after abort success) the scsi-layer checks the rport-state and If the rport-state is set to Marginal it will not do any retries on the Marginal path instead the I/O
Will be retried on the other Active paths.This particular functionality(checking the rport-state and acting accordingly) we didn't add( as far I know) in the case of NVME and we need to check how we can handle this in the case of NVME .
That's the reason we didn't set the port state to Marginal in the case of NVMe.In a brief SCSI layer handles the case when the rport-state is set to Marginal whereas in NVMe it doesn't(AFIK).
Atleast with the below changes we make sure that once we get the FPIN-LI notification we will set the affected path , as well as the rport-state to Marginal irrespective of SCSI and NVMe.
Quoted 6 lines
I am just thinking that until we have some changes in the NVME driver to handle (the rport-state to marginal) this changes doesn't show any impact in the case of NVMe
other then keeping it on par with SCSI implementation.Please let me know your opinion on the same.
The request to do this came because the user wanted to see which target ports were effected, but when they looked, none of them we in the Marginal state. So there is some value in this for users, even if the systems behavior doesn't change because of it.
-Ben
Quoted 194 lines
Regards,
Muneendra.-----Original Message-----
From: Benjamin Marzinski <[email protected]>
Sent: Friday, December 20, 2024 7:33 AM
To: Christophe Varoqui <[email protected]>
Cc: device-mapper development <[email protected]>; Martin Wilck <[email protected]>; Muneendra Kumar <[email protected]>
Subject: [PATCH 2/2] multipathd: set rportport_stateto marginal for NVMe devicesWhen a scsi path device is set to marginal, it updates the rport state. Do this for NVMe devices as well.
Fixes 1cada778 ("multipathd: Added support to handle FPIN-Li events forFC-NVMe")
Signed-off-by Benjamin Marzinski <[email protected]>--- multipathd/fpin_handlers.c | 74 ++++++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 6 deletions(-)multipathd/fpin_handlers.c index renamed from multipathd/fpin_handlers.c +0
-0
6b56f9b7..8b436067100644multipathd/fpin_handlers.c +3
-1@@ -15,6 +15,7 @@#include "debug.h" #include "util.h" #include "sysfs.h" +#include "discovery.h" #include "fpin.h" #include "devmapper.h" @@ -253,7 +254,7 @@ static int extract_nvme_addresses_chk_path_pwwn(constchar *address, * with the els wwpn ,attached_wwpn and sets the path state to * Marginal */ -static void fpin_check_set_nvme_path_marginal (uint16_t host_num,struct path *pp, +static bool fpin_check_set_nvme_path_marginal(uint16_t host_num, struct +path *pp, uint64_t els_wwpn, uint64_t attached_wwpn) { struct udev_device *ctl = NULL;@@ -263,21 +264,79 @@ static voidfpin_check_set_nvme_path_marginal(uint16_t
host_num, struct path *pp
ctl = udev_device_get_parent_with_subsystem_devtype(pp->udev,
"nvme", NULL);multipathd/fpin_handlers.c +2
-2if (ctl ==NULL ) {condlog (2 ,"%s: No parent device for " , pp->dev); -return ; +return false; } address =udev_device_get_sysattr_value (ctl,"address" );if (!address) {condlog (2 ,"%s: unable to get the address " , pp->dev); -return ; +return false; }condlog (4 ,"\n address %s: dev :%s\n" , address, pp->dev); ret = extract_nvme_addresses_chk_path_pwwn(address, els_wwpn,
attached_wwpn);multipathd/fpin_handlers.c +17
-2if (ret <=0 ) -return ; +return false; ret =fpin_add_marginal_dev_info (host_num, pp->dev);if (ret <0 ) -return ; +return false;fpin_path_setmarginal (pp); +return true; +} + +static void fpin_nvme_set_rport_marginal (uint16_t host_num,uint64_t +els_wwpn) { +struct udev_enumerate *udev_enum =NULL ; +struct udev_list_entry *entry; + +pthread_cleanup_push (cleanup_udev_enumerate_ptr, &udev_enum); + udev_enum =udev_enumerate_new (udev); +if (!udev_enum) { +condlog (0 ,"fpin: rport udev_enumerate_new() failed: %m" ); + goto out; + } + if (udev_enumerate_add_match_subsystem(udev_enum,"
fc_remote_ports") < 0 ||multipathd/fpin_handlers.c +3
-0+ udev_enumerate_add_match_is_initialized(udev_enum) < 0 || + udev_enumerate_scan_devices(udev_enum) < 0) { + condlog(0, "fpin: error setting up rport enumeration:%m");
multipathd/fpin_handlers.c +4
-0+ goto out; + } +udev_list_entry_foreach (entry, +udev_enumerate_get_list_entry (udev_enum)){
multipathd/fpin_handlers.c +13
-0+const char *devpath; +const char *rport_id, *value; +struct udev_device *rport_dev =NULL ; +uint16_t rport_hostnum; +uint64_t rport_wwpn; +unsigned int unused; + +pthread_cleanup_push (cleanup_udev_device_ptr, &rport_dev); + devpath =udev_list_entry_get_name (entry); +if (!devpath) + goto next; + rport_id =libmp_basename (devpath); + if (sscanf(rport_id, "rport-%hu:%u-%u", &rport_hostnum,&unused,
multipathd/fpin_handlers.c +6
-0+ &unused) != 3 || rport_hostnum != host_num) + goto next; + + rport_dev =udev_device_new_from_syspath (udev, devpath); +if (!rport_dev) { + condlog(0, "%s: error getting rport dev: %m",
rport_id);multipathd/fpin_handlers.c +3
-0+ goto next; + } + value = udev_device_get_sysattr_value(rport_dev,"
port_name");multipathd/fpin_handlers.c +2
-0+if (!value) { + condlog(0, "%s: error getting port_name: %m",
rport_id);multipathd/fpin_handlers.c +5
-0+ goto next; + } + + rport_wwpn =strtol (value,NULL ,16 ); +/* If the rport wwpn matches, set the port state to marginal */
multipathd/fpin_handlers.c +7
-0+if (rport_wwpn == els_wwpn) +fpin_set_rport_marginal (rport_dev); +next: +pthread_cleanup_pop (1 ); + } +out: +pthread_cleanup_pop (1 ); }/* @@ -338,6 +397,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t
host_num, struct vectors *vemultipathd/fpin_handlers.c +1
-0struct multipath *mpp;int i, k;int ret =0 ; +bool found_nvme = false;pthread_cleanup_push (cleanup_lock, &vecs->lock);lock (&vecs->lock);@@ -348,7 +408,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t
host_num, struct vectors *vemultipathd/fpin_handlers.c +0
-0continue ;/*checks if the bus type is nvme and the protocol is FC-NVMe*/
if ((pp->bus==SYSFS_BUS_NVME) && (pp->sg_id.proto_id==NVME_PROTOCOL_FC)) {multipathd/fpin_handlers.c +0
-1- fpin_check_set_nvme_path_marginal(host_num, pp,
els_wwpn,attached_wwpn);multipathd/fpin_handlers.c +1
-0+ found_nvme =fpin_check_set_nvme_path_marginal(host_num, pp,
multipathd/fpin_handlers.c +1
-0+els_wwpn, attached_wwpn) || found_nvme; }else if ((pp->bus ==SYSFS_BUS_SCSI ) && (pp->sg_id.proto_id ==SCSI_PROTOCOL_FCP ) && (host_num == pp->sg_id.host_no)) {@@ -356,6 +416,8 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t
host_num, struct vectors *ve
fpin_check_set_scsi_path_marginal(host_num, pp,els_wwpn);multipathd/fpin_handlers.c +2
-1} } +if (found_nvme) +fpin_nvme_set_rport_marginal (host_num, els_wwpn);/* walk backwards because reload_and_sync_map() can remove mpp */ vector_foreach_slot_backwards(vecs->mpvec, mpp, i) {if (mpp->fpin_must_reload) { --2.46.2
Signature · 11 lines
This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.
RE: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
Hi Benjamin,
Quoted 1 line
Quoted 1 line
The request to do this came because the user wanted to see which target
ports were effected, but when they looked, none of them we in the Marginal state. So there is some value in this for users, even if the systems behavior doesn't change because of it.
Thanks for the clarification.
The changes looks good.
Regards,
Muneendra.
-----Original Message-----
From: Benjamin Marzinski <[email protected]>
Sent: Monday, January 6, 2025 11:10 PM
To: Muneendra Kumar M <[email protected]>
Cc: Christophe Varoqui <[email protected]>; device-mapper development <[email protected]>; Martin Wilck <[email protected]>
Subject: Re: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
Quoted 26 lines · Muneendra Kumar M
Hi Benjamin,
Thanks for the changes.
But below is the reason why we didn't add support to set the rportport_stateto marginal for NVMe devicesIn the case of SCSI once rport-state is set to Marginal , If any pending I/O's on the marginal path hit's the scsi-timeout (after abort success) the scsi-layer checks the rport-state and If the rport-state is set to Marginal it will not do any retries on the Marginal path instead the I/O Will be retried on the other Active paths.
This particular functionality(checking the rport-state and acting accordingly) we didn't add( as far I know) in the case of NVME and we need to check how we can handle this in the case of NVME . That's the reason we didn't set the port state to Marginal in the case of NVMe.
In a brief SCSI layer handles the case when the rport-state is set to Marginal whereas in NVMe it doesn't(AFIK).
Atleast with the below changes we make sure that once we get the FPIN-LI notification we will set the affected path , as well as the rport-state to Marginal irrespective of SCSI and NVMe.
Quoted 6 lines
I am just thinking that until we have some changes in the NVME driver to handle (the rport-state to marginal) this changes doesn't show any impact in the case of NVMe other then keeping it on par with SCSI implementation.
Please let me know your opinion on the same.
The request to do this came because the user wanted to see which target ports were effected, but when they looked, none of them we in the Marginal state. So there is some value in this for users, even if the systems behavior doesn't change because of it.
-Ben
Quoted 160 lines
Regards,
Muneendra.-----Original Message-----
From: Benjamin Marzinski <[email protected]>
Sent: Friday, December 20, 2024 7:33 AM
To: Christophe Varoqui <[email protected]>
Cc: device-mapper development <[email protected]>; Martin Wilck <[email protected]>; Muneendra Kumar <[email protected]>
Subject: [PATCH 2/2] multipathd: set rportport_stateto marginal for NVMe devicesWhen a scsi path device is set to marginal, it updates the rport state. Do this for NVMe devices as well.
Fixes 1cada778 ("multipathd: Added support to handle FPIN-Li eventsfor
FC-NVMe")Signed-off-by Benjamin Marzinski <[email protected]>--- multipathd/fpin_handlers.c | 74 ++++++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 6 deletions(-)multipathd/fpin_handlers.c +0
-0index
6b56f9b7..8b436067100644multipathd/fpin_handlers.c +1
-0@@ -15,6 +15,7 @@#include "debug.h" #include "util.h" #include "sysfs.h" +#include "discovery.h" #include "fpin.h" #include "devmapper.h" @@ -253,7 +254,7 @@ static intextract_nvme_addresses_chk_path_pwwn(const
char *address,
* with the els wwpn ,attached_wwpn and sets the path state to
* Marginal
*/
-static void fpin_check_set_nvme_path_marginal(uint16_thost_num, struct path *pp,multipathd/fpin_handlers.c +2
-0+static bool fpin_check_set_nvme_path_marginal (uint16_t host_num, +struct path *pp,uint64_t els_wwpn,uint64_t attached_wwpn) {struct udev_device *ctl =NULL ;@@ -263,21 +264,79 @@ static voidfpin_check_set_nvme_path_marginal(uint16_t
host_num, struct path *pp
ctl = udev_device_get_parent_with_subsystem_devtype(pp->udev,
"nvme", NULL);multipathd/fpin_handlers.c +2
-2if (ctl ==NULL ) {condlog (2 ,"%s: No parent device for " , pp->dev); -return ; +return false; } address =udev_device_get_sysattr_value (ctl,"address" );if (!address) {condlog (2 ,"%s: unable to get the address " , pp->dev); -return ; +return false; }condlog (4 ,"\n address %s: dev :%s\n" , address, pp->dev); ret = extract_nvme_addresses_chk_path_pwwn(address, els_wwpn,
attached_wwpn);multipathd/fpin_handlers.c +17
-2if (ret <=0 ) -return ; +return false; ret =fpin_add_marginal_dev_info (host_num, pp->dev);if (ret <0 ) -return ; +return false;fpin_path_setmarginal (pp); +return true; +} + +static void fpin_nvme_set_rport_marginal (uint16_t host_num,uint64_t +els_wwpn) { +struct udev_enumerate *udev_enum =NULL ; +struct udev_list_entry *entry; + +pthread_cleanup_push (cleanup_udev_enumerate_ptr, &udev_enum); + udev_enum =udev_enumerate_new (udev); +if (!udev_enum) { +condlog (0 ,"fpin: rport udev_enumerate_new() failed: %m" ); + goto out; + } + if (udev_enumerate_add_match_subsystem(udev_enum,"
fc_remote_ports") < 0 ||multipathd/fpin_handlers.c +3
-0+ udev_enumerate_add_match_is_initialized(udev_enum) < 0 || + udev_enumerate_scan_devices(udev_enum) < 0) { + condlog(0, "fpin: error setting up rport enumeration:%m");
multipathd/fpin_handlers.c +4
-0+ goto out; + } +udev_list_entry_foreach (entry, +udev_enumerate_get_list_entry (udev_enum)){
multipathd/fpin_handlers.c +13
-0+const char *devpath; +const char *rport_id, *value; +struct udev_device *rport_dev =NULL ; +uint16_t rport_hostnum; +uint64_t rport_wwpn; +unsigned int unused; + +pthread_cleanup_push (cleanup_udev_device_ptr, &rport_dev); + devpath =udev_list_entry_get_name (entry); +if (!devpath) + goto next; + rport_id =libmp_basename (devpath); + if (sscanf(rport_id, "rport-%hu:%u-%u", &rport_hostnum,&unused,
multipathd/fpin_handlers.c +6
-0+ &unused) != 3 || rport_hostnum != host_num) + goto next; + + rport_dev =udev_device_new_from_syspath (udev, devpath); +if (!rport_dev) { + condlog(0, "%s: error getting rport dev: %m",
rport_id);multipathd/fpin_handlers.c +3
-0+ goto next; + } + value = udev_device_get_sysattr_value(rport_dev,"
port_name");multipathd/fpin_handlers.c +2
-0+if (!value) { + condlog(0, "%s: error getting port_name: %m",
rport_id);multipathd/fpin_handlers.c +5
-0+ goto next; + } + + rport_wwpn =strtol (value,NULL ,16 ); +/* If the rport wwpn matches, set the port state to marginal */
multipathd/fpin_handlers.c +7
-0+if (rport_wwpn == els_wwpn) +fpin_set_rport_marginal (rport_dev); +next: +pthread_cleanup_pop (1 ); + } +out: +pthread_cleanup_pop (1 ); }/* @@ -338,6 +397,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t
host_num, struct vectors *vemultipathd/fpin_handlers.c +1
-0struct multipath *mpp;int i, k;int ret =0 ; +bool found_nvme = false;pthread_cleanup_push (cleanup_lock, &vecs->lock);lock (&vecs->lock);@@ -348,7 +408,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t
host_num, struct vectors *ve
multipathd/fpin_handlers.c
Quoted 2 lines
multipathd/fpin_handlers.c +0
-0continue ;/*checks if the bus type is nvme and the protocol is
FC-NVMe*/
multipathd/fpin_handlers.c
Quoted 10 lines
if ((
pp->bus==SYSFS_BUS_NVME) && (pp->sg_id.proto_id==NVME_PROTOCOL_FC)) {multipathd/fpin_handlers.c +0
-1- fpin_check_set_nvme_path_marginal(host_num, pp,
els_wwpn,attached_wwpn);multipathd/fpin_handlers.c +1
-0+ found_nvme =fpin_check_set_nvme_path_marginal(host_num, pp,
multipathd/fpin_handlers.c +1
-0+els_wwpn, attached_wwpn) || found_nvme; }else if ((pp->bus ==SYSFS_BUS_SCSI ) && (pp->sg_id.proto_id ==SCSI_PROTOCOL_FCP ) && (host_num == pp->sg_id.host_no)) { @@ -356,6
+416,8 @@ static int
Quoted 3 lines
fpin_chk_wwn_setpath_marginal(uint16_t
host_num, struct vectors *ve
fpin_check_set_scsi_path_marginal(host_num, pp,
els_wwpn);
Quoted 10 lines
multipathd/fpin_handlers.c +2
-1} } +if (found_nvme) +fpin_nvme_set_rport_marginal (host_num, els_wwpn);/* walk backwards because reload_and_sync_map() can remove mpp */ vector_foreach_slot_backwards(vecs->mpvec, mpp, i) {if (mpp->fpin_must_reload) { --2.46.2
Quoted 12 lines
--
This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer,
and destroy any printed copy of it.
Signature · 11 lines
This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.
Muneendra Kumar M
Reviewed-byRE: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
-----Original Message-----
From: Muneendra Kumar M <[email protected]>
Sent: Thursday, January 9, 2025 11:34 AM
To: 'Benjamin Marzinski' <[email protected]>
Cc: 'Christophe Varoqui' <[email protected]>; 'device-mapper development' <[email protected]>; 'Martin Wilck' <[email protected]>
Subject: RE: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
Hi Benjamin,
Quoted 1 line
Quoted 1 line
The request to do this came because the user wanted to see which target
ports were effected, but when they looked, none of them we in the Marginal state. So there is some value in this for users, even if the systems behavior doesn't change because of it.
Thanks for the clarification.
The changes looks good.
Regards,
Muneendra.
-----Original Message-----
From: Benjamin Marzinski <[email protected]>
Sent: Monday, January 6, 2025 11:10 PM
To: Muneendra Kumar M <[email protected]>
Cc: Christophe Varoqui <[email protected]>; device-mapper development <[email protected]>; Martin Wilck <[email protected]>
Subject: Re: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
Quoted 26 lines · Muneendra Kumar M
Hi Benjamin,
Thanks for the changes.
But below is the reason why we didn't add support to set the rportport_stateto marginal for NVMe devicesIn the case of SCSI once rport-state is set to Marginal , If any pending I/O's on the marginal path hit's the scsi-timeout (after abort success) the scsi-layer checks the rport-state and If the rport-state is set to Marginal it will not do any retries on the Marginal path instead the I/O Will be retried on the other Active paths.
This particular functionality(checking the rport-state and acting accordingly) we didn't add( as far I know) in the case of NVME and we need to check how we can handle this in the case of NVME . That's the reason we didn't set the port state to Marginal in the case of NVMe.
In a brief SCSI layer handles the case when the rport-state is set to Marginal whereas in NVMe it doesn't(AFIK).
Atleast with the below changes we make sure that once we get the FPIN-LI notification we will set the affected path , as well as the rport-state to Marginal irrespective of SCSI and NVMe.
Quoted 6 lines
I am just thinking that until we have some changes in the NVME driver to handle (the rport-state to marginal) this changes doesn't show any impact in the case of NVMe other then keeping it on par with SCSI implementation.
Please let me know your opinion on the same.
The request to do this came because the user wanted to see which target ports were effected, but when they looked, none of them we in the Marginal state. So there is some value in this for users, even if the systems behavior doesn't change because of it.
-Ben
Quoted 160 lines
Regards,
Muneendra.-----Original Message-----
From: Benjamin Marzinski <[email protected]>
Sent: Friday, December 20, 2024 7:33 AM
To: Christophe Varoqui <[email protected]>
Cc: device-mapper development <[email protected]>; Martin Wilck <[email protected]>; Muneendra Kumar <[email protected]>
Subject: [PATCH 2/2] multipathd: set rportport_stateto marginal for NVMe devicesWhen a scsi path device is set to marginal, it updates the rport state. Do this for NVMe devices as well.
Fixes 1cada778 ("multipathd: Added support to handle FPIN-Li eventsfor
FC-NVMe")Signed-off-by Benjamin Marzinski <[email protected]>--- multipathd/fpin_handlers.c | 74 ++++++++++++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 6 deletions(-)multipathd/fpin_handlers.c +0
-0index
6b56f9b7..8b436067100644multipathd/fpin_handlers.c +1
-0@@ -15,6 +15,7 @@#include "debug.h" #include "util.h" #include "sysfs.h" +#include "discovery.h" #include "fpin.h" #include "devmapper.h" @@ -253,7 +254,7 @@ static intextract_nvme_addresses_chk_path_pwwn(const
char *address,
* with the els wwpn ,attached_wwpn and sets the path state to
* Marginal
*/
-static void fpin_check_set_nvme_path_marginal(uint16_thost_num, struct path *pp,multipathd/fpin_handlers.c +2
-0+static bool fpin_check_set_nvme_path_marginal (uint16_t host_num, +struct path *pp,uint64_t els_wwpn,uint64_t attached_wwpn) {struct udev_device *ctl =NULL ;@@ -263,21 +264,79 @@ static voidfpin_check_set_nvme_path_marginal(uint16_t
host_num, struct path *pp
ctl = udev_device_get_parent_with_subsystem_devtype(pp->udev,
"nvme", NULL);multipathd/fpin_handlers.c +2
-2if (ctl ==NULL ) {condlog (2 ,"%s: No parent device for " , pp->dev); -return ; +return false; } address =udev_device_get_sysattr_value (ctl,"address" );if (!address) {condlog (2 ,"%s: unable to get the address " , pp->dev); -return ; +return false; }condlog (4 ,"\n address %s: dev :%s\n" , address, pp->dev); ret = extract_nvme_addresses_chk_path_pwwn(address, els_wwpn,
attached_wwpn);multipathd/fpin_handlers.c +17
-2if (ret <=0 ) -return ; +return false; ret =fpin_add_marginal_dev_info (host_num, pp->dev);if (ret <0 ) -return ; +return false;fpin_path_setmarginal (pp); +return true; +} + +static void fpin_nvme_set_rport_marginal (uint16_t host_num,uint64_t +els_wwpn) { +struct udev_enumerate *udev_enum =NULL ; +struct udev_list_entry *entry; + +pthread_cleanup_push (cleanup_udev_enumerate_ptr, &udev_enum); + udev_enum =udev_enumerate_new (udev); +if (!udev_enum) { +condlog (0 ,"fpin: rport udev_enumerate_new() failed: %m" ); + goto out; + } + if (udev_enumerate_add_match_subsystem(udev_enum,"
fc_remote_ports") < 0 ||multipathd/fpin_handlers.c +3
-0+ udev_enumerate_add_match_is_initialized(udev_enum) < 0 || + udev_enumerate_scan_devices(udev_enum) < 0) { + condlog(0, "fpin: error setting up rport enumeration:%m");
multipathd/fpin_handlers.c +4
-0+ goto out; + } +udev_list_entry_foreach (entry, +udev_enumerate_get_list_entry (udev_enum)){
multipathd/fpin_handlers.c +13
-0+const char *devpath; +const char *rport_id, *value; +struct udev_device *rport_dev =NULL ; +uint16_t rport_hostnum; +uint64_t rport_wwpn; +unsigned int unused; + +pthread_cleanup_push (cleanup_udev_device_ptr, &rport_dev); + devpath =udev_list_entry_get_name (entry); +if (!devpath) + goto next; + rport_id =libmp_basename (devpath); + if (sscanf(rport_id, "rport-%hu:%u-%u", &rport_hostnum,&unused,
multipathd/fpin_handlers.c +6
-0+ &unused) != 3 || rport_hostnum != host_num) + goto next; + + rport_dev =udev_device_new_from_syspath (udev, devpath); +if (!rport_dev) { + condlog(0, "%s: error getting rport dev: %m",
rport_id);multipathd/fpin_handlers.c +3
-0+ goto next; + } + value = udev_device_get_sysattr_value(rport_dev,"
port_name");multipathd/fpin_handlers.c +2
-0+if (!value) { + condlog(0, "%s: error getting port_name: %m",
rport_id);multipathd/fpin_handlers.c +5
-0+ goto next; + } + + rport_wwpn =strtol (value,NULL ,16 ); +/* If the rport wwpn matches, set the port state to marginal */
multipathd/fpin_handlers.c +7
-0+if (rport_wwpn == els_wwpn) +fpin_set_rport_marginal (rport_dev); +next: +pthread_cleanup_pop (1 ); + } +out: +pthread_cleanup_pop (1 ); }/* @@ -338,6 +397,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t
host_num, struct vectors *vemultipathd/fpin_handlers.c +1
-0struct multipath *mpp;int i, k;int ret =0 ; +bool found_nvme = false;pthread_cleanup_push (cleanup_lock, &vecs->lock);lock (&vecs->lock);@@ -348,7 +408,7 @@ static int fpin_chk_wwn_setpath_marginal(uint16_t
host_num, struct vectors *ve
multipathd/fpin_handlers.c
Quoted 2 lines
multipathd/fpin_handlers.c +0
-0continue ;/*checks if the bus type is nvme and the protocol is
FC-NVMe*/
multipathd/fpin_handlers.c
Quoted 10 lines
if ((
pp->bus==SYSFS_BUS_NVME) && (pp->sg_id.proto_id==NVME_PROTOCOL_FC)) {multipathd/fpin_handlers.c +0
-1- fpin_check_set_nvme_path_marginal(host_num, pp,
els_wwpn,attached_wwpn);multipathd/fpin_handlers.c +1
-0+ found_nvme =fpin_check_set_nvme_path_marginal(host_num, pp,
multipathd/fpin_handlers.c +1
-0+els_wwpn, attached_wwpn) || found_nvme; }else if ((pp->bus ==SYSFS_BUS_SCSI ) && (pp->sg_id.proto_id ==SCSI_PROTOCOL_FCP ) && (host_num == pp->sg_id.host_no)) { @@ -356,6
+416,8 @@ static int
Quoted 3 lines
fpin_chk_wwn_setpath_marginal(uint16_t
host_num, struct vectors *ve
fpin_check_set_scsi_path_marginal(host_num, pp,
els_wwpn);
Quoted 10 lines
multipathd/fpin_handlers.c +2
-1} } +if (found_nvme) +fpin_nvme_set_rport_marginal (host_num, els_wwpn);/* walk backwards because reload_and_sync_map() can remove mpp */ vector_foreach_slot_backwards(vecs->mpvec, mpp, i) {if (mpp->fpin_must_reload) { --2.46.2
Quoted 12 lines
--
This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer,
and destroy any printed copy of it.
Signature · 11 lines
This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.
Re: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
In reply to Benjamin MarzinskiQuoted 42 lines · Benjamin Marzinski
Quoted 41 lines · Muneendra Kumar M
Hi Benjamin,
Thanks for the changes.
But below is the reason why we didn't add support to set the rportport_stateto marginal for NVMe devicesIn the case of SCSI once rport-state is set to Marginal , If any pending I/O's on the marginal path hit's the scsi-timeout (after
abort success) the scsi-layer checks the rport-state and If the rport-state is set to Marginal it will not do any retries on the Marginal
path instead the I/O
Will be retried on the other Active paths.This particular functionality(checking the rport-state and acting accordingly) we didn't add( as far I know) in the case of NVME and we need
to check how we can handle this in the case of NVME . That's the reason we didn't set the port state to Marginal in the case of
NVMe.In a brief SCSI layer handles the case when the rport-state is set to
Marginal whereas in NVMe it doesn't(AFIK).Atleast with the below changes we make sure that once we get the FPIN-LI
notification we will set the affected path , as well as the rport- state to
Marginal irrespective of SCSI and NVMe.I am just thinking that until we have some changes in the NVME driver to
handle (the rport-state to marginal) this changes doesn't show any impact
in the case of NVMe
other then keeping it on par with SCSI implementation.
Quoted 7 lines
Quoted 1 line
Please let me know your opinion on the same.
The request to do this came because the user wanted to see which target
ports were effected, but when they looked, none of them we in the Marginal state. So there is some value in this for users, even if the systems behavior doesn't change because of it.
Please add a note to the commit message explaining this.
I'm actually a bit concerned about it ... won't other users be even more confused when they see the path devices as marginal but don't observe any change in the system's usage of these paths?
Regards,
Martin
Benjamin Marzinski
maintainerRe: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
Quoted 51 lines · Martin Wilck
Quoted 42 lines · Benjamin Marzinski
Quoted 41 lines · Muneendra Kumar M
Hi Benjamin,
Thanks for the changes.
But below is the reason why we didn't add support to set the rportport_stateto marginal for NVMe devicesIn the case of SCSI once rport-state is set to Marginal , If any pending I/O's on the marginal path hit's the scsi-timeout (after
abort success) the scsi-layer checks the rport-state and If the rport-state is set to Marginal it will not do any retries on the Marginal
path instead the I/O
Will be retried on the other Active paths.This particular functionality(checking the rport-state and acting accordingly) we didn't add( as far I know) in the case of NVME and we need
to check how we can handle this in the case of NVME . That's the reason we didn't set the port state to Marginal in the case of
NVMe.In a brief SCSI layer handles the case when the rport-state is set to
Marginal whereas in NVMe it doesn't(AFIK).Atleast with the below changes we make sure that once we get the FPIN-LI
notification we will set the affected path , as well as the rport- state to
Marginal irrespective of SCSI and NVMe.I am just thinking that until we have some changes in the NVME driver to
handle (the rport-state to marginal) this changes doesn't show any impact
in the case of NVMe
other then keeping it on par with SCSI implementation.Quoted 7 lines
Quoted 1 line
Please let me know your opinion on the same.
The request to do this came because the user wanted to see which target
ports were effected, but when they looked, none of them we in the Marginal state. So there is some value in this for users, even if the systems behavior doesn't change because of it.
Quoted 5 lines
Please add a note to the commit message explaining this.
I'm actually a bit concerned about it ... won't other users be even more confused when they see the path devices as marginal but don't observe any change in the system's usage of these paths?
Sure, I can add a commit message. But while this isn't implemented in the NVMe layer, multipath will still route future IO differently. So, any IO that multipath has already dispatched to the now marginal path won't get treated differently, users will notice a change in IO patterns going forward. Right?
-Ben
Quoted 3 lines
Regards,
Martin
Re: [PATCH 2/2] multipathd: set rport port_state to marginal for NVMe devices
Quoted 71 lines · Benjamin Marzinski
Quoted 64 lines · Martin Wilck
Quoted 54 lines · Benjamin Marzinski
Quoted 52 lines · Muneendra Kumar M
Hi Benjamin,
Thanks for the changes.
But below is the reason why we didn't add support to set the rportport_stateto marginal for NVMe devicesIn the case of SCSI once rport-state is set to Marginal , If any pending I/O's on the marginal path hit's the scsi- timeout
(after
abort success) the scsi-layer checks the rport-state and If the
rport-state is set to Marginal it will not do any retries on the
Marginal
path instead the I/O
Will be retried on the other Active paths.This particular functionality(checking the rport-state and acting
accordingly) we didn't add( as far I know) in the case of NVME and
we need
to check how we can handle this in the case of NVME . That's the reason we didn't set the port state to Marginal in the
case of
NVMe.In a brief SCSI layer handles the case when the rport-state is set
to
Marginal whereas in NVMe it doesn't(AFIK).Atleast with the below changes we make sure that once we get the
FPIN-LI
notification we will set the affected path , as well as the rport-
state to
Marginal irrespective of SCSI and NVMe.I am just thinking that until we have some changes in the NVME driver to
handle (the rport-state to marginal) this changes doesn't show any
impact
in the case of NVMe
other then keeping it on par with SCSI implementation.Quoted 8 lines
Quoted 1 line
Please let me know your opinion on the same.
The request to do this came because the user wanted to see which target
ports were effected, but when they looked, none of them we in the Marginal state. So there is some value in this for users, even if the
systems behavior doesn't change because of it.Quoted 5 lines
Please add a note to the commit message explaining this.
I'm actually a bit concerned about it ... won't other users be even more confused when they see the path devices as marginal but don't observe any change in the system's usage of these paths?
Quoted 6 lines
Sure, I can add a commit message. But while this isn't implemented in the NVMe layer, multipath will still route future IO differently. So, any IO that multipath has already dispatched to the now marginal path won't get treated differently, users will notice a change in IO patterns
going forward. Right?
Ok. I may have misunderstood Muneendra's reply. I admit I didn't double check in depth. I may also have mixed up native and dm multipath behavior.
Regards
Martin
Quoted 9 lines · Benjamin Marzinski
When multipathd handles link integrity FPIN events, it sets the rport associated with the effected SCSI paths to Marginal. These patches make
it do the same thing for NVMe paths.I actually have a stupid Fibre Channel question. Does the host number and the target wwpn uniquely identfy an rport? I never see the channel
set to anything other than 0, but I don't think that it MUST be 0.
IMO, yes. As the WWPN is unique, it's by itself sufficient to identify the physical remote port. By adding the host number,
which corresponds to a unique WWPN on the host, you uniquely identify the Linux fc_remote_port.
This also fits the fc symlinks that udev creates under by-path.
Quoted 4 lines
But
if we knew that there was only one rport for a given host number and target WWPN, we could stop checking as soon as we found one. These patches don't do that. They check all the rports.
I think we could stop if the WWPN is found.
Martin
Quoted 12 lines
Benjamin Marzinski (2):
libmultipath: export udev pthread cleanup functions
multipathd: set rportport_stateto marginal for NVMe deviceslibmultipath/discovery.c | 4 +- libmultipath/discovery.h | 2 + libmultipath/libmultipath.version | 6 +++ multipathd/fpin_handlers.c | 74 ++++++++++++++++++++++++++++- --
4 files changed, 78 insertions(+), 8 deletions(-)