Change iscsi_scsi_command_async() to write data-out using iovectors attached to the scsi task structure instead of copying the data into the buffer holding the header. Still allow passing the data via an argument to the funtcion so that the ABI does not change but then just conver the data to an iovector. Update the write_to_socket functions to know about the iovectors and write them as part of the pdu. Convert write10_task to use iovectors. This will allow 'zero-copy' writes through libiscsi. However, as 'zero-copy writes does mean that we do more send() calls into the kernel this may degrade performance for very small i/o. A scsi write will not take at least 2 send() calls. One send call for the iscsi header structure and a second send call for the payload data. This will be more expensive than the old memcpy() of payload data plus one send() call since the send() will be a lot more expensive than memcpy() of a small amount of data.
18 KiB
18 KiB