Commit Graph

62 Commits

Author SHA1 Message Date
Bart Van Assche
8b4670db3e ci: First phase of adding MingW support 2021-07-17 21:06:19 -07:00
Bart Van Assche
cb4489776b configure.ac: Run autoupdate 2021-07-17 20:59:53 -07:00
Bart Van Assche
70759869ff Port to MinGW
Compile-tested only.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2021-05-23 13:23:52 -07:00
Bart Van Assche
2a5a0b3291 Enable -Wno-unused-parameter
Instead of adding __attribute__((unused)) to unused arguments, add the
-Wno-unused-parameter compiler flag.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2021-05-23 13:23:41 -07:00
zhenwei pi
6ed1ffb7b2 iser: support rdma ack timeout optimization
Since 2c1619edef61a03cb516efaa81750784c3071d10 for linux kernel and
55843c4ab8f559679d28c559cc4d681836be769b for rdma-core, rdma cma
supports RDMA_OPTION_ID_ACK_TIMEOUT. It's useful for RDMA out of
sequence case. Because this feature is added recently, we have to
check this in autogen.sh before building source code.

Depend on production enviroument, tunning rdma ack timeout could get
the best performance. Suggested by Bart and Ronnie, instead of using
a fixed timeout value, add two methods to set rdma ack timeout value.
1, add URL variable 'LIBISCSI_RDMA_ACK_TIMEOUT'. This could works
for a specified connection.
2, add env argument 'LIBISCSI_RDMA_ACK_TIMEOUT'. This works as a
common setting for all the connection of a process.

Test under different packet loss rate and different ack timeout, run
fio (iodepth=1) in a guest os, I got this result:
latency under packet loss rate 0.00001:
	timeout 19: avg 170.22, pct99.9 215
	timeout 10: avg 160.08, pct99.9 215
	timeout 8 : avg 146.39, pct99.9 177
	timeout 7 : avg 148.37, pct99.9 211

latency under packet loss rate 0.0001:
	timeout 19: avg 949.23, pct99.9 306
	timeout 10: avg 818.53, pct99.9 378
	timeout 8 : avg 615.84, pct99.9 189
	timeout 7 : avg 618.89, pct99.9 310

Base on this test report, setting ack timeout to 8(1048.576 usec) is
a good choice in my test enviroument.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2020-03-07 12:37:46 -08:00
Bart Van Assche
66e5af9422 configure.ac: Add -Wcast-qual
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2020-02-28 21:54:49 -08:00
Ronnie Sahlberg
e6bcdf5fdb drop the LD_PRELOAD tool
I don't have time to maintain it. And it is just a toy anyway.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2020-02-12 15:21:03 +10:00
Bart Van Assche
9d2493248b Use dynamic memory allocation instead of variable-length arrays
Since it is easy to trigger a stack overflow with variable-length arrays,
use dynamic memory allocation instead of VLAs. Add -Wvla to the compiler
options such that no new VLAs get introduced.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2019-11-09 13:39:34 -08:00
Yann E. MORIN
a8d54cc82d buildsys: add option to enable/disable building the examples
In a production system, the examples are not needed.

Add a configure option to disable building the examples.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2018-12-04 10:47:34 +01:00
Yann E. MORIN
eec4954986 buildsys: add option to enable/disable build of test-tool
When doing a production system, the production environment has been
pre-validated (with this test-toll or by other means), so the teest-tool
is not needed in production.

Add a configure option to disable building test-tool.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2018-12-04 09:27:32 +01:00
Yann E. MORIN
fb2e460df9 buildsys: add option to enable/disable building tests
When doing cross-compilation, the tests are meant to be run on the
target. However, they are currently not installed, so it does not make
sense to build tehm to start with.

Additionally, when doing a system for production, those tests are not
needed anyway.

Add a configure option to disable building the tests altogether.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2018-12-04 09:27:32 +01:00
Yann E. MORIN
b8a28fad54 buildsys: handle ac_cv_cunit as a true cache-val
The ac_cv_-prefix variables are supposed to be settable from the command
line, à-la: ./configure ac_cv_foo=no

The canonical way of doing so is to use AC_CACHE_VAL() or AC_CACHE_CHECK().
The latter is to be preferred in our case, as it handles printing the
message for us.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2018-12-04 09:27:30 +01:00
Paolo Bonzini
4728d4eaa6 do not warn for strncpy
strncpy use in iscsi_reconnect is just fine.  Do not warn for it, and
also do not warn if clang does not recognize the flag.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-10-04 14:06:39 +02:00
Ronnie Sahlberg
f750101980 Add initial visual studio project files and fix the win32 build
Win32 has been rotting for a while. This patch adds vs17 build files
as well as fixing up all build errors that have accumulated.
There are still build warnings but those can be addressed in a followup
patch.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2017-05-11 21:19:14 -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
Bart Van Assche
cfac4c5d55 configure.ac: Fix RHEL 5 build
Avoid that building libiscsi on a RHEL 5 system fails as follows:

configure.ac:7: error: possibly undefined macro: AM_SILENT_RULES

Avoid that the following warning is printed when building on a RHEL 5
system:

examples/Makefile.am:24: Libtool library used but `LIBTOOL' is undefined
examples/Makefile.am:24:
examples/Makefile.am:24: The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'
examples/Makefile.am:24: to `configure.ac' and run `aclocal' and `autoconf' again.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-16 06:39:04 -07:00
Bart Van Assche
d13a85cd39 configure.ac: Suppress an autoconf warning
Avoid that autoconf prints the following warning if AM_PROG_AR
is not defined:

configure.ac:9: warning: macro `AM_PROG_AR' not found in library

See also commits 1deb4f8e4a, ace7f200fb, b9cf7e8cd2 and
6cdb47b9b4.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-16 06:38:36 -07:00
Ronnie Sahlberg
e8a2296f94 Initial test branch for adding tests to libiscsi
These tests depends on not yet released version on TGTD to allow running
both TGTD and TGTADM as unprivileged users to set up and configure
targets to test against during make test.
Update TGTD to tip of master before running these tests.

See STGT mailinglist for patches.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2015-04-13 14:58:30 -07: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
Ronnie Sahlberg
7865a8a26e Merge branch 'sgio' 2014-12-21 15:07:40 -08:00
Ronnie Sahlberg
3d6c2be342 configure: only build the test tool and ld-iscsi iff we have shared libraries
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-10-22 17:44:03 -07:00
Ronnie Sahlberg
40de7d95a9 Configure: add a test for SG_IO
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-09-18 14:26:03 -07:00
Thomas Petazzoni
474e88740a Fix CUnit test for cross-compilation
The current test in configure.ac for CUnit uses AC_TRY_RUN, which
doesn't work in a cross-compilation context, because we can't run on
the build machine the binaries that are built for the target. In
addition, the current logic assumes CUnit is available when the
AC_TRY_RUN test cannot be used (e.g in a cross-compilation case).

Since we actually don't care about *running* but only about testing
whether a simple program include the CUnit header file and linking
against the cunit library works, simply use AC_TRY_LINK() instead of
AC_TRY_RUN().

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-09-07 14:40:02 +02:00
Ronnie Sahlberg
1deb4f8e4a configure: tell platforms that dont have AM_PROG_* to just ignore it
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-08-16 19:43:25 -07:00
Ronnie Sahlberg
ace7f200fb Revert "Revert "configure.ac: Avoid that automake complains that AM_PROG_AR is missing""
After checking several platforms, we do need this change in order to build.
If CentOS<old-version> does not manage we need to figure out why and how to fix it.

This reverts commit b9cf7e8cd2.
2014-08-16 18:23:34 -07:00
Ronnie Sahlberg
b9cf7e8cd2 Revert "configure.ac: Avoid that automake complains that AM_PROG_AR is missing"
AM_PROG_AR is not available on some platforms. Revert while I investigate.

This reverts commit 6cdb47b9b4.
2014-08-11 05:59:17 -07:00
Bart Van Assche
370741f83d configure.ac: Enable the subdir-objects option
Avoid that automake >= 1.14 warns that some source files are in a
subdirectory but that the option subdir-objects is disabled. See also
http://www.gnu.org/software/automake/manual/html_node/List-of-Automake-options.html#index-Options_002c-subdir_002dobjects

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-08-02 08:29:56 -07:00
Bart Van Assche
6cdb47b9b4 configure.ac: Avoid that automake complains that AM_PROG_AR is missing
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-08-02 08:29:26 -07:00
Ronnie Sahlberg
ae60611f68 AUTOTOOLS: Add Makefile.am for examples/ 2014-03-22 17:46:02 -07:00
Ronnie Sahlberg
ea790b2f75 AUTOTOOLS: Add Makefile.am to test-tool 2014-03-22 16:46:25 -07:00
Ronnie Sahlberg
c07779cfa7 AUTOTOOLS: Add a Makefile.am for the iscsi-* utilities 2014-03-22 13:10:19 -07:00
Ronnie Sahlberg
65d3597c1b AUTOTOOLS: Create Makefile.am for lib 2014-03-22 13:10:15 -07:00
Ronnie Sahlberg
5500f84402 AUTOTOOLS: Create a separate Makefile.am for the docs directory 2014-03-22 13:10:07 -07:00
Ronnie Sahlberg
7d1f7a5308 DOCS: Add configure --enable-manpages which controls whether to build the manpages or not 2014-03-22 13:08:24 -07:00
Bart Van Assche
bd948c959e Port to CUnit version 2
Linux distributions like openSUSE 12.3 include CUnit version 2.
Apparently libiscsi uses some CUnit version 1 data structures that
have been modified in CUnit version 2. This causes the libiscsi
build to fail against CUnit version 2. Fix this by detecting the
CUnit version during the configure step.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2013-10-01 06:22:06 -07:00
Ronnie Sahlberg
027ff2fdca Solaris: older versions of solaris needs to link with nsl/socket 2013-06-29 12:16:16 -07:00
Ronnie Sahlberg
b73e91c89a Don't use -Wwrite-strings on Solaris
They have a weirdass struct option {} so we can't use this warning.
2013-06-29 12:10:43 -07:00
Doug Goldstein
2d43a056a9 Allow users to disable -Werror at configure time
Some users and distro packagers might not want to build with -Werror,
this allows them to disable using -Werror but enables it in the default
case so as to maintain the current behavior.
2013-06-05 14:28:48 -05:00
Paolo Bonzini
bcb2950d8d use libgcrypt for MD5
This makes sure that CHAP authentication is disabled if the system
is running in FIPS 140-2 mode.  MD5 is not a secure algorithm according
to the standard.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-05-03 12:51:15 +02:00
Ronnie Sahlberg
b3ca40efbe Get rid of the popt dependency 2013-04-21 10:25:30 -07:00
Ronnie Sahlberg
402653b9f3 portability updates
add check if ipv6/sockaddr_in6 is availavble or not
add check for poll.h and only include when available
add includes for AROS
2013-04-18 19:43:36 -07:00
Paolo Bonzini
5bb67f0a0b remove libdir hack
This does not work with Debian (which uses lib32 or multiarch) nor
when cross-compiling.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-02-22 18:01:23 +01:00
Paolo Bonzini
a5fd68472e distribute pkgconfig file
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-02-22 18:01:22 +01:00
Ronnie Sahlberg
d21ad441bf Add check for libcunit and only build the test suite if libcunit is available 2013-01-06 11:28:07 -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
736e175e83 Build with -Werror 2012-11-11 10:15:52 -08:00
Michael Tokarev
aee0e3bf72 always export iscsi_set_tcp_keepalive()
Set only the (socket) options which are defined on a given platform.
The function becomes a no-op if no option is known at complie time.
Remove autoconf test for HAVE_TCP_KEEPALIVE too.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2012-05-12 08:41:34 +10:00
Ronnie Sahlberg
846ace255a Autoconf: Remove AS_SET_STATUS to be compatible with autoconf < 2.65 2012-03-10 10:55:48 +11:00
Ronnie Sahlberg
add1ce67e4 Revert "Rename libiscsi to libiscsiclient to avoid clash with obscure linux library"
We dont need to change name anymore so witch back to original libiscsi name

This reverts commit c4386dfb87.
2012-03-07 14:30:37 +11:00
Ronnie Sahlberg
c4386dfb87 Rename libiscsi to libiscsiclient to avoid clash with obscure linux library
Change to version 2
2012-03-03 17:01:37 +11:00