On 02/02/2010 09:57 PM, Jack Z wrote:
Hi all,In the source code of ver 2.0.871 there's a struct struct iscsi_segment { unsigned char *data; unsigned int size; unsigned int copied; unsigned int total_size; unsigned int total_copied; ...... iscsi_segment_done_fn_t *done; }; My understanding is that "copied" is how many bytes are sent out in the last round and "total_copied" is an accumulative value of how many bytes have been sent out. Is that correct? And what do "size" and "total_size" mean respectively?
The segment represents the header or data segment that needs to be sent. That segment has a total_size which is all the bytes that need to be sent/recvd for it to be completely sent. The segment->size is what we are currently trying to send/recv for that segment. So we could have a data segment of 128K (so we want to send/recv 128K bytes), but we end up sending that down a page at a time to the net layer. So segment->totoal_size would be 128K and segment->size would be 4K (page size on x86 would be 4K).
Thank you very much! Any help would be highly appreciated.
What are you working on btw? -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/open-iscsi?hl=en.
