socket: adding tcp_connect function and implement it
in the last common part of iSER and TCP in iscsi_connect_async
Signed-off-by: Roy Shterman <roysh@mellanox.com>
lib/init: initializing connection transport
lib/socket: Adding function to initialize tcp transport.
future commits will include adding iSER transport layer,
so each transport option will has it's own template of functions.
all_utils: All utils stay the same, in future iSER commits in case of
iSER transport we will override tcp_transport in
iscsi_context.
connect: adding transport initialization when creating context
include/iscsi-private: Adding iscsi_transport attribute in iscsi_context
Signed-off-by: Roy Shterman <roysh@mellanox.com>
Make iscsi_init_tcp_transport private
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
The current WRITE SAME (WS) 0 blocks test at LBA 0 isn't always correct
because if:
- The target's WSNZ bit set is 0
- The target's MAXIMUM WRITE SAME LENGTH (MWSL) is greater than 0
- We are issuing a WS with a NUMBER OF LOGICAL BLOCKS of 0
then whether the command should return success or failure depends on
whether the starting LBA is within MWSL blocks of the end of the LUN
(see http://www.t10.org/pipermail/t10/2016-May/017988.html for details).
Replace the vestigial code which tried to handle this (but no longer
worked since commit 8585e4509b ) and add
some additional MAXIMUM WRITE SAME LENGTH tests.
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Based on the corresponding simple tests. Issue a WRITESAME request and
confirm that the data written matches the data read back.
Signed-off-by: David Disseldorp <ddiss@suse.de>
This release contains a bugfix for a rare condition where
if a DATA-OUT PDU has a callback registered, it can cause a crash
on reconnect/timeout.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
we use the flag ISCSI_PDU_NO_CALLBACK and pdu->callback simultaneously, but
check only for one of them in various places. So drop ISCSI_PDU_NO_CALLBACK
and check for pdu->callback != NULL instead.
All PDUs that carried this flag have pdu->callback set to NULL.
Signed-off-by: Peter Lieven <pl@kamp.de>
- Various test updates.
- Add tests for ExtendedCopy and ReceiveCopyResults
- Add support for WRITE_ATOMIC_16 and tests
- Multipath tests added
- Persistent Reservation test updates.
- Make sure to process target NOPs in the tests
- Fix broken CHAP has handling.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
There is technically no reason why a SSD with (assumingly with thin
provisioning) can not support SANITIZE/OVERWRITE instead or or in addition
to the more expected SANITIZE/BLOCK-ERASE so remove the warning for this.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Tests such as ProutPreempt presume each path they have is sending a
different initiator name. When using multipath this did not happen and
initiatorname1 was used on all paths.
Fix this by creating and initializing an array (currently size 2) of
initiator names and iterating it in step with each new path we make
(hopefully the compiler will complain if iscsi-test-cu ever supports
more than two multipaths and there isn't a corresponding initiatorname).
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
When libiscsi is built with clang several spurious
missing-field-initializers warnings like the following are reported:
test_async_write.c:61:45: error: missing field 'completed' initializer
[-Werror,-Wmissing-field-initializers]
struct tests_async_write_state state = { 0 };
These appear to be due to clang being overzealous in its checking
because the code is legal C (see
https://llvm.org/bugs/show_bug.cgi?id=21689 ) but it causes compilation
to be aborted. Workaround the problem by specifying a 0 or NULL for each
structure member.
Some iSCSI targets provide a link-local IPv6 address as a portal, but that
is unusable without knowing the interface (aka scope-id) to use for the
connection. This causes iscsi-ls to report an EINVAL and exit. Just
skip the error.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This function allows the caller to determine the number of PDUs queued
for transmission for a given iscsi context.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Currently the iscsi_task_mgmt_abort_task_[a]sync() functions cancel any
queued or dispatched (awaiting response) PDUs prior to transmitting the
ABORT TASK TMF request, which means that a TMF request may be sent which
references a PDU that the target never received.
Bug: https://github.com/sahlberg/libiscsi/issues/192
Signed-off-by: David Disseldorp <ddiss@suse.de>
These values are defined in rfc3720
10.6. Task Management Function Response
-> 10.6.1. Response
The response field is a single byte value, and is already used within
libiscsi as a command_data parameter for iscsi_task_mgmt_async()
callbacks.
Signed-off-by: David Disseldorp <ddiss@suse.de>
if we drop a PDU which has a callback we should invoke it otherwise
the caller may wait infinetely for a command completion.
Signed-off-by: Peter Lieven <pl@kamp.de>
This seriously breaks qemu NOP timeouts and probably other things.
The reason is that the
define ISCSI_PDU_ERROR_ON_RECONNECT 0x00000016
is masking bits 0x2 and 0x4 as well.
Correctly it should read:
define ISCSI_PDU_ERROR_ON_RECONNECT 0x00000010
However, the better solution for this approach is invoke all callbacks
of PDUs which carry the ISCSI_PDU_DROP_ON_RECONNECT flag. This will
make sure that callbacks of whatever sync tasks are invoked.
This reverts commit 0407cf6aed.
Dispatch a number of Compare And Write requests simultaneously via
separate iSCSI sessions and await all responses.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Dispatch a number of READ10 requests simultaneously, and await all
responses.
The iscsi-support test helper functions are currently all synchronous,
so this test mostly uses the bare libiscsi API. As new async tests are
added, we can make a more informed decision on which boilerplate code
can be split out.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Ceph RADOS block devices split images into 4MB objects. This test
ensures that cross object IOs are successful.
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>