Commit Graph

2061 Commits

Author SHA1 Message Date
Ronnie Sahlberg
a85db82806 Merge remote branch 'gonzoleeman/cunit' into cunit 2013-01-06 11:13:00 -08:00
Ronnie Sahlberg
39fcc2bc20 README: Update the url for release tarballs 2013-01-05 11:33:24 -08:00
Ronnie Sahlberg
1dc4023d70 New version 1.8.0
- Add new debugging/logging subsystem.
 - Collapse related structures into one and reduce amount of calls to malloc()
 - Add more functions to ld-iscsi so that we can write to luns too.
 - Start adding unmarshalling of CDBs
 - Add support for using iovectors for both reading and writing.
 - Fix a deadlock between CMDSN and DATA-OUT PDUs.
 - Redo how we handle FirstBurstLength/MaxRecvDataSegmentLength/ImmediateData/InitialR2T.
 - Add a new nice API for handling sending NOPs from the application.
 - Add tests for PersistentReservations.
2013-01-05 09:30:33 -08:00
Lee Duncan
d3324decd2 CUnit tests now working for first 2 suites, but
Makefile.am not correct yet.
2013-01-04 18:11:36 -08:00
Lee Duncan
fb4724c813 Added guts of new cunit-based main routine 2013-01-03 19:57:09 -08:00
Lee Duncan
b8da17b3ec Now main() is seperate from guts of testing. 2013-01-03 19:56:30 -08:00
Lee Duncan
ee5000ba9d Moved support routines from iscsi-test to iscsi-support,
in preperation for sharing non-main functions.
2013-01-02 17:15:48 -08:00
Ronnie Sahlberg
065319f996 SCSI Add support for STATUS_BUSY
Add support for BUSY status coide from the target and just pass this
back to the application as is (instead of converting it to _ERROR).

This allows the application to trap task->status==SCSI_STATUS_BUSY and
decide what/how to proceed.
2013-01-01 10:15:56 -08:00
Lee Duncan
d9664cb26a Added test for other 5 PGR reservation types. 2012-12-28 11:21:37 -08:00
Lee Duncan
6a122428dd Merge https://github.com/sahlberg/libiscsi 2012-12-27 19:18:53 -08:00
Lee Duncan
fbf8b5e426 - Made PGR test more verbose (naming initiator).
- Added test for Exclusive Access PGR reservation access testing.
2012-12-27 12:51:38 -08:00
Ronnie Sahlberg
91155c42e4 TESTS: Read standard inq page before we spawn the tests
We dont need to call inq so often from the tests if we read the standard page once before the tests begin
2012-12-27 11:47:34 -08:00
Ronnie Sahlberg
3a4605d3e5 TESTS: Remove some READCAPACITY16 we no longer need 2012-12-27 07:04:23 -08:00
Ronnie Sahlberg
5ad957b873 TESTS: Start fixing up the tests so we can test-suite them properly
Dont call READCAPACITY from every single test.
Remove two arguments from the test signatures and turn them into globals.
remove the ret++ silliness.  Tests return 0 : all ok, -2, skipped or -1 : test failed
2012-12-26 18:34:12 -08:00
Ronnie Sahlberg
3c960c1d42 TESTS: Create helpers for VERIFY16 and switch all tests over to use them 2012-12-26 09:25:45 -08:00
Ronnie Sahlberg
eb2a586cc4 Merge remote branch 'gonzoleeman/master' 2012-12-26 05:44:36 -08:00
Ronnie Sahlberg
61ad9b1972 TESTS: Create helpers for verify12 and switch all tests to use them 2012-12-25 16:14:45 -08:00
Ronnie Sahlberg
12179de245 TESTS: create helpers for VERIFY10 and switch all tests over to use it. 2012-12-25 15:48:11 -08:00
Ronnie Sahlberg
2afb5accc4 TESTS: Create helpers for PREFETCH16 and switch all tests over to them 2012-12-25 08:57:05 -08:00
Ronnie Sahlberg
047b650151 TEST: Add helpers for PREFETCH10 and convert all tests to use them 2012-12-25 08:31:30 -08:00
Ronnie Sahlberg
4ee24799ed TESTS: Change all remaining uses of testunitready to use the new helper 2012-12-24 15:09:10 -08:00
Lee Duncan
d72e6b3717 Removed custom struct for tracking Persistent Resvn type. 2012-12-23 21:36:46 -08:00
Ronnie Sahlberg
69dbf8c727 TESTS: Convert 0361 and 0362 to use testunitready helpers 2012-12-23 21:02:43 -08:00
Ronnie Sahlberg
b9c516147a TESTS: Add helpers for testunitready. Change 0000 and 0360 to use new testunitready helpers 2012-12-23 20:49:38 -08:00
Lee Duncan
9ea26fbca5 Cleanup to make tests easier to read. 2012-12-22 14:12:10 -08:00
Lee Duncan
474cec5556 Added new 1130* test file for PGR simple reserve testing.
Added infrastructure to support reading, setting, and
clearing reservations.
2012-12-22 13:50:55 -08:00
Lee Duncan
cc4969d167 Updated to be more modular, and added one test. 2012-12-22 11:09:05 -08:00
Lee Duncan
efcb6a4df9 Added no-strict-aliasing to compile flags.
Would not compile on my openSUSE 12.2 system without this fix.
2012-12-22 10:59:07 -08:00
Ronnie Sahlberg
09df905d30 Add unmarshalling ot REPORT_CAPABILITIES 2012-12-18 21:19:25 -08:00
Ronnie Sahlberg
4522658254 Add unmarshalling og READ_RESERVATION data 2012-12-18 21:10:26 -08:00
Ronnie Sahlberg
0338e4edd0 TEST: Change the last test to be a more simple REGISTER/UNREGISTER test for persisntet registrations. 2012-12-18 20:30:03 -08:00
Ronnie Sahlberg
2a74fc00bc Initial support for PERSISTENT_RESERVER_OUT and add a simple test to show the api 2012-12-17 21:25:46 -08:00
Ronnie Sahlberg
d324a94051 Add test for the range of service actions for PERSISTENT_RESERVE_IN 2012-12-17 19:42:30 -08:00
Ronnie Sahlberg
2b46e4adfa Add unmarshalling of PERSISTENT_RESERVE_IN/READ_KEYS DATA-IN blob 2012-12-17 19:26:43 -08:00
Ronnie Sahlberg
c60093eafe Add support for PERSISTENT_RESERVE_IN and add a simple test for READ_KEYS 2012-12-17 19:01:50 -08:00
Ronnie Sahlberg
f1d3aa073f Merge pull request #57 from plieven/outqueue-itt-fix
Nice catch.
2012-12-17 07:28:22 -08:00
Peter Lieven
4cbbc0e1e9 SOCKET order packets in outqueue by CmdSN
Ordering by itt adds the special case of handling
itt == 0xffffffff. Order by CmdSN instead as described
by RFC3720.

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-16 12:36:34 +01:00
Peter Lieven
2f9fda19d2 SOCKET do not queue PDUs with itt==0xffffffff head of queue
Queing packets with itt = 0xffffffff (e.g. NOP-Out replies) ahead
of queue because they might have a higher CmdSN than following
packets. This again could lead to a deadlock AND its a protocol
violotion:

RFC3720 Section 3.2.2.1 second last paragraph on Page 21:
"On any connection, the iSCSI initiator MUST send the commands in
increasing order of CmdSN, except for commands that are retransmitted
due to digest error recovery and connection recovery."

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-15 13:27:52 +01:00
Peter Lieven
735e3063ad PDU log header of rejected PDUs
Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-15 13:27:41 +01:00
Ronnie Sahlberg
092e22449e Merge pull request #55 from plieven/tcp_nodelay
SOCKET set TCP_NODELAY on iscsi->fd
2012-12-10 18:40:44 -08:00
Peter Lieven
446b1829c8 SOCKET use readv/writev to write directly into iovectors
This patch adds support for read/writev to directly read and write
from/to iovectors. Before this patch on read and write from/to socket
the operation was limited by the iovec boundaries. If there is enough
data in the buffer or enough buffer space available its now possible
to transfer the whole data in one atomic operaion.

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-10 19:24:28 +01:00
Peter Lieven
752c0ad396 SOCKET set TCP_NODELAY on iscsi->fd
This will set TCP_NODELAY on the socket connection
to the target. This is the first step to improve latency.
For systems supporting TCP_CORK we plan to add a cork
around certain PDUs e.g. DATA-Out, but this needs further
testing.

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-07 15:01:19 +01:00
Ronnie Sahlberg
f215fc30c5 Merge pull request #54 from plieven/nop+queue-fixes
Nop+queue fixes
2012-12-06 06:49:51 -08:00
Peter Lieven
36be387547 SOCKET remove useless code
At this point in iscsi_write_to_socket() pdu->written can only be
equal to total.

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-06 10:42:30 +01:00
Peter Lieven
154760a00e RECONNECT remove redundant requeue code
We first merge waitpdu and outqueue queues and then requeue
the elements. iscsi_add_to_outqueue() will sort them accordingly
so this is no problem.

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-06 10:42:23 +01:00
Peter Lieven
5f18c72706 RECONNCT fix broken reconnect for iov out vectors
We where modifying out_offset and out_len in iscsi_write_to_socket().
If the packet that was being sent before reconnect was a write command
the was a significant change that out_offset and out_len where already
touched. When requeing the packet after reconnect we where
sending garbage!

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-06 10:42:16 +01:00
Peter Lieven
237729545a NOP count in flight of client generated NOP-Outs
This patch adds the abilitiy to libiscsi to count the number
of consecutive outstanding NOPs.

With this ability its fairly easy to implement a keepalive
check with NOPs in your application.

Periodically (e.g. every 5 secs) create a NOP-Out with:

iscsi_nop_out_async(iscsi, NULL, NULL, 0, NULL);

At that time check the number of consecutive missing NOP-Ins
with

iscsi_get_nops_in_flight(iscsi) > N.

Where N is the number of missing NOP-Ins you will allow.
Please note that it is legitime for the Target to ignore
a NOP if the load is very high as those packet are mark
as IMMEDIATE.

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-06 10:42:09 +01:00
Ronnie Sahlberg
d1344a666b Merge pull request #53 from plieven/reconnect_on_login_error
RECONNECT add option to limit the number of reconnect retries
2012-12-04 19:16:44 -08:00
Ronnie Sahlberg
22797e0f67 NOPs should not be requeued when reconnecting a session.
Just like DATA_OUT we should just discard NOPs instead of requeueing them
on session reconnect.
Add new flag that to indicate this behaviour on reconnect and set it for
both data out and nops
2012-12-04 19:07:49 -08:00
Peter Lieven
ee83c7ce75 RECONNECT add option to limit the number of reconnect retries
In specific situation it might be useful to give up if a reconnect
is not successful or after a given number reconnect retries.
This patch adds the ability to change that. The default remains
the same: retry forever.

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-12-04 13:38:50 +01:00