113 Commits

Author SHA1 Message Date
Chesnokov Gleb
41943ed156 iscsi-scst: Remove support for kernel versions before 3.10
The SCST has dropped support for kernels older than 3.10.0 (RHEL 7 / Centos 7) since SCST v3.6.
2022-01-13 17:26:37 +03:00
Bart Van Assche
a673470ce3 scst, iscsi-scst: Use struct kvec instead of struct iovec for kernel data
This patch does not change any functionality but removes multiple __force
__user casts.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9197 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-11-27 03:45:16 +00:00
Bart Van Assche
c51cf132e1 iscsi-scst: Add network namespace support
This patch makes it possible to run the SCST iSCSI target software inside
a Docker container that uses another network namespace than the default.
    
See also https://github.com/bvanassche/scst/issues/24 .


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9002 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-06 16:27:41 +00:00
Bart Van Assche
d1f7b0aae8 iscsi-scst: Fix multiple checkpatch warnings
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8050 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-03-11 03:57:09 +00:00
Bart Van Assche
08e532715d Remove procfs support
Since all RHEL/CentOS 5 users have upgraded to a newer version, procfs
support is no longer necessary. Hence remove procfs support. This patch
has been generated as follows:

git grep -lw CONFIG_SCST_PROC iscsi-scst qla2x00t scst scst_local srpt |\
  while read f; do
    echo ${f}
    unifdef -U CONFIG_SCST_PROC ${f} >${f}.out
    mv ${f}.out ${f}
  done

followed by two small manual edits in scst/include/scst.h and also in
qla2x00t/qla2x00-target/qla2x00t.c.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7999 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-03-02 20:04:25 +00:00
Bart Van Assche
e79fcbd8f3 iscsi-scst: Remove zero-copy TCP/IP support
Zero-copy TCP/IP support is deprecated since a while and is no longer
supported for recent kernels. Hence remove it and also all references
to zero-copy TCP/IP support.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7809 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-11-10 17:50:59 +00:00
Bart Van Assche
9fff6bc1f0 iscsi-scst: Declare cmnd_alloc() static
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7808 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-11-10 17:48:33 +00:00
Vladislav Bolkhovitin
f549829482 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7396 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-04-12 03:49:10 +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
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
Bart Van Assche
6897c820f9 fcst/fcst.h: Add identifier names
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7266 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-11-13 16:49:39 +00:00
Bart Van Assche
642744c9fc Fix spelling of "Ardis Technologies"
Reference: http://www.ddpsan.com/support-sales/about-us.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7165 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-05-02 22:32:06 +00:00
Vladislav Bolkhovitin
68fa7e1a0d Copyright updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-22 03:19:52 +00:00
Vladislav Bolkhovitin
c9b301bf39 iscsi-scst: add per_sess_dedicated_tgt_threads attribute in ini groups
If this attrubute is set, each iSCSI session for this initiator has
dedicated, i.e. not shared with other sessions, pool of the iscsi{wr,rd}
kernel threads.

Useful to control per-session CPU affinity to improve performance.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7069 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-20 06:00:43 +00:00
Vladislav Bolkhovitin
fa2f54ac9e Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6787 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-01-22 04:04:43 +00:00
Bart Van Assche
7614eafd64 iscsi-scst: Insert a blank line after declarations
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6616 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-07 00:00:42 +00:00
Vladislav Bolkhovitin
e5e54f312b iscsi-scst: Move old TM response dropping to preparing new response stage
The second TM request can come while the old one, response for which is
going to be delayed, is still being processed, hence no response
prepared yet, so the delayed response should be dropped on the stage of
the new response preparing. Otherwise in this place the old delayed
response will trigger BUG_ON().



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6456 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-31 01:09:58 +00:00
Vladislav Bolkhovitin
1656efe689 iscsi-scst: small post-r6315 cleanup
Avoid that rd_task declared when it is not used



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6408 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-03 04:21:52 +00:00
Bart Van Assche
46915ef3e5 iscsi-scst: Fix a syntax error
Preprocessor directives are not allowed in argument lists of a macro.
This patch reverts r6317.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6393 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 05:00:20 +00:00
Vladislav Bolkhovitin
3e9eaf6b29 iscsi-scst: small post-r6315 cleanup
Avoid that rd_task when it is not used



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6317 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-16 01:43:26 +00:00
Bart Van Assche
7566e2ed71 Avoid that compiler warnings depend on the build mode
It is annoying that some warnings are only reported in release mode.
Modify scst_debug.h such that the compiler does not report variables
that are only used in debug builds as unused.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6315 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-15 22:15:07 +00:00
Bart Van Assche
0d9d6a6f57 isert-scst: Fix in-tree build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6312 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-12 16:15:45 +00:00
Bart Van Assche
6aaeca1cd9 Merge iser branch r6234 into trunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6235 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-10 15:35:26 +00:00
Vladislav Bolkhovitin
1e78126962 iscsi-scst: update for 3.19 kernels
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> with some improvements



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6187 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-24 02:54:52 +00:00
Vladislav Bolkhovitin
fe38e4acb2 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-19 00:01:03 +00:00
Bart Van Assche
c8d86e2811 Source code spelling fix: accesss -> access
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5944 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:28:56 +00:00
Bart Van Assche
23bfab0626 iscsi-scst: Make iscsi_thread_pool locking more fine-grained
Protect iscsi_thread_pool.threads_list via tp_mutex instead of
scst_mutex.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5852 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-10-18 08:56:23 +00:00
Vladislav Bolkhovitin
b5c649ef5c Update for 3.15 kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5610 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-19 03:51:48 +00:00
Vladislav Bolkhovitin
00851a7501 Merge of adding iSER web page and copyright updates from the iSER branch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5241 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 05:17:26 +00:00
Vladislav Bolkhovitin
2cadcc2c64 Cache alignment review
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4809 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-23 01:38:31 +00:00
Vladislav Bolkhovitin
b9c0b9d92d Another micro-optimization: cache align all fast path structures
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4785 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-04 23:51:16 +00:00
Vladislav Bolkhovitin
10ca1d2f20 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4767 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-20 02:05:29 +00:00
Vladislav Bolkhovitin
e9008a5b12 Fix possible BUG_ON() on multiple forced commands release
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4513 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-11 20:38:57 +00:00
Vladislav Bolkhovitin
eb95049061 Copyrights updated + cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4216 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-18 02:26:39 +00:00
Vladislav Bolkhovitin
9da517bae1 Update for kernel 3.2. Netlink part in iSCSI-SCST done by Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4077 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-01-18 23:48:02 +00:00
Vladislav Bolkhovitin
69d8c2fbd7 Change __attribute__((packed)) into __packed and
__attribute__((aligned(x))) into __aligned(x) in kernel code since
checkpatch complains about the former.

BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3952 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-06 03:02:13 +00:00
Vladislav Bolkhovitin
c54ebba11a Some more TM cleanups/improvements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3460 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-18 21:45:09 +00:00
Vladislav Bolkhovitin
5e7544e5a4 TM handling fixes, part2, hopefully, final.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3450 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-12 01:31:01 +00:00
Vladislav Bolkhovitin
70eb596f60 Rework iSCSI aborts to make them more correct and remove recent workarounds (one more post-IET cleanup)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3444 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-09 23:07:23 +00:00
Vladislav Bolkhovitin
3c59daab2a Correctly process being read cmd during abort
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3413 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-26 00:04:01 +00:00
Vladislav Bolkhovitin
64065a21e9 NOP-In/response timeouts improvements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3411 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-25 23:50:49 +00:00
Vladislav Bolkhovitin
16f654b5ad Update for 2.6.38
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3294 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-03-21 14:10:50 +00:00
Vladislav Bolkhovitin
f3238333dd Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3200 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-01-06 20:02:04 +00:00
Vladislav Bolkhovitin
52820b5d57 Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2720 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-17 11:40:08 +00:00
Vladislav Bolkhovitin
27ed60c19d Let's be safe and always do memory barrier after all *_get().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2462 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-10-25 13:09:47 +00:00
Vladislav Bolkhovitin
929b4db422 Slightly modified patch from Bart Van Assche <bvanassche@acm.org> fixing build breakage on not too recent kernels introduced by r2317
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2324 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-10-01 12:09:26 +00:00
Vladislav Bolkhovitin
ff2c24c1c3 Assigning CPU affinity to threads and connections
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2317 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-30 18:07:27 +00:00
Bart Van Assche
5b33692678 More upstream include path conversions.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-09 15:27:54 +00:00
Vladislav Bolkhovitin
3120885a46 - Eliminate theorethically possible race leading to sending wrong max_sn to initiators
- Alignment cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2022 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-30 20:34:17 +00:00
Vladislav Bolkhovitin
1607d12c9c Sysfs cleanups and fixes, part 1
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1962 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-20 15:38:21 +00:00