All of lore.kernel.org
 help / color / mirror / Atom feed
* The SRP initiator and the endianness of tags in SRP information units
@ 2010-01-02 11:50 Bart Van Assche
       [not found] ` <e2e108261001020350h2a63377v153ff5dc7c1519b5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2010-01-02 11:50 UTC (permalink / raw)
  To: Roland Dreier; +Cc: OFED mailing list

Hello Roland,

First of all, my best wishes for the new year. I hope that you will be
able to continue supporting the RDMA community in 2010.

I have a question about the SRP initiator available in the Linux
kernel. While consulting the SRP spec (r16a) I noticed that all
multi-byte integer fields of SRP information units must be sent using
the big endian byte order. This holds e.g. for the 64-bit tag fields
present in several information units. So I was expecting these tags to
be declared as __be64. However, in the header file <scsi/srp.h> these
tags are declared as type u64, that is, being stored in CPU order. As
a result, the byte order of the tags sent by the SRP initiator will
depend on the endianness of the CPU the SRP initiator is running on
(e.g. little endian on Intel CPU's, big endian on PowerPC CPU's).
While this doesn't harm -- an SRP target must send back the same tag
it received -- I found this confusing. Is this the intended behavior
of the SRP initiator ?

The different tag fields declared in <scsi/srp.h> are:

$ grep -n '64.*tag;' include/scsi/srp.h
121:    u64     tag;
140:    u64     tag;
152:    u64     tag;
161:    u64     tag;
169:    u64     tag;
180:    u64     tag;
186:    u64     task_tag;
201:    u64     tag;
231:    u64     tag;
251:    u64     tag;
261:    u64     tag;

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: The SRP initiator and the endianness of tags in SRP information units
       [not found] ` <e2e108261001020350h2a63377v153ff5dc7c1519b5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-02-25 21:04   ` Roland Dreier
  0 siblings, 0 replies; 2+ messages in thread
From: Roland Dreier @ 2010-02-25 21:04 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: OFED mailing list

 > I have a question about the SRP initiator available in the Linux
 > kernel. While consulting the SRP spec (r16a) I noticed that all
 > multi-byte integer fields of SRP information units must be sent using
 > the big endian byte order. This holds e.g. for the 64-bit tag fields
 > present in several information units. So I was expecting these tags to
 > be declared as __be64. However, in the header file <scsi/srp.h> these
 > tags are declared as type u64, that is, being stored in CPU order. As
 > a result, the byte order of the tags sent by the SRP initiator will
 > depend on the endianness of the CPU the SRP initiator is running on
 > (e.g. little endian on Intel CPU's, big endian on PowerPC CPU's).
 > While this doesn't harm -- an SRP target must send back the same tag
 > it received -- I found this confusing. Is this the intended behavior
 > of the SRP initiator ?

Didn't reply before... sorry.

Anyway my view is that since tags are just an opaque 64-bit quantity, it
doesn't really make sense to worry about endianness.  You wouldn't
byte-swap a field that was an 8-byte string, and the tag is essentially
the same thing.

 - R.
-- 
Roland Dreier  <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2010-02-25 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-02 11:50 The SRP initiator and the endianness of tags in SRP information units Bart Van Assche
     [not found] ` <e2e108261001020350h2a63377v153ff5dc7c1519b5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-25 21:04   ` Roland Dreier

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.