Commit Graph

1704 Commits

Author SHA1 Message Date
Ronnie Sahlberg
714bad2153 TEST: add test for read/write using iovectors
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-10-01 16:31:13 -07:00
Ronnie Sahlberg
39001203b7 TESTS: simple support for READDEFECTDATA10/12
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-22 22:43:16 -07:00
Ronnie Sahlberg
01a8e22207 TESTS: COMPAREANDWRITE should fail if DATAOUT is not exactly 2*TL blocks
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-22 19:12:09 -07:00
Ronnie Sahlberg
2e947cc1de TESTS: WRITESAME1* with 0 DataOut should fail if WSNZ is set
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-22 18:44:44 -07:00
Ronnie Sahlberg
875c0222f2 Revert "TESTS: Fix writesame1* unmap until end tests"
This reverts commit 6aa8c17b59.
2016-09-22 06:26:12 -07:00
Ronnie Sahlberg
bb22ff71eb TESTS: Add tests that a target will reject WriteSame where DataOut has invalid size. 2016-09-21 19:53:22 -07:00
Ronnie Sahlberg
6aa8c17b59 TESTS: Fix writesame1* unmap until end tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2016-09-21 19:05:15 -07:00
Ronnie Sahlberg
e0fd6dc051 Allow iser:// style URLs
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>
2016-09-02 16:40:24 -07:00
Ronnie Sahlberg
8f41a629ec Merge pull request #216 from plieven/for_upstream
iser: remove unnecessary checks for NULL
2016-08-22 19:13:40 -07:00
Peter Lieven
d34c3d29d4 iser: remove unnecessary checks for NULL
Signed-off-by: Peter Lieven <pl@kamp.de>
2016-08-22 11:55:51 +02:00
Ronnie Sahlberg
75e67ba852 Merge pull request #214 from plieven/static_drv
abstract transport to static driver functions and opaque driver speci…
2016-08-21 09:50:16 -07:00
Ronnie Sahlberg
4fef2cde62 Merge pull request #215 from jh86/master
Update a URL in README, fix a typo there too
2016-08-21 09:49:35 -07:00
Jon Hermansen
4ebc65deba fix a typo in README heading 2016-08-20 19:49:01 -07:00
Jon Hermansen
aecdbd0a0c update the URL to cunit-to-junit.pl. old URL was throwing 404 2016-08-20 19:48:32 -07:00
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
Peter Lieven
fa123fc397 abstract transport to static driver functions and opaque driver specific information.
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>
2016-08-05 11:28:43 +02: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