Commit Graph

1689 Commits

Author SHA1 Message Date
Ronnie Sahlberg
0e0e326f75 Merge pull request #213 from ddiss/caw_unwritten2
test Compare And Write against unwritten range
2016-08-05 10:31:12 -07:00
David Disseldorp
e6f2ce306c test: COMPARE AND WRITE against unwritten range
Simulate VMware ESXi behaviour in issuing COMPARE AND WRITE requests
against unwritten ranges.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-07-25 13:00:09 +02:00
David Disseldorp
871eb1b61b test: don't segfault in TMF callback on reconnect
Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-07-21 21:29:33 +02:00
Ronnie Sahlberg
df1dc08eb7 TESTS: cleanup and remove noise warnings for iscsi cmdsn tests
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>
2016-07-11 20:50:47 -07:00
Ronnie Sahlberg
37507c994a Add back iscsi_queue_pdu
We need a public symbol for iscsi_queue_pdu. This is now just a
simple wrapper around iscsi->t->queue_pdu

https://github.com/sahlberg/libiscsi/issues/212

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-07-11 18:37:25 -07:00
Ronnie Sahlberg
f639f858eb Merge pull request #211 from plieven/tegile_test
For Upstream
2016-07-11 18:26:37 -07:00
Peter Lieven
ab01692ea6 iscsi-ls: strip portal group tag in url output
we do not use it in libiscsi anyway, but e.g. Qemu does not support in in the URL.

Signed-off-by: Peter Lieven <pl@kamp.de>
2016-07-07 12:00:56 +02:00
Peter Lieven
9ecc8184fe socket: do not leak addrinfo in iscsi_connect_async
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-07-07 11:53:01 +02:00
Peter Lieven
f2850fdcc6 connect: do not leak transport struct on iscsi_reconnect_cb
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-07-07 11:47:58 +02:00
Peter Lieven
1b3d3038bf init: do not leak transport struct on iscsi_destroy_context
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-07-07 11:44:56 +02:00
Peter Lieven
765d492aa0 pdu: dump PDU header on ILLEGAL REQUEST sense
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-07-07 11:38:21 +02:00
Peter Lieven
20e1182b3e scsi-lowlevel: add more pagecodes to scsi_inquiry_pagecode_to_str
add reverse mappings for all members of: enum scsi_inquiry_pagecode

Signed-off-by: Peter Lieven <pl@kamp.de>
2016-07-07 11:30:34 +02:00
Peter Lieven
d0943249f6 iscsi-inq: use right int types
the block limits vpd has unsinged values. casting them to signed can return negative results.

Signed-off-by: Peter Lieven <pl@kamp.de>
2016-07-07 11:24:50 +02:00
Peter Lieven
19a3412d58 iscsi-perf: add a logging parameter
if specified the perf output will log the perf data once per second.

Signed-off-by: Peter Lieven <pl@kamp.de>
2016-07-07 10:44:24 +02:00
Ronnie Sahlberg
334ab850c0 Merge pull request #209 from sitsofe/unused-symbol
lib: Remove unused iscsi_queue_pdu symbol
2016-06-07 06:32:21 -07:00
Sitsofe Wheeler
20a0969b15 lib: Remove unused iscsi_queue_pdu symbol
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)
2016-06-04 17:39:29 +01:00
Ronnie Sahlberg
01de246bdc Add a feature macro for ISER and bump api version
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-06-03 19:09:39 -07:00
Roy Shterman
a628264ef0 Libiscsi: iSER implementation
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>
2016-06-03 18:59:01 -07:00
Ronnie Sahlberg
0a1b96c383 Add configure checks for iSER support
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-06-03 18:54:38 -07:00
Roy Shterman
47b6881b97 Libiscsi: Adding abstraction to async functions
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>
2016-06-03 18:54:02 -07:00
Roy Shterman
c85042bacb Libiscsi: Introducing new functions for zero-copy write operations
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>
2016-06-03 18:51:27 -07:00
Ronnie Sahlberg
2bba53d31d We need the new read functions in libiscsi.def too
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-06-03 18:50:46 -07:00
Roy Shterman
e00e47d28d Libiscsi: Introducing new functions for zero-copy read operations
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>
2016-06-03 18:47:55 -07:00
Roy Shterman
6c1bdb4808 Libiscsi: Adding free_pdu function to transport abstraction
Signed-off-by: Roy Shterman <roysh@mellanox.com>
2016-06-03 18:47:23 -07:00
Roy Shterman
dff69584e0 Libiscsi: Adding disconnect function to transport abstraction
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>
2016-06-03 18:46:50 -07:00
Roy Shterman
bc64420bad Libiscsi: Changing header iscsi_in_pdu
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>
2016-06-03 18:46:18 -07:00
Roy Shterman
2671e10565 Libiscsi: Adding new_pdu function to transport abstraction
Signed-off-by: Roy Shterman <roysh@mellanox.com>
2016-06-03 18:45:44 -07:00
Roy Shterman
e3df0bbf96 Libiscsi: Adding queue pdu function to transport abstraction
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>
2016-06-03 18:44:51 -07:00
Roy Shterman
0d6362ffe6 Libiscsi: Adding connect function to transport abstraction
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>
2016-06-03 18:43:46 -07:00
Roy Shterman
9378a39ddc Libiscsi: Adding transport layer into all library utilities
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>
2016-06-03 18:43:03 -07:00
Ronnie Sahlberg
e26f6fe51a Merge pull request #208 from sitsofe/ws-0blocks-fixes
Tests: WRITESAME 0-blocks fixes and improvements
2016-06-01 19:41:20 -07:00
Sitsofe Wheeler
b908bdeb99 Tests: WRITESAME 0-blocks fixes and improvements
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>
2016-05-30 12:37:58 +01:00
Ronnie Sahlberg
99980b2437 TESTS: fix unsigned/signed warning in writesame tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-05-23 21:47:21 -07:00
Ronnie Sahlberg
66f55eb3e0 Merge pull request #207 from ddiss/test_writesame_check
tests: add WRITESAME data verification tests
2016-05-23 21:44:18 -07:00
David Disseldorp
3644504147 tests: add WRITESAME data verification tests
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>
2016-05-18 11:59:54 +02:00
Ronnie Sahlberg
a341c665d8 Merge pull request #206 from plieven/fix_gitignore
gitignore: really ignore autom4te.cache
2016-05-13 05:36:24 -07:00
Peter Lieven
dd218f0e6b gitignore: really ignore autom4te.cache
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-05-13 09:22:23 +02:00
Ronnie Sahlberg
8da7b8df3e New version 1.17.0
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>
2016-05-08 12:37:59 -07:00
Ronnie Sahlberg
a41f97ad09 Merge pull request #204 from plieven/fix_segv
Fix seg fault on reconnect/timeout
2016-05-08 12:28:37 -07:00
Ronnie Sahlberg
62a81b6a53 Merge pull request #205 from sitsofe/exit1_on_fail
Tests: Exit iscsi-test-cu with 1 if a test fails
2016-05-06 06:22:31 -07:00
Sitsofe Wheeler
f291c7f9c0 Tests: Exit iscsi-test-cu with 1 if a test fails
Make it easier for build systems to tell a test run had failures by
changing the exit code to 1.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
2016-05-05 17:18:19 +01:00
Peter Lieven
423b82efa4 pdu: check callback for NULL everywhere
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-05-02 13:55:13 +02:00
Peter Lieven
cde2043891 pdu: drop ISCSI_PDU_NO_CALLBACK
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>
2016-05-02 10:40:15 +02:00
Peter Lieven
03fe4d73f7 iscsi-command: DATA OUT PDUs must have no callback
otherwise we might invoke a cmd_pdu callback multiple times
on timeout or reconnect.

Signed-off-by: Peter Lieven <pl@kamp.de>
2016-05-02 10:08:01 +02:00
Ronnie Sahlberg
2b9cd64e7c New version 1.16.0
- 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>
2016-05-01 15:55:58 -07:00
Ronnie Sahlberg
a6fc65b4ef Tests: remove the warning if a SSD supports SANITIZE/OVERWRITE
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>
2016-05-01 12:35:29 -07:00
Ronnie Sahlberg
526039793e Merge pull request #203 from sitsofe/mpath-initiator
Tests: Ensure each path sends a different initiator when using multipath
2016-05-01 11:44:34 -07:00
Sitsofe Wheeler
190f5712fe Tests: Ensure each path sends a different initiator when using multipath
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>
2016-04-05 09:13:15 +01:00
Ronnie Sahlberg
678d70eb68 Tests: writeatimic simple. Make sure that writes are aligned correctly
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-04-03 09:56:16 -07:00
Ronnie Sahlberg
3458c2dd97 Merge pull request #199 from sitsofe/clang-fixes
Silence clang missing-field-initializers warning
2016-04-03 09:31:26 -07:00