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.
0410 is the first test for the MMC commandset.
This commandset is in hindsight a bit more complex than other commandsets
in that we have to handle quite a lot of cases :
1, if it is not a MMC device, we should check we get INVALID_OPCODE and then
bail.
Then if it is a MMC device, there are at least three different cases we have to
handle:
2.a If there is no medium in the device
2.b there is media, but the medium is blank
2.c there is readable medium
this makes MMC tests a lot more complex than other commandsets
so we have to try to get this one as nice and simple as possible so we can
reuse this test as the framework when adding other MMC tests.
(even the 2.b test is not 100% right, since if the medium is BR, then a blank disk will fail with sense, but blank pre-BD mediums will not fail the READTOC command)