diff mbox

[2/2] multipath-tools: output more topology info for NVMe discovery

Message ID 1507793730-13400-1-git-send-email-yangjie65@huawei.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

y00378701 Oct. 12, 2017, 7:35 a.m. UTC
Assign sg_id.channel to controller id of the NVMe/NVMf target
and assign sg_id.lun to namespace ID of the target.

Signed-off-by: Jie Yang yangjie65@huawei.com
Reviewed-by: Guan Junxiong guanjunxiong@huawei.com
---
 libmultipath/discovery.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Christophe Varoqui Nov. 15, 2017, 10:40 p.m. UTC | #1
Hi,

this patch seems to be orphaned from its patchset.
Do you maintain your request for inclusion ?

Thanks.

On Thu, Oct 12, 2017 at 9:35 AM, y00378701 <yangjie65@huawei.com> wrote:

> Assign sg_id.channel to controller id of the NVMe/NVMf target
> and assign sg_id.lun to namespace ID of the target.
>
> Signed-off-by: Jie Yang yangjie65@huawei.com
> Reviewed-by: Guan Junxiong guanjunxiong@huawei.com
> ---
>  libmultipath/discovery.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
> index efac824..f1d303e 100644
> --- a/libmultipath/discovery.c
> +++ b/libmultipath/discovery.c
> @@ -1206,12 +1206,14 @@ nvme_sysfs_pathinfo (struct path * pp, vector
> hwtable)
>                    &pp->sg_id.scsi_id) != 2)
>                 return 1;
>         pp->sg_id.channel = 0;
> -       pp->sg_id.lun = 0;
> +       pp->sg_id.lun = atoi(udev_device_get_sysattr_value(pp->udev,
> "nsid"));
>
>         parent = udev_device_get_parent(pp->udev);
>         if (!parent)
>                 return 1;
>
> +       pp->sg_id.channel = atoi(udev_device_get_sysattr_value(parent,
> "cntlid"));
> +
>         snprintf(pp->vendor_id, SCSI_VENDOR_SIZE, "NVME");
>         snprintf(pp->product_id, SCSI_PRODUCT_SIZE, "%s",
>                  udev_device_get_sysattr_value(parent, "model"));
> --
> 2.8.1.windows.1
>
>
>
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index efac824..f1d303e 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -1206,12 +1206,14 @@  nvme_sysfs_pathinfo (struct path * pp, vector hwtable)
 		   &pp->sg_id.scsi_id) != 2)
 		return 1;
 	pp->sg_id.channel = 0;
-	pp->sg_id.lun = 0;
+	pp->sg_id.lun = atoi(udev_device_get_sysattr_value(pp->udev, "nsid"));
 
 	parent = udev_device_get_parent(pp->udev);
 	if (!parent)
 		return 1;
 
+	pp->sg_id.channel = atoi(udev_device_get_sysattr_value(parent, "cntlid"));
+
 	snprintf(pp->vendor_id, SCSI_VENDOR_SIZE, "NVME");
 	snprintf(pp->product_id, SCSI_PRODUCT_SIZE, "%s",
 		 udev_device_get_sysattr_value(parent, "model"));