From: Vladislav B. <vs...@vl...> - 2010-03-31 11:11:36
|
Steve Modica, on 03/30/2010 10:55 PM wrote: > I have a specific question about this part of the SCST documentation: > > If the command is a *WRITE* command (data from the remote/local > initiator), necessary space will be allocated, then the target's > *rdy_to_xfer()* function will be called, telling the target that the > space is ready and it can start data transferring. When all the data are > read from the target, it will call *scst_rx_data()*, and the command > will be passed to SCSI mid-level directly or via device handler's > *exec()* call. > > Does this mean that *all* the space for the write will be allocated? Yes, it does. > For example, if the initiator wants to do a 4MB write, but SCST is > configured to only accept up to 256KB at a time, should SCST error out > or should it allocate 256KB and use "transfer ready" (perhaps handled in > the FCoE layer) to tell the sender to only send part of the IO at a time? The partial transfers is a very good to have feature (and, if properly done, it's a huge performance improvement), but it isn't too easy to be done, so it's not implemented yet. It would need to change internal state machine in an nontrivial way as well as it should be supported by target drivers and dev handlers, especially on the read path. But why are you asking? Because of the SG count limitation? If yes, to workaround that limitation it's much simpler to make SCST allocate >1 page at time for each SG entry, see for more details http://scst.sourceforge.net/contributing.html#SG_LIMIT. Modern kernels should allow reliably do order 2 allocations, i.e. 4 pages at time, which is enough to forget about this problem even with 64 SG entries limit. I'll be glad to commit such patch, if you prepare it. Vlad |