On Tue, 2011-08-16 at 21:09 -0700, Roland Dreier wrote: > On Tue, Aug 16, 2011 at 2:35 PM, Boaz Harrosh <bharrosh@xxxxxxxxxxx> wrote: > > On 08/16/2011 02:09 PM, Nicholas A. Bellinger wrote: > > <snip> > >>> +static enum dma_data_direction tcm_qla2xxx_mapping_dir(struct se_cmd *se_cmd) > >>> +{ > >>> + if (se_cmd->t_tasks_bidi) > >>> + return DMA_BIDIRECTIONAL; > >>> + > >> > >> Mmmm, I don't think this is correct. It's my understanding that > >> DMA_BIDIRECTIONAL is different from SCSI bidi operation, and that the > >> individual bidi payloads should be retaining their individual > >> DMA_FROM_DEVICE and DMA_TO_DEVICE usage.. (Boaz CC'ed) > > > > Yes! DMA_BIDIRECTIONAL means that the same direct-access buffer could > > be written to and read from at the same time. For example a shared > > host-DSP buffer could be that case. It tells the (true) IOMMU to > > let both type of access on this single buffer. > > OK, fair enough. However I don't see where the cmd->data_direction gets > changed from TO_DEVICE to FROM_DEVICE for the two phases. How does > that happen? > I believe that DMA_TO_DEVICE (from the initiator's perpsective) is set for bidi operations in struct scsi_cmnd->sc_data_direction, and include/scsi/scsi_cmnd.h:scsi_in() is used to get the extra bidi READ buffer. I'm not sure how this is going to work with qla2xxx/tcm_qla2xxx data_direction yet, but I think it would make sense to do something similar for qla_tgt_cmd->data_direction. > Do bidi commands work at all with the qla2xxx target? > loopback is the only fabric that has been tested (and works) with bidi commands thus far, and only with XDWRITEREAD via BSG using tomo's sg utils tree. --nab -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html