Commit Graph

5539 Commits

Author SHA1 Message Date
Bart Van Assche
cfc340381e scst/include/backport.h: Rework the DEFINE_TIMER() backport such that it also works with kernel 3.6 and before
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7387 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-07 01:05:31 +00:00
Bart Van Assche
a22dda0a15 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7386 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:44:44 +00:00
Bart Van Assche
a1b4c9e2fc scst_lib: Port task management debug code to kernel v4.15
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7385 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:38:02 +00:00
Bart Van Assche
0c5875eac5 scripts/specialize-patch: Add support for HAVE_STRUCT_SRP_LOGIN_REQ_RDMA
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7384 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:37:36 +00:00
Bart Van Assche
258d4d6795 scripts/run-regression-tests: Suppress shellcheck warnings
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7383 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:37:21 +00:00
Bart Van Assche
7201b2de5f scripts/run-regression-tests: Add "make dpkg" test
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7382 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:37:03 +00:00
Bart Van Assche
d0e5b123eb scripts/run-regression-tests: Also build scst-dkms-rpm
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7381 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:36:46 +00:00
Bart Van Assche
fa5c8963f2 scst.spec: Simplify this spec file
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7380 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:36:31 +00:00
Bart Van Assche
e5b215d0dc scst-dkms.spec: Add /usr/include/scst/backport.h
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7379 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:36:15 +00:00
Bart Van Assche
5e82471a69 scst.spec, scst-dkms.spec: Use version of running kernel if %{kdir} has not been set
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7378 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:36:01 +00:00
Bart Van Assche
1f7fdf5cbc Makefile, rpm: Pass ${KDIR} to scst.spec
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:35:38 +00:00
Bart Van Assche
5f1fd232ae scst*.spec: Set default attributes for directories
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7376 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:35:13 +00:00
Bart Van Assche
2d9858d894 scstadmin: Remove 'use Test'
Since scstadmin doesn't use the Perl module 'Test', remove 'use Test'.
See also trunk r6736.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7375 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:34:55 +00:00
Bart Van Assche
51e4ded159 scst.spec, scstadmin.spec: Add support for Fedora
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7374 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-03-04 19:34:18 +00:00
Vladislav Bolkhovitin
464b87730c scst: make tgt_dev per-CPU array directly referenced
Modern distributions come with kernels configured for thousands CPUs
(NR_CPUS), which leads to per-CPU array of SGV pool references in each
tgt_dev exceed tens of KB requiring high order page allocations that are
not reliable on aged systems leading to inabilities to create new
sessions.

Reported-by: Jose Martins <jose.martins2307@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7373 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-16 05:27:51 +00:00
Bart Van Assche
fa153f9b96 Add .cache.mk and *.o.d to multiple Subversion ignore lists
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7372 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-13 19:18:31 +00:00
Bart Van Assche
efb383cab4 ib_srpt: Kernel v4.16 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7371 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-13 19:15:32 +00:00
Bart Van Assche
a8e299b5e6 scst_const.h: Make WRITE_VERIFY_16 available to user space applications
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7370 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-10 05:58:02 +00:00
Bart Van Assche
39d9ce2bb5 Debian: Add support for older versions on which dpkg-buildpackage neither supports -ui nor -jauto
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7369 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-08 05:43:15 +00:00
Bart Van Assche
d7dd927a07 Make Debian packaging also work for older Debian versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7368 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-08 00:21:20 +00:00
Bart Van Assche
f3d438ac01 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7367 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-07 21:32:46 +00:00
Bart Van Assche
1aa2453add dpkg: Build in release mode
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7366 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-06 03:26:33 +00:00
Bart Van Assche
47b9268d4f dpkg: Enable stripping of binary and compression of manual pages
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7365 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-06 03:26:03 +00:00
Bart Van Assche
80b20ded1b dpkg: Remove SCST init script links after package uninstallation instead of before
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7364 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-06 03:22:14 +00:00
Bart Van Assche
bcdb25e550 iscsi-scst, srpt: Remove MOFED_MAJOR and MOFED_MINOR definitions
Commit r7084 removed all users of MOFED_MAJOR. Hence also remove the
code that sets that variable. Note: MOFED_MINOR was never used in any
.c file.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7363 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-05 17:24:46 +00:00
Bart Van Assche
0dd06cbcb9 srpt/Makefile: Improve MOFED detection further
Ensure that MOFED is detected correctly on Debian systems on which the rpm
command has been installed ("alien" package).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7362 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-05 17:12:39 +00:00
Bart Van Assche
f0f5c0ae40 scst: Port DEFINE_TIMER() instances to kernel v4.15
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7361 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-05 00:12:07 +00:00
Bart Van Assche
86121f3ee4 scst: Reduce the object size slightly
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7360 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-04 23:57:14 +00:00
Bart Van Assche
c036d7afc3 scst/include/scst_debug.h: Insert a space to keep checkpatch happy
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7359 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-04 23:56:31 +00:00
Bart Van Assche
a290c4ea4b qla2x00t: Remove a cast from a debug statement
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7358 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-04 23:14:43 +00:00
Bart Van Assche
993cf71424 qla2x00t: Fix kernel-doc header inconsistencies
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7357 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-04 23:06:21 +00:00
Bart Van Assche
39139632db scst: Document scst_register_session_mq() arguments
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7356 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-04 23:05:58 +00:00
Bart Van Assche
56a8b3ba57 srpt/Makefile: Add support for detecting MOFED on Debian systems
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-04 17:55:38 +00:00
Bart Van Assche
7b7d702f10 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7354 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-03 05:15:16 +00:00
Bart Van Assche
b3435fbdda debian/rules: Also clean the scstadmin/scstadmin soft link
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7353 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-01 04:45:01 +00:00
Bart Van Assche
34f4744997 scripts/list-non-source-files: Add to repository
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7352 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-01 04:33:56 +00:00
Bart Van Assche
24568c1482 debian/rules: Make executable
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7351 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-01 04:26:50 +00:00
Bart Van Assche
41473b3e66 Add support for generating Debian packages
Debian packages can be generated by running "make dpkg". Running that command
will produce e.g. the following output:
[ ... ]
Output files:
total 8444
-rw-r--r-- 1 bart bart  185150 Jan 31 20:11 iscsi-scst_3.4.0.6003-1_amd64.deb
-rw-r--r-- 1 bart bart   53174 Jan 31 20:11 scst-dev_3.4.0.6003-1_all.deb
-rw-r--r-- 1 bart bart  878030 Jan 31 20:11 scst-dkms_3.4.0.6003-1_all.deb
-rw-r--r-- 1 bart bart    7388 Jan 31 20:09 scst_3.4.0.6003-1.debian.tar.xz
-rw-r--r-- 1 bart bart    1046 Jan 31 20:09 scst_3.4.0.6003-1.dsc
-rw-r--r-- 1 bart bart   95348 Jan 31 20:11 scst_3.4.0.6003-1_amd64.build
-rw-r--r-- 1 bart bart    6526 Jan 31 20:11 scst_3.4.0.6003-1_amd64.buildinfo
-rw-r--r-- 1 bart bart    3054 Jan 31 20:11 scst_3.4.0.6003-1_amd64.changes
-rw-r--r-- 1 bart bart 4892014 Jan 31 20:11 scst_3.4.0.6003-1_amd64.deb
-rw-rw-r-- 1 bart bart 2458224 Jan 31 20:09 scst_3.4.0.6003.orig.tar.xz
-rw-r--r-- 1 bart bart   43616 Jan 31 20:11 scstadmin_3.4.0.6003-1_amd64.deb

These packages can be installed with the dpkg command. An example:

cd dpkg && sudo dpkg -i scst_*.deb iscsi-scst_*.deb scstadmin_*.deb


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7350 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-01 04:21:29 +00:00
Bart Van Assche
dc20e09b51 scripts/clean-source-tree: Add command-line option -x (exclude file)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7349 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-01 04:19:13 +00:00
Bart Van Assche
9ec73e101a Makefile: Rework the code for generation of a source code distribution archive
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7348 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-01 04:17:00 +00:00
Bart Van Assche
6c61863bf9 Makefile: Evaluate $(VERSION) once
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7347 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-02-01 04:14:57 +00:00
Vladislav Bolkhovitin
2e5ed15fb0 scst: disabled global allocated memory limits
See scst_max_cmd_mem module parameter for more info. Allows to avoid 2
global atomic variables on the fast path, hence get better multi-queue
performance.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7346 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-01-31 23:45:04 +00:00
Vladislav Bolkhovitin
03168499aa scst: COMPARE AND WRITE also not supported for MQ sessions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7345 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-01-30 06:14:03 +00:00
Bart Van Assche
f41c5712d8 scripts/clean-source-tree: Add to repository
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7344 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-01-22 03:45:18 +00:00
Bart Van Assche
397511514a scripts/list-source-files: Improve robustness of this script
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7343 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-01-22 03:44:33 +00:00
Bart Van Assche
f2a00f8e73 scst: Fix spelling in a source code comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7342 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-01-20 16:57:52 +00:00
Vladislav Bolkhovitin
4555e7c553 scst: add possibility to create multi-queue sessions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7341 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-01-20 05:04:50 +00:00
Bart Van Assche
52e6f307b9 iscsi-scst: Fix spelling in a source code comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7340 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-01-18 05:57:05 +00:00
Vladislav Bolkhovitin
8f47816137 scst_vdisk: fix crash on/after changing vcdrom media
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7339 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-01-18 05:25:21 +00:00
Vladislav Bolkhovitin
ca9debd891 iscsi-scst: fix a subtle race inside the EXTRACHECKs facility.
The system is running an iSCSI write test with header and data digests
enabled. On the command that resulted in the assert, all of the write
data was sent as immediate and unsolicited. The unsolicited data
consisted of a single DataOut PDU and it was the iscsi_cmnd resource
allocated for receiving the unsolicited DataOut that caused the assert,
not the iscsi_cmnd resource tracking the iSCSI write command. As the
Recv thread is finishing up with the iscsi_cmnd struct for receiving the
final unsolicited DataOut, SCST is call  the  iscsi_pre_exec function to
restart the command and this routine will process the DataOut
iscsi_cmnd as it is queued onto the rx_digest_list of the iscsi_cmnd for
Write.

ffff8a984150c600 is the iscsi_cmnd allocated to track the iSCSI Write command
ffff8a984150d680 is the iscsi_cmnd allocated for receiving the Data-out PDU

In the logs below, recv thread 3677 just completed receiving the unsolicited DataOut.

[  977.563046] [3677]: do_recv:808:nr_segs 0, bytes_left 0, res 196608
[  977.563048] [31728]: iscsi_make_conn_rd_active:351:conn ffff8a97d0df1600, rd_state 2, rd_data_ready 1
[  977.563065] [3677]: do_recv:808:nr_segs 0, bytes_left 0, res 4
[  977.563069] [31728]: iscsi_make_conn_rd_active:351:conn ffff8a97d0df1600, rd_state 2, rd_data_ready 1
[  977.563076] [3677]: cmnd_rx_end:3475:cmnd ffff8a984150d680, opcode 5
[  977.563078] [31728]: iscsi_make_conn_rd_active:351:conn ffff8a97d0df1600, rd_state 2, rd_data_ready 1
[  977.563081] [3677]: cmnd_rx_end:3478:Updated last_rcv_time 4295644274
[  977.563091] [3677]: data_out_end:2455:cmnd ffff8a984150d680, req ffff8a984150c600
[  977.563093] [3677]: cmd_add_on_rx_ddigest_list:820:Adding RX ddigest cmd ffff8a984150d680 to digest list of req ffff8a984150c600
[  977.563096] [3677]: cmnd_get:764:cmnd ffff8a984150d680, new cmnd->ref_cnt 2

Here we see no more data is pending to be received on this write, so
iscsi_restart_cmnd is called by recv thread which should trigger SCST to
start processing the command:

[  977.563106] [3677]: data_out_end:2495:req ffff8a984150c600, FINAL 80, outstanding_r2t 0, r2t_len_to_receive 0, r2t_len_to_send 0
[  977.563108] [3677]: req_del_from_write_timeout_list:141:Deleting cmd ffff8a984150c600 from conn ffff8a97d0df1600 write_timeout_list
[  977.563111] [3677]: cmnd_remove_data_wait_hash:1606:Deleting cmnd ffff8a984150c600 from the hash (ITT 1e230400)

SCST thread 24654 calls the pre execute routine which verifies the data
digest on immediate and unsolicited data:

[  977.563157] [24654]: iscsi_pre_exec:1917:Checking digest of RX ddigest cmd ffff8a984150c600
[  977.563161] [24654]: digest_data:125:req ffff8a984150c600, idx 0, count 16, sg_cnt 64, size 65536, offset 0
[  977.563170] [24654]: digest_rx_data:219:RX data digest OK for cmd ffff8a984150c600
[  977.563173] [3677]: cmnd_put:775:cmnd ffff8a984150c600, new ref_cnt 2
[  977.563176] [24654]: cmd_del_from_rx_ddigest_list:830:Deleting RX digest cmd ffff8a984150c600 from digest list

Recv thread calls pre release on iscsi_cmnd allocated for unsolicited
DataOut PDU:

[  977.563178] [3677]: req_cmnd_pre_release:820:req ffff8a984150d680

[  977.563181] [24654]: cmnd_put:775:cmnd ffff8a984150c600, new ref_cnt 1

SCST thread 24654 processing data digest on unsolicited DataOut PDU.
Here we have two threads accessing  the same iscsi_cmnd struct. SCST
thread will set on_rx_digest_list flag to 0. Recv thread will set
release_called flag to 1.

[  977.563184] [24654]: iscsi_pre_exec:1917:Checking digest of RX ddigest cmd ffff8a984150d680
[  977.563186] [24654]: cmd_del_from_rx_ddigest_list:830:Deleting RX digest cmd ffff8a984150d680 from digest list
[  977.563189] [24654]: cmnd_put:775:cmnd ffff8a984150d680, new ref_cnt 0

[  977.563191] [3677]: conn_get:868:conn ffff8a97d0df1600, new conn_ref_cnt 4
[  977.563194] [24654]: cmnd_done:589:cmnd ffff8a984150d680
[  977.563196] BUG at ./iscsi-scst/kernel/iscsi.c:598 (cmnd->on_rx_digest_list)
[  977.563212] ------------[ cut here ]------------
[  977.563215] kernel BUG at ./iscsi-scst/kernel/iscsi.c:598!

Reported and analyzed by Adam Hutchinson <ajhutchin@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7338 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-01-13 03:37:19 +00:00