Re: [PATCH] use LUN association and SNS ID type for the VPD (0x83) page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 02 Mar 2009 10:29:27 +0200
Or Gerlitz <ogerlitz@xxxxxxxxxxxx> wrote:

> FUJITA Tomonori wrote:
> > The following looks fine?
> >   
> basically yes, please merge, however the change-log is inaccurate, 
> please see below and decide if you
> want to update the change-log (not a must per my opinion).
> > =
> > From: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
> > Subject: [PATCH] spc: change vpd page 0x83 scheme
> >
> > 1. doesn't report protocol id anymore (PIV set to zero)
> > 2. reports LUN association (zero) instead of target port association
> > 3. reports T10 identifier type instead of vendor specific
> > 4. uses the T10 IET assigned name in the identifier
> >
> > VMware needs LUN association. 3) and 4) changes are not necessary
> > though. The further information is available at:
> > http://lists.wpkg.org/pipermail/stgt/2009-February/002652.html
> >   
> Its incorrect to say that 3 and 4 are not needed as they actually are 
> needed for operation with vmware. This is b/c the vendor specific 
> identifier type is not among the list of vmware supported id types and 
> T10 is.

Thanks a lot, I see.

How about this?

=
From: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
Subject: [PATCH] spc: change vpd page 0x83 scheme

1. doesn't report protocol id anymore (PIV set to zero)
2. reports LUN association (zero) instead of target port association
3. reports T10 identifier type instead of vendor specific
4. uses the T10 IET assigned name in the identifier

The first change is necessary because we don't report protocol id
properly (we always uses iSCSI). Let's just drop PIV bit (means that
the protocol id is not supported) as the majority of SCSI target
devices do.

The 2th, 3th and 4th changes are for VMware: VMware needs LUN
association; The vendor specific identifier type is not among the list
of VMware supported id types and T10 is.

Thanks to Or Gerlitz <ogerlitz@xxxxxxxxxxxx> for pointing out this
problem and providing a first version of the fix.

The further information is available at:

http://lists.wpkg.org/pipermail/stgt/2009-February/002652.html

Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
---
 usr/spc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/usr/spc.c b/usr/spc.c
index ac5c3de..2fc8e8e 100644
--- a/usr/spc.c
+++ b/usr/spc.c
@@ -133,8 +133,8 @@ static void update_vpd_83(struct scsi_lu *lu, void *id)
 	struct vpd *vpd_pg = lu->attrs.lu_vpd[3];
 	uint8_t	*data = vpd_pg->data;
 
-	data[0] = (PIV_ISCSI << 4) | INQ_CODE_ASCII;
-	data[1] = PIV_VALID | ASS_TGT_PORT | DESG_VENDOR;
+	data[0] = INQ_CODE_ASCII;
+	data[1] = DESG_T10;
 	data[3] = SCSI_ID_LEN;
 
 	strncpy((char *)data + 4, id, SCSI_ID_LEN);
@@ -1029,7 +1029,7 @@ int spc_lu_init(struct scsi_lu *lu)
 	snprintf(lu->attrs.product_rev, sizeof(lu->attrs.product_rev),
 		 "%s", "0001");
 	snprintf(lu->attrs.scsi_id, sizeof(lu->attrs.scsi_id),
-		 "deadbeaf%d:%" PRIu64, tgt->tid, lu->lun);
+		 "IET     %04x%04" PRIx64, tgt->tid, lu->lun);
 	snprintf(lu->attrs.scsi_sn, sizeof(lu->attrs.scsi_sn),
 		 "beaf%d%" PRIu64, tgt->tid, lu->lun);
 
-- 
1.6.0.6



--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux