Adding MaintenanceIn: Read Supported Opcodes
Good stuff!
This opcode is optional, so instead of flagging a test failure, if the opcode returns sense that the opcode is missing then it should just return 'SKIPPED'
Something like
if (task->status == SCSI_STATUS_CHECK_CONDITION
&& task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST
&& task->sense.ascq == SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) {
printf("[SKIPPED]\n");
printf("READSUPPORTEDOPCODES Not Supported\n");
ret = -2;
scsi_free_scsi_task(task);
goto finished;
}
Dont requeue data-out pdus, or other pdus with the DELETE_WHEN_SENT flag, such
as nops.
These, like the DATA-OUT pdu will instead be automatically re-sent when the original write command is sent again.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
get_lba_status returns provisioning for a range of blocks starting
from given lba. Especially for sequential reads its likely that
the next block read is already covered by the last result.
In case there is write support added to ld_iscsi there needs
to be an invalidation code for the cache.
For large continous reads I may be benifical to check if the blocks
that are going to be read are allocated. If they are not allocated
they do not need to be read which massivly speeds up the read.
This behaviour is optional and can be turned on with environment
variable LD_ISCSI_GET_LBA_STATUS=1
This patch adds support for setting TCP_SYNCNT to overwrite
the system default values. This allows indirect support
for a configurable connect timeout.
Linux uses a exponential backoff for SYN retries starting
with 1 second.
This means for a value n for TCP_SYNCNT, the connect will
effectively timeout after 2^(n+1)-1 seconds.
This patch allows the following parameters inside libiscsi to be adjusted without code modification:
LIBISCSI_DEBUG
LIBISCSI_TCP_USER_TIMEOUT
LIBISCSI_TCP_KEEPIDLE
LIBISCSI_TCP_KEEPCNT
LIBISCSI_TCP_KEEPINTVL
You can now enable debugging of libiscsi inside e.g. qemu-kvm with
LIBISCSI_DEBUG=3 qemu-kvm -hda iscsi://...
This patch adds 3 functions to set the 3 keepalive values TCP_KEEPIDLE, TCP_KEEPCNT
and TCP_KEEPINTVL. The values have to be set after iscsi context creation and are
then configured on the socket on each new connection.
For TCP_USER_TIMEOUT to work it seems to be necessary that SO_KEEPALIVE is
enabled. RFC5482 section 4.2 also says that the TCP_USER_TIMEOUT has to be
less than the keepalive timeout. This means less than 30000 ms in the
current libiscsi default settings for TCP keepalives.
This patch adds a linear backoff mechanishm + jitter in case
a reconnect fails. If there is a longer outage this is to
avoid a large amount of simultaneous connects to the storage.
This patch adds a user configurable option to set the TCP_USER_TIMEOUT
socket option. With this timeout set a broken TCP session is shutdown
after a given timeout even there are unacked packets. SO_KEEPALIVE
seems not to work in this case.
RFC3270 describes in section 12.14 that immediate and unsolicited data
sent from the initiator to the target must not exceed FristBurstLength
bytes in total.