[ofa-general] Re: itt member in iscsi_data?

Mike Christie michaelc at cs.wisc.edu
Wed Mar 19 10:20:05 PDT 2008


Roland Dreier wrote:
> iser_initiator.c has this code:
> 
> 	itt = ntohl(hdr->itt);
> 
> which triggers sparse warnings like:
> 
>     drivers/infiniband/ulp/iser/iser_initiator.c:419:8: warning: cast to restricted type
>     drivers/infiniband/ulp/iser/iser_initiator.c:419:8: warning: cast from restricted type
> 
> and indeed the itt field is declared as itt_t, with no particular
> endianness, so the sparse warnings seem like they are pointing at
> something that really is suspicious.
> 
> It seems the only use of itt in the function that does ntohl() is to
> print the value our in debugging statements.  What is intended here?
> Would it just make sense to for the debug statements to print hdr->itt
> out directly with no conversion?
> 

Sorry I missed this mail. I think it will be ok to just print it without 
the ntohl, because of how libiscsi and ib_iser use the tag. The iscsi 
RFC defines it as a big endien field, but as you probably saw we have 
that wierd encoding and Al Viro did that code to define it as a itt_t
I can send a patch when Erez gets back. I have some other patches for 
him to look over for the next window.



More information about the general mailing list