On 04/06/2014 01:03 PM, Or Gerlitz wrote:
> On Sun, Apr 6, 2014, Michael Christie <micha...@cs.wisc.edu> wrote:
>> On Apr 6, 2014, Or Gerlitz <ogerl...@mellanox.com> wrote:
> 
>>> the kernel code path of iscsi_complete_pdu--> __iscsi_complete_pdu -->  
>>> iscsi_scsi_cmd_rsp
>>> uses a "datalen" value which should account for the length of the data 
>>> received from the target.
>>>
>>> In iser/iscsi_iser_recv() we don't skip the AHS in case the target sent it 
>>> and I'd like to fix it.
>>> I wasn't fully surewhat is done today in iscsi_tcp... I see few hits in 
>>> libiscsi_tcp.c for ahslen but didn't manageto spot the a place where the 
>>> ahs is being skipped, is it?
>>
>> You saw iscsi_tcp_hdr_recv_done in libiscsi_tcp.c right? We just have a 
>> preallocated header buffer that we copy to. That function just detects the 
>> ahs then sets things up so iscsi_tcp_recv_skb reads it into that buffer.
> 
> 
> Yes, I saw iscsi_tcp_hdr_recv_done() but I wasn't sure to fully follow
> on what's exactly done there w.r.t to the AHS, it reads the ahs len
> and adds it to two size fields, and I was under the impression that
> the AHS is skipped before the data pointer is provided to the
> iscsi_complete_pdu--> __iscsi_complete_pdu -->  iscsi_scsi_cmd_rsp
> call chain but couldn't prove it to myself, so the question, is this
> really the case? and I can align iser to do the same practice.

Ah ok, I think I see what you are saying. Yeah, probably a bug in
iscsi_tcp/libiscsi_tcp.

We would read in the bhs by doing:

iscsi_sw_tcp_recv -> iscsi_tcp_recv_skb -> iscsi_tcp_segment_recv

iscsi_tcp_recv_skb then would call segment->done which calls
iscsi_tcp_hdr_recv_done. That updates the sizes for the ahs.
iscsi_tcp_recv_skb would then return ISCSI_TCP_SEGMENT_DONE and we would
not read in the ahs. That last part is a bug.

What should have happened is that segment->done should have indicated
that there was more data (the ahs parts), and we should have continued
reading in iscsi_tcp_recv_skb.

Ccing Boaz to see if there is some easy osd test script to test it out
and fix.

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to