All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* spc: Support NAA IEEE Registered Extended field in VPD page 0x83
@ 2014-02-25 12:54 Or Gerlitz
  2014-03-03 17:14 ` Or Gerlitz
  2014-03-08 12:40 ` FUJITA Tomonori
  0 siblings, 2 replies; 8+ messages in thread
From: Or Gerlitz @ 2014-02-25 12:54 UTC (permalink / raw
  To: fujita.tomonori; +Cc: stgt, Dennis Cullison, Or Gerlitz

From: Dennis Cullison <Dennis.Cullison@Teradata.com>

Enables support for the NAA IEEE Registered Extended field in the
inquiry VPD page 0x83. This field is used by multi-pathing
software for device persistency.

Signed-off-by: Dennis Cullison <Dennis.Cullison@Teradata.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---

Hi Tomo, 

This fix is from Dennis Cullison who asked me to assist in submission

Or.

 usr/spc.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/usr/spc.c b/usr/spc.c
index 29f39a9..0dd590f 100644
--- a/usr/spc.c
+++ b/usr/spc.c
@@ -145,6 +145,12 @@ static void update_vpd_83(struct scsi_lu *lu, void *id)
 	struct vpd *vpd_pg = lu->attrs.lu_vpd[PCODE_OFFSET(0x83)];
 	uint8_t	*data = vpd_pg->data;
 
+	char *id_str = id;
+	char subs[] = "0";
+	unsigned long a = 0;
+	unsigned long b = 0;
+	unsigned long c;
+
 	data[0] = INQ_CODE_ASCII;
 	data[1] = DESG_T10;
 	data[3] = SCSI_ID_LEN;
@@ -160,6 +166,24 @@ static void update_vpd_83(struct scsi_lu *lu, void *id)
 
 	put_unaligned_be64(lu->attrs.numeric_id, data);
 	data[0] |= NAA_LOCAL << 4;
+
+	data += NAA_DESG_LEN;
+	data[0] = INQ_CODE_BIN;
+	data[1] = DESG_NAA;
+	data[3] = NAA_DESG_LEN_EXTD;
+	data += DESG_HDR_LEN;
+	while (*id_str) {
+		subs[0] = *id_str++;
+		c = a >> 60;
+		a <<= 4;
+		b <<= 4;
+		b |= c;
+		a |= strtoul(subs, NULL, 16);
+	}
+	put_unaligned_be64(b, data);
+	put_unaligned_be64(a, data + 8);
+	data[0] &= 0x0F;
+	data[0] |= NAA_IEEE_REGD_EXTD << 4;
 }
 
 static void update_vpd_b2(struct scsi_lu *lu, void *id)
@@ -2060,7 +2084,7 @@ int spc_lu_init(struct scsi_lu *lu)
 
 	/* VPD page 0x83 */
 	pg = PCODE_OFFSET(0x83);
-	lu_vpd[pg] = alloc_vpd(2*DESG_HDR_LEN + NAA_DESG_LEN + SCSI_ID_LEN);
+	lu_vpd[pg] = alloc_vpd(3*DESG_HDR_LEN + NAA_DESG_LEN + SCSI_ID_LEN + NAA_DESG_LEN_EXTD);
 	if (!lu_vpd[pg])
 		return -ENOMEM;
 	lu_vpd[pg]->vpd_update = update_vpd_83;
-- 
1.7.1

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

* Re: spc: Support NAA IEEE Registered Extended field in VPD page 0x83
  2014-02-25 12:54 spc: Support NAA IEEE Registered Extended field in VPD page 0x83 Or Gerlitz
@ 2014-03-03 17:14 ` Or Gerlitz
  2014-03-03 22:28   ` FUJITA Tomonori
  2014-03-08 12:40 ` FUJITA Tomonori
  1 sibling, 1 reply; 8+ messages in thread
From: Or Gerlitz @ 2014-03-03 17:14 UTC (permalink / raw
  To: FUJITA Tomonori; +Cc: stgt, Dennis Cullison

On 25/02/2014 14:54, Or Gerlitz wrote:
> From: Dennis Cullison <Dennis.Cullison@Teradata.com>
>
> Enables support for the NAA IEEE Registered Extended field in the
> inquiry VPD page 0x83. This field is used by multi-pathing
> software for device persistency.

Hi Tomo,

I didn't see a comment from you on this patch, did you get it?

Or.


> Signed-off-by: Dennis Cullison <Dennis.Cullison@Teradata.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> ---
>
> Hi Tomo,
>
> This fix is from Dennis Cullison who asked me to assist in submission
>
> Or.
>
>   usr/spc.c |   26 +++++++++++++++++++++++++-
>   1 files changed, 25 insertions(+), 1 deletions(-)
>
> diff --git a/usr/spc.c b/usr/spc.c
> index 29f39a9..0dd590f 100644
> --- a/usr/spc.c
> +++ b/usr/spc.c
> @@ -145,6 +145,12 @@ static void update_vpd_83(struct scsi_lu *lu, void *id)
>   	struct vpd *vpd_pg = lu->attrs.lu_vpd[PCODE_OFFSET(0x83)];
>   	uint8_t	*data = vpd_pg->data;
>   
> +	char *id_str = id;
> +	char subs[] = "0";
> +	unsigned long a = 0;
> +	unsigned long b = 0;
> +	unsigned long c;
> +
>   	data[0] = INQ_CODE_ASCII;
>   	data[1] = DESG_T10;
>   	data[3] = SCSI_ID_LEN;
> @@ -160,6 +166,24 @@ static void update_vpd_83(struct scsi_lu *lu, void *id)
>   
>   	put_unaligned_be64(lu->attrs.numeric_id, data);
>   	data[0] |= NAA_LOCAL << 4;
> +
> +	data += NAA_DESG_LEN;
> +	data[0] = INQ_CODE_BIN;
> +	data[1] = DESG_NAA;
> +	data[3] = NAA_DESG_LEN_EXTD;
> +	data += DESG_HDR_LEN;
> +	while (*id_str) {
> +		subs[0] = *id_str++;
> +		c = a >> 60;
> +		a <<= 4;
> +		b <<= 4;
> +		b |= c;
> +		a |= strtoul(subs, NULL, 16);
> +	}
> +	put_unaligned_be64(b, data);
> +	put_unaligned_be64(a, data + 8);
> +	data[0] &= 0x0F;
> +	data[0] |= NAA_IEEE_REGD_EXTD << 4;
>   }
>   
>   static void update_vpd_b2(struct scsi_lu *lu, void *id)
> @@ -2060,7 +2084,7 @@ int spc_lu_init(struct scsi_lu *lu)
>   
>   	/* VPD page 0x83 */
>   	pg = PCODE_OFFSET(0x83);
> -	lu_vpd[pg] = alloc_vpd(2*DESG_HDR_LEN + NAA_DESG_LEN + SCSI_ID_LEN);
> +	lu_vpd[pg] = alloc_vpd(3*DESG_HDR_LEN + NAA_DESG_LEN + SCSI_ID_LEN + NAA_DESG_LEN_EXTD);
>   	if (!lu_vpd[pg])
>   		return -ENOMEM;
>   	lu_vpd[pg]->vpd_update = update_vpd_83;

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

* Re: spc: Support NAA IEEE Registered Extended field in VPD page 0x83
  2014-03-03 17:14 ` Or Gerlitz
@ 2014-03-03 22:28   ` FUJITA Tomonori
  2014-03-04  8:48     ` Or Gerlitz
  0 siblings, 1 reply; 8+ messages in thread
From: FUJITA Tomonori @ 2014-03-03 22:28 UTC (permalink / raw
  To: ogerlitz; +Cc: stgt, Dennis.Cullison

On Mon, 3 Mar 2014 19:14:28 +0200
Or Gerlitz <ogerlitz@mellanox.com> wrote:

> On 25/02/2014 14:54, Or Gerlitz wrote:
>> From: Dennis Cullison <Dennis.Cullison@Teradata.com>
>>
>> Enables support for the NAA IEEE Registered Extended field in the
>> inquiry VPD page 0x83. This field is used by multi-pathing
>> software for device persistency.
> 
> Hi Tomo,
> 
> I didn't see a comment from you on this patch, did you get it?

Oops, sorry. I wanted to check the spec then forgot. What pages and
spec are related with this patch?

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

* Re: spc: Support NAA IEEE Registered Extended field in VPD page 0x83
  2014-03-03 22:28   ` FUJITA Tomonori
@ 2014-03-04  8:48     ` Or Gerlitz
  2014-03-04 17:08       ` Cullison, Dennis
  0 siblings, 1 reply; 8+ messages in thread
From: Or Gerlitz @ 2014-03-04  8:48 UTC (permalink / raw
  To: FUJITA Tomonori, Dennis.Cullison; +Cc: stgt

On 04/03/2014 00:28, FUJITA Tomonori wrote:
> On Mon, 3 Mar 2014 19:14:28 +0200
> Or Gerlitz <ogerlitz@mellanox.com> wrote:
>
>> On 25/02/2014 14:54, Or Gerlitz wrote:
>>> From: Dennis Cullison <Dennis.Cullison@Teradata.com>
>>>
>>> Enables support for the NAA IEEE Registered Extended field in the
>>> inquiry VPD page 0x83. This field is used by multi-pathing
>>> software for device persistency.
>> Hi Tomo,
>>
>> I didn't see a comment from you on this patch, did you get it?
> Oops, sorry. I wanted to check the spec then forgot. What pages and spec are related with this patch?

sure, Dennis, can you please provide the pointer Tomo asks for?

Or.

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

* RE: spc: Support NAA IEEE Registered Extended field in VPD page 0x83
  2014-03-04  8:48     ` Or Gerlitz
@ 2014-03-04 17:08       ` Cullison, Dennis
  2014-03-05 20:52         ` Or Gerlitz
  0 siblings, 1 reply; 8+ messages in thread
From: Cullison, Dennis @ 2014-03-04 17:08 UTC (permalink / raw
  To: Or Gerlitz, FUJITA Tomonori; +Cc: stgt@vger.kernel.org

Page 755, Section 7.8.6.6.5 "NAA IEEE Registered Extended designation format" from T10 document 'spc4r36q.pdf'. 

Dennis

-----Original Message-----
From: Or Gerlitz [mailto:ogerlitz@mellanox.com] 
Sent: Tuesday, March 04, 2014 12:49 AM
To: FUJITA Tomonori; Cullison, Dennis
Cc: stgt@vger.kernel.org
Subject: Re: spc: Support NAA IEEE Registered Extended field in VPD page 0x83

On 04/03/2014 00:28, FUJITA Tomonori wrote:
> On Mon, 3 Mar 2014 19:14:28 +0200
> Or Gerlitz <ogerlitz@mellanox.com> wrote:
>
>> On 25/02/2014 14:54, Or Gerlitz wrote:
>>> From: Dennis Cullison <Dennis.Cullison@Teradata.com>
>>>
>>> Enables support for the NAA IEEE Registered Extended field in the 
>>> inquiry VPD page 0x83. This field is used by multi-pathing software 
>>> for device persistency.
>> Hi Tomo,
>>
>> I didn't see a comment from you on this patch, did you get it?
> Oops, sorry. I wanted to check the spec then forgot. What pages and spec are related with this patch?

sure, Dennis, can you please provide the pointer Tomo asks for?

Or.

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

* Re: spc: Support NAA IEEE Registered Extended field in VPD page 0x83
  2014-03-04 17:08       ` Cullison, Dennis
@ 2014-03-05 20:52         ` Or Gerlitz
  0 siblings, 0 replies; 8+ messages in thread
From: Or Gerlitz @ 2014-03-05 20:52 UTC (permalink / raw
  To: FUJITA Tomonori; +Cc: Or Gerlitz, stgt@vger.kernel.org, Cullison, Dennis

On Tue, Mar 4, 2014 at 7:08 PM, Cullison, Dennis
<Dennis.Cullison@teradata.com> wrote:

> Page 755, Section 7.8.6.6.5 "NAA IEEE Registered Extended designation format" from T10 document 'spc4r36q.pdf'.

Hi Tomo,

So this helps?

Or.

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

* Re: spc: Support NAA IEEE Registered Extended field in VPD page 0x83
  2014-02-25 12:54 spc: Support NAA IEEE Registered Extended field in VPD page 0x83 Or Gerlitz
  2014-03-03 17:14 ` Or Gerlitz
@ 2014-03-08 12:40 ` FUJITA Tomonori
  2014-03-11  6:14   ` Or Gerlitz
  1 sibling, 1 reply; 8+ messages in thread
From: FUJITA Tomonori @ 2014-03-08 12:40 UTC (permalink / raw
  To: ogerlitz; +Cc: stgt, Dennis.Cullison

Sorry for the delay,

On Tue, 25 Feb 2014 14:54:13 +0200
Or Gerlitz <ogerlitz@mellanox.com> wrote:

> From: Dennis Cullison <Dennis.Cullison@Teradata.com>
> 
> Enables support for the NAA IEEE Registered Extended field in the
> inquiry VPD page 0x83. This field is used by multi-pathing
> software for device persistency.
> 
> Signed-off-by: Dennis Cullison <Dennis.Cullison@Teradata.com>
> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
> ---
> 
> Hi Tomo, 
> 
> This fix is from Dennis Cullison who asked me to assist in submission
> 
> Or.
> 
>  usr/spc.c |   26 +++++++++++++++++++++++++-
>  1 files changed, 25 insertions(+), 1 deletions(-)
> 
> diff --git a/usr/spc.c b/usr/spc.c
> index 29f39a9..0dd590f 100644
> --- a/usr/spc.c
> +++ b/usr/spc.c
> @@ -145,6 +145,12 @@ static void update_vpd_83(struct scsi_lu *lu, void *id)
>  	struct vpd *vpd_pg = lu->attrs.lu_vpd[PCODE_OFFSET(0x83)];
>  	uint8_t	*data = vpd_pg->data;
>  
> +	char *id_str = id;
> +	char subs[] = "0";
> +	unsigned long a = 0;
> +	unsigned long b = 0;
> +	unsigned long c;
> +
>  	data[0] = INQ_CODE_ASCII;
>  	data[1] = DESG_T10;
>  	data[3] = SCSI_ID_LEN;
> @@ -160,6 +166,24 @@ static void update_vpd_83(struct scsi_lu *lu, void *id)
>  
>  	put_unaligned_be64(lu->attrs.numeric_id, data);
>  	data[0] |= NAA_LOCAL << 4;
> +
> +	data += NAA_DESG_LEN;
> +	data[0] = INQ_CODE_BIN;
> +	data[1] = DESG_NAA;
> +	data[3] = NAA_DESG_LEN_EXTD;
> +	data += DESG_HDR_LEN;
> +	while (*id_str) {
> +		subs[0] = *id_str++;
> +		c = a >> 60;
> +		a <<= 4;
> +		b <<= 4;
> +		b |= c;
> +		a |= strtoul(subs, NULL, 16);

Can you please add comments to explan what the above code is supposed
to do? Also the code works on architecture where long is 32bits?


> +	}
> +	put_unaligned_be64(b, data);
> +	put_unaligned_be64(a, data + 8);
> +	data[0] &= 0x0F;
> +	data[0] |= NAA_IEEE_REGD_EXTD << 4;
>  }
>  
>  static void update_vpd_b2(struct scsi_lu *lu, void *id)
> @@ -2060,7 +2084,7 @@ int spc_lu_init(struct scsi_lu *lu)
>  
>  	/* VPD page 0x83 */
>  	pg = PCODE_OFFSET(0x83);
> -	lu_vpd[pg] = alloc_vpd(2*DESG_HDR_LEN + NAA_DESG_LEN + SCSI_ID_LEN);
> +	lu_vpd[pg] = alloc_vpd(3*DESG_HDR_LEN + NAA_DESG_LEN + SCSI_ID_LEN + NAA_DESG_LEN_EXTD);
>  	if (!lu_vpd[pg])
>  		return -ENOMEM;
>  	lu_vpd[pg]->vpd_update = update_vpd_83;
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stgt" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: spc: Support NAA IEEE Registered Extended field in VPD page 0x83
  2014-03-08 12:40 ` FUJITA Tomonori
@ 2014-03-11  6:14   ` Or Gerlitz
  0 siblings, 0 replies; 8+ messages in thread
From: Or Gerlitz @ 2014-03-11  6:14 UTC (permalink / raw
  To: FUJITA Tomonori, Dennis.Cullison; +Cc: stgt

On 08/03/2014 14:40, FUJITA Tomonori wrote:
>> @@ -160,6 +166,24 @@ static void update_vpd_83(struct scsi_lu *lu, void *id)
>> >  
>> >  	put_unaligned_be64(lu->attrs.numeric_id, data);
>> >  	data[0] |= NAA_LOCAL << 4;
>> >+
>> >+	data += NAA_DESG_LEN;
>> >+	data[0] = INQ_CODE_BIN;
>> >+	data[1] = DESG_NAA;
>> >+	data[3] = NAA_DESG_LEN_EXTD;
>> >+	data += DESG_HDR_LEN;
>> >+	while (*id_str) {
>> >+		subs[0] = *id_str++;
>> >+		c = a >> 60;
>> >+		a <<= 4;
>> >+		b <<= 4;
>> >+		b |= c;
>> >+		a |= strtoul(subs, NULL, 16);
> Can you please add comments to explan what the above code is supposed
> to do? Also the code works on architecture where long is 32bits?
>
>

sure, Dennis will look into this, he said this is going to take few more 
days, so we'll let you know.

Or.

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

end of thread, other threads:[~2014-03-11  6:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-25 12:54 spc: Support NAA IEEE Registered Extended field in VPD page 0x83 Or Gerlitz
2014-03-03 17:14 ` Or Gerlitz
2014-03-03 22:28   ` FUJITA Tomonori
2014-03-04  8:48     ` Or Gerlitz
2014-03-04 17:08       ` Cullison, Dennis
2014-03-05 20:52         ` Or Gerlitz
2014-03-08 12:40 ` FUJITA Tomonori
2014-03-11  6:14   ` Or Gerlitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.