From: Wang J. <xj...@gm...> - 2010-10-31 14:45:24
|
2010/10/30 Chuck Tuffli <ct...@gm...>: > I apologize in advance for a confused set of questions, but here goes ... > > The setup uses a vdisk_nullio with a new target driver I'm developing. > > [605] cat spc.conf > HANDLER vdisk_nullio { > DEVICE ramdisk0 > } > > TARGET_DRIVER spct { > TARGET spct { > LUN 0 ramdisk0 > } > } > > The driver receives an INQUIRY command from the initiator and passes > it up to SCST. The confusion is in the xmit_response function. Here, > the driver sees the sg_cnt == 1, but the address passed back from > sg_dma_address() is NULL. In xmit_response, > scst_cmd_get_resp_data_len() returns 36 which is the same amount as > shown in sgv_pool_alloc() and vdisk_exec_inquiry(). > > Q1a: Is all read data passed to the target driver via the > xmit_response function? If so, is the test for valid data (sg_cnt != > 0) or (sg_dma_address() != NULL)? > A1a. No the data pass to target driver in ready_to_xfer > Q1b: If the above is true, would SCST ever call xmit_response multiple > times for the same struct scst_cmd (i.e. multiple data phases)? > A1b xmit_response called once when scst give response back to target driver > Q2: If the driver isn't allocating its own memory, is calling > scst_cmd_get_sg() the correct way to get the scatterlist pointer? > > Q3: Is the test for sense data being present (sense_valid_len != 0) or > something else? > > TIA > > ---chuck > |