Let user specify iSER support by the protocol part of the URL.
I.e. support both
iser://127.0.0.1/iqn.ronnie.test/1
iscsi://127.0.0.1/iqn.ronnie.test/1?iser
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This splits a transport into static driver specific functions for the common
iscsi commands. Optionally, a driver specific opaque memory is introduced
which is currently only used by iSER transport.
Last a lot of functions changed to static.
Signed-off-by: Peter Lieven <pl@kamp.de>
The iscsi cmdsn tests are noisy and generate a lot of [FAILURE]
warnings for things that are expected.
Fix this by do the plumbing to allow using a EXPECT_STATUS_TIMEOUT
for commands we expect will never be replied to and will thus time out.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Remove iscsi_queue_pdu from the list of symbols otherwise clang on OSX
fails to compile with the following error:
Undefined symbols for architecture x86_64:
"_iscsi_queue_pdu", referenced from:
-exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This commit includes all iSER implementation in libscsi
library and utilities.
Also, adding iser option in url.
Change-Id: I55ca8a9d4db802e72eb991061260dbb0bd0ef9ba
Signed-off-by: Roy Shterman <roysh@mellanox.com>
future iSER implementation will include different implementations
for all socket relative function. in iSER we get event only when
there is new entry in completion queue opposed to TCP that we get event
when we can write to the socket.
1. iscsi_get_fd -
TCP - returns socket fd.
ISER - returns completion queue channel fd.
2. iscsi_service -
TCP - processing the event type got from the socket
and handles it.
ISER - rearming the event mechanism in the completion queue
and polling all available completion queue entries for
process.
3. iscsi_which_events -
TCP - returns which type of event the library is waiting for
(Read, Write or both).
ISER - in iSER we are waiting only for POLLIN event, hence this
function always returns POLLIN.
Signed-off-by: Roy Shterman <roysh@mellanox.com>
iscsi-command: Adding new functions for all write operations (WRITE10,
WRITE12, WRITE16, WRITEOR, etc') for cases where the user wants
to pass his own io vectors (prevent memcpy).
new functions are called iscsi_write*_iov_task and looks
very similar to the iscsi_write*_task, only they get
scsi_iovec pointer and number of scsi_iovec as
parameters.
Change-Id: I719552b4cbda4f937975b5df7e77b4844e48cd16
Signed-off-by: Roy Shterman <roysh@mellanox.com>
iscsi-command: Adding new functions for all write operations (READ6,
READ10, READ12, READ16, etc') for cases where the
user wants to pass his own io vectors (prevent memcpy).
new functions are called iscsi_read*_iov_task and looks
very similar to the iscsi_read*_task, only they get
scsi_iovec pointer and number of scsi_iovec as
parameters.
Change-Id: Ice6bdb9227d72b20f495927f17d6757c124e4c84
Signed-off-by: Roy Shterman <roysh@mellanox.com>
all library: change disconnect to iscsi->t->disconnect
1. In TCP we need only to put -1 in fd and we don't
have more transport resources. In future iSER we will need to
clean resources and destroy the rdma connection.
Signed-off-by: Roy Shterman <roysh@mellanox.com>
socket: need to malloc hdr
include/iscsi-private: changing iscsi_in_pdu hdr to char*
instead of static array for more convinient iser
pdu creation.
To use iscsi_in_pdu in iSER without making a copy of it
we need to change hdr to pointer from static array,
Because of that, iscsi_tcp flow need to do szmalloc (small zero malloc)
hdr when creating new iscsi_in_pdu. iscsi_in_pdu is being malloced
once per each received pdu. This change is reducing iscsi_in_pdu struct
size but adding extra allocation of the same size we reduced
from the struct.
Signed-off-by: Roy Shterman <roysh@mellanox.com>
include/iscsi-private: adding queue_pdu in transport function pointers
struct
include/iscsi: declaration of tcp_queue_pdu function
socket: adding queue_pdu function to transport initialization
all_library: changing iscsi_queue_pdu into iscsi->t->queue_pdu
Signed-off-by: Roy Shterman <roysh@mellanox.com>
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>