On Thu, 30 Oct 2008 18:38:04 -0700 Seokmann Ju <seokmann.ju@xxxxxxxxxx> wrote: > > On Oct 30, 2008, at 6:37 AM, Seokmann Ju wrote: > > > > > On Oct 29, 2008, at 9:18 PM, FUJITA Tomonori wrote: > [snip] > > > > > >>> + GFP_KERNEL); > >>> + sg_init_table(service->payload_dma, req->nr_phys_segments); > >>> + service->payload_sg_cnt = > >>> + blk_rq_map_sg(q, req, service->payload_dma); > >>> + service->payload = (void *) bio_data(req->bio); > >> > >> You don't need service->payload. We use scatterlist for data > >> transfer. > > Yes. Removed. > I need a step back here. > I understand that modules get involved in handling pass through are > treat > FC service requests as opaque data. > However, there are some case where LLDs need to retrieve the contents of > the service request and pull out some information - for example, opcode > of the ELS for the case of qla2xxx. > I guess there might be some other LLDs that need to pull out some > information from the service request for similar reasons. > For that purpose, I think it would be good to keep 'payload' and > 'response' > field instead. > Any comment? Simply, you can't access to the data via bio_data(). You must access to the scatter gather in a proper way. For example, try to do the following way to allocate a request buffer in user space: struct sg_io_v4 sg_io; char *p = valloc(8192); struct fc_els_frame *els = (struct fc_els_frame *)(p + 4086); sg_io.dout_xferp = (__u64) ⪕ fc_els_frame crosses two page frames. bio_data() can't handle it. If a driver wants the payload in a linear buffer, sg_copy_to_buffer() is helpful. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html