Commit Graph

19 Commits

Author SHA1 Message Date
Peter Lieven
e219f1bb97 utils/examples: avoid busy waiting on wait for reconnect
Signed-off-by: Peter Lieven <pl@kamp.de>
2015-04-13 10:26:28 +02:00
Peter Lieven
2c1b88e9e7 iscsi-perf: add a max reconnects switch and fix double CTRL-C
this adds a switch to define max_reconnects instead of just aborting
after a NOP timeout. It is now also possible to force an exit
if CTRL-C is pressed twice.

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-03-31 15:44:46 +02:00
Peter Lieven
b9dc3749c9 iscsi-perf: add a switch to send requests of random size
Signed-off-by: Peter Lieven <pl@kamp.de>
2015-03-27 12:18:58 +01:00
Peter Lieven
9d6f0690f8 iscsi-perf: add NOPs to the perf stream and account for timeouts
Signed-off-by: Peter Lieven <pl@kamp.de>
2015-03-27 11:08:37 +01:00
Peter Lieven
44b1a2e1e0 iscsi-perf: use a common iovec for all requests
this avoids a lot of unnecessary mallocs and frees.

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-03-26 11:08:31 +01:00
Peter Lieven
fe265aef9c connect: allow to avoid the testunit ready call in iscsi_full_connect_async
iscsi-ls show luns command does not work when the target redirects at login.
to avoid redundant code allow iscsi_full_connect_async to skip the testunit ready
part.

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-03-26 10:48:01 +01:00
Peter Lieven
2955b2c616 init: apply settings to context in iscsi_parse_url
if iscsi_context is not NULL we apply the parsed settings
to the context.

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-03-26 10:37:39 +01:00
Peter Lieven
2fc538c8be iscsi-perf: add SCSI_STATUS_BUSY and SCSI_STATUS_CHECK_CONDITION handling.
this also fixes abort on errors and time output.

Signed-off-by: Peter Lieven <pl@kamp.de>
2015-03-24 14:32:00 +01:00
Stefan Weil
86adf5847c Fix wrong checks for username
The variable user in struct iscsi_url is a character array, not a pointer.
Therefore its address will never be NULL.

When libscsi is built using clang instead of gcc, those errors are reported:

iscsi-perf.c:256:17: error:
 comparison of array 'iscsi_url->user' not equal to a null
 pointer is always true [-Werror,-Wtautological-pointer-compare]
iscsi-dd.c:272:17: error:
 comparison of array 'iscsi_url->user' not equal to a null
 pointer is always true [-Werror,-Wtautological-pointer-compare]
iscsi-dd.c:331:17: error:
 comparison of array 'iscsi_url->user' not equal to a null
 pointer is always true [-Werror,-Wtautological-pointer-compare]
ld_iscsi.c:99:18: error:
 comparison of array 'iscsi_url->user' not equal to a null
 pointer is always true [-Werror,-Wtautological-pointer-compare]

Fix those errors and also similar code patterns in aros/iscsi-ls.c and
test-tool/iscsi-support.c.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-03-07 09:54:38 +01:00
Stefan Weil
d7a8ab0f1e Remove trailing blanks
The files touched here need a bug fix which is applied with the
following patch.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-03-07 09:54:38 +01:00
Ronnie Sahlberg
7ffce43dc9 iscsi-util.c: use PRIu64 instead of llu
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-03-02 19:46:46 -08:00
Sitsofe Wheeler
7c6a3e4a0b iscsi-perf: Use gettimeofday if clock_gettime is unavailable
clock_gettime doesn't existing on OS X
(http://stackoverflow.com/questions/5167269/clock-gettime-alternative-in-mac-os-x
) so add an autoconf test to check if the platform has it and fall back
on gettimeofday if not.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
2015-03-01 16:15:51 +00:00
Sitsofe Wheeler
04ff9584ee iscsi-perf.c: Use %llu format string.
Compiling with clang gives a format warning like
iscsi-perf.c:98:53: error: format specifies type 'unsigned long' but the
argument has type 'uint64_t' (aka 'unsigned long long')
      [-Werror,-Wformat]
so replace %lu with %llu where appropriate.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
2015-03-01 16:12:13 +00:00
Ronnie Sahlberg
004f16675e Merge pull request #141 from plieven/iscsi-io
util: introduce iscsi-perf
2015-01-23 06:18:11 -08:00
Peter Lieven
433b3384e6 util: introduce iscsi-perf
this adds the very first version of iscsi-perf to measure throughput
to and performance of an iscsi LUN.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-11-25 16:08:29 +01:00
Bart Van Assche
0763dc5743 libiscsi: Clear PS bit before sending MODE SELECT
A quote from SPC-4: "When using the MODE SENSE command, a
parameters saveable (PS) bit set to one indicates that the mode
page may be saved by the logical unit in a nonvolatile, vendor
specific location. A PS bit set to zero indicates that the device
server is not able to save the supported parameters. When using
the MODE SELECT command, the PS bit is reserved."

Hence clear the PS bit after having queried a mode page via MODE
SENSE and before changing it via MODE SELECT.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-10-14 17:56:40 -07:00
Ronnie Sahlberg
6285ba72b7 iscsi-swp: Check user[0]!=0 instead of user!=NULL. user is no longer a pointer.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-13 17:19:24 -07:00
Ronnie Sahlberg
1daa323e8b Change remaining command line arguments --initiator_name to --initiator-name
Change the remaining instances to match the manpages and help texts
2014-03-26 17:58:30 -07:00
Ronnie Sahlberg
c07779cfa7 AUTOTOOLS: Add a Makefile.am for the iscsi-* utilities 2014-03-22 13:10:19 -07:00