Commit Graph

4035 Commits

Author SHA1 Message Date
Bart Van Assche
e72f83a05a ib_srpt: Avoid waiting for missing error completions
Apparently with mlx4 firmware up to and including 2.30.8000 it is not
guaranteed that for a QP associated with an SRQ error completions are
generated for all pending work requests. Avoid triggering
srpt_pending_cmd_timeout() for missing error completions.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5370 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 12:07:43 +00:00
Bart Van Assche
b95b1f4d6c ib_srpt: Add a kernel warning
Invoking srpt_zerolength_write() before the queue pair has reached
the error state is a bug, so complain loudly if that happens.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5369 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 12:04:44 +00:00
Bart Van Assche
ada7c26a2e ib_srpt: Fix a kernel warning
Avoid that the following (very rare) kernel warning is reported
when an ib_srpt target port is disabled while I/O is ongoing:

WARNING: CPU: 3 PID: 12259 at srpt/src/ib_srpt.c:3334 srpt_xmit_response+0x165/0x300 [ib_srpt]()
Unexpected command state 6
Call Trace:
 [<ffffffff814a15dc>] dump_stack+0x4e/0x7a
 [<ffffffff8104bc5d>] warn_slowpath_common+0x7d/0xa0
 [<ffffffff8104bccc>] warn_slowpath_fmt+0x4c/0x50
 [<ffffffffa0771525>] srpt_xmit_response+0x165/0x300 [ib_srpt]
 [<ffffffffa082aacc>] scst_xmit_response+0xbc/0x560 [scst]
 [<ffffffffa083123d>] scst_process_active_cmd+0x29d/0x7b0 [scst]
 [<ffffffffa0832bd9>] scst_do_job_active+0x89/0x1a0 [scst]
 [<ffffffffa0832e4f>] scst_cmd_thread+0x15f/0x350 [scst]
 [<ffffffff810766cd>] kthread+0xed/0x110
 [<ffffffff814b312c>] ret_from_fork+0x7c/0xb0
---[ end trace 591f7af7d006fc0e ]---


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5368 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 12:03:09 +00:00
Bart Van Assche
de3ed1e6ec ib_srpt: Micro-optimize srpt_adjust_srq_wr_avail()
The overhead of atomic_add_return() is lower than that of a
spin_lock() / spin_unlock() pair, hence switch to the former.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5367 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 12:01:07 +00:00
Bart Van Assche
a0cd399507 ib_srpt: Clean up srpt_destroy_ch_ib()
All callers guarantee that the completion queue is empty so it is
not necessary to invoke ib_poll_cq() from inside this function.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5366 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 11:59:27 +00:00
Bart Van Assche
a4cf36ba4e ib_srpt: Change the severity level of a log message
Make sure that target port state changes get logged even with
debugging disabled.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5365 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 11:57:39 +00:00
Bart Van Assche
b40f69db8b ib_srpt: Add newline at the end of kernel warning statements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5364 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 11:55:56 +00:00
Bart Van Assche
d1e1e480ed ib_srpt: Clarify a kernel-doc comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5363 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-24 11:53:00 +00:00
Vladislav Bolkhovitin
b91c338235 Fix error recovery of internal commands
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5362 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-21 23:12:42 +00:00
Bart Van Assche
3c5a901bf0 srpt/Makefile: Avoid that the build process depends on source control tools
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5361 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-21 16:29:26 +00:00
Vladislav Bolkhovitin
4a5b7bc8e6 In VERIFY commands BYTCHK 1x is not supported (yet)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5360 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-21 01:58:13 +00:00
Bart Van Assche
a2917b0fec scst_const.h: Make COMPARE_AND_WRITE definition available for kernel versions 3.6..3.11
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5359 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 16:10:19 +00:00
Bart Van Assche
46b583a918 srpt/session-management.txt: Document how sessions are managed by the ib_srpt driver
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5358 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:26:48 +00:00
Bart Van Assche
fe6ad820db ib_srpt: Rework waiting for last WQE
After having changed the queue pair state into "error", queue an additional
work request instead of waiting for the last WQE event.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5357 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:25:34 +00:00
Bart Van Assche
46aa72be44 ib_srpt: Defer destroying the QP until the TimeWait state has been left
This is necessary to avoid that a login gets rejected due to reusing a
queue pair number that has not yet been freed by the target side.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5356 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:24:18 +00:00
Bart Van Assche
7efb024a7d ib_srpt: Simplify channel state management code
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:23:16 +00:00
Bart Van Assche
0433a5c965 ib_srpt: Rework multi-channel support
Store initiator and target port ID's once per nexus instead of in each
channel data structure.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5354 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:22:19 +00:00
Bart Van Assche
ef2deeadae ib_srpt: Micro-optimize polling
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5353 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:20:55 +00:00
Bart Van Assche
d7e06bba9f ib_srpt: Introduce a temporary variable in srpt_handle_new_iu()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5352 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:19:34 +00:00
Bart Van Assche
e61e0beae6 ib_srpt: Sync information unit memory only once
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5351 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:19:05 +00:00
Bart Van Assche
bfae911b39 ib_srpt: Micro-optimize SRP_CMD parsing
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5350 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:18:38 +00:00
Bart Van Assche
91358f846c ib_srpt: Avoid that cmd_wait_list processing triggers command reordering
Although harmless for SCSI commands with SIMPLE ordering, avoid that commands
received before RTU can get reordered.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5349 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:18:06 +00:00
Bart Van Assche
f44bd8a7fa ib_srpt: Fix an error reported by the kerneldoc tool
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5348 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:17:04 +00:00
Bart Van Assche
ecc0a4a25d ib_srpt/Makefile: Add kerneldoc target
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5347 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:16:27 +00:00
Bart Van Assche
aa726929fa ib_srpt: Handle GID change events properly
The mlx4_core driver generates a GID change event after a port has been
changed from IB into Ethernet mode. Avoid that this causes the following
error message to appear in the system log:
    
ib_srpt: ***ERROR***: received unrecognized IB event 18


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5346 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:15:54 +00:00
Bart Van Assche
f213e944cf ib_srpt: Micro-optimize I/O context state manipulation
All ioctx->state manipulations are serialized per command so it is
not necessary to use locking to protect these manipulations.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5345 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:14:45 +00:00
Bart Van Assche
e16e4beb3b ib_srpt: Simplify srpt_handle_cmd()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5344 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-20 15:13:50 +00:00
Vladislav Bolkhovitin
20e99f16be scst/README: Show how to read SCST sysfs attributes
Make the behavior of SCST sysfs attributes more clear by adding
examples in scst/README of code for reading and writing these attributes.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5340 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-19 04:28:46 +00:00
Bart Van Assche
c43bf7e435 ib_srpt: Avoid that session logout hangs sporadically
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5339 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-18 15:35:13 +00:00
Bart Van Assche
bcc5cefce8 srpt: Minor buid process terminology change
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5338 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-16 13:38:50 +00:00
Bart Van Assche
9fd28d336a scripts/kernel-functions: Kernel 3.13.6 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5337 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-15 06:47:26 +00:00
Vladislav Bolkhovitin
3ffd2cf674 Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5336 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-15 02:13:58 +00:00
Vladislav Bolkhovitin
551dd518ac Fix URL to SCST website
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5335 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-15 02:09:17 +00:00
Vladislav Bolkhovitin
f32f05c483 scst_vdisk: Implement COMPARE AND WRITE
Ensure that COMPARE AND WRITE is executed atomically by serializing
all COMPARE AND WRITE commands per device (SCST_SERIALIZED).

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5334 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-15 02:01:17 +00:00
Vladislav Bolkhovitin
1dca2eb45a vdisk_blockio: Add VERIFY implementation
There is already an implementation of the VERIFY command for vdisk_fileio
devices. Add an implementation for vdisk_blockio devices.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5333 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-15 01:44:35 +00:00
Vladislav Bolkhovitin
f9ad2fcf8c vdisk_blockio: Change default vendor name back to "SCST_BIO"
In r5316 the default vendor name for vdisk_blockio devices was changed
into "SCST_FIO". Change this back into "SCST_BIO".

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5332 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-15 01:42:06 +00:00
Vladislav Bolkhovitin
b76d2036f2 scst_vdisk: Remove an unused parameter from vdisk_fsync*()
The "struct vdisk_cmd_params *p" parameter is neither used by vdisk_fsync(),
vdisk_fsync_blockio() nor by vdisk_fsync_fileio() so remove it.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5331 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-15 01:40:57 +00:00
Vladislav Bolkhovitin
354a396cd4 Implement REPORT SUPPORTED TASK MANAGEMENT FUNCTIONS command
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5330 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-15 01:38:37 +00:00
Vladislav Bolkhovitin
8680f05aac Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5329 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-15 01:38:06 +00:00
Vladislav Bolkhovitin
1583b1021f Update link to Gentoo HOWTO from Jurie Botha
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5326 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-13 03:50:37 +00:00
Bart Van Assche
7a7e255878 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5325 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-08 13:30:29 +00:00
Vladislav Bolkhovitin
59399c2471 PERSISTENT RESERVE IN: Suppress a kernel warning for small output buffer sizes
This patch suppresses the following error message and kernel warning:

scst: ***ERROR***: Too big response data len 24 (max 8), limiting it to the max (dev iis)
Call Trace:
 [<ffffffff818b1193>] ? dump_stack+0x41/0x56
 [<ffffffffa01c1a8f>] ? scst_set_resp_data_len+0x82/0xb1 [scst]
 [<ffffffffa01ca80f>] ? scst_pr_read_reservation+0xbf/0xc4 [scst]
 [<ffffffffa01b707b>] ? scst_persistent_reserve_in_local+0x140/0x1ce [scst]
 [<ffffffffa01b7cee>] ? scst_exec_check_blocking+0x57/0xf1 [scst]
 [<ffffffffa01b85f4>] ? scst_process_active_cmd+0x86c/0x136f [scst]
 [<ffffffffa01b913c>] ? scst_do_job_active+0x45/0x5b [scst]
 [<ffffffffa01b939c>] ? scst_cmd_thread+0x218/0x2b7 [scst]
 [<ffffffff8105292a>] ? wake_up_bit+0x23/0x23
 [<ffffffffa01b9184>] ? scst_cmd_tasklet+0x32/0x32 [scst]
 [<ffffffff81052355>] ? kthread_freezable_should_stop+0x51/0x51
 [<ffffffffa01b9184>] ? scst_cmd_tasklet+0x32/0x32 [scst]
 [<ffffffff81052400>] ? kthread+0xab/0xb3
 [<ffffffff81052355>] ? kthread_freezable_should_stop+0x51/0x51
 [<ffffffff818b4e3c>] ? ret_from_fork+0x7c/0xb0
 [<ffffffff81052355>] ? kthread_freezable_should_stop+0x51/0x51

Reported-by: Roman Bogdanov <bogdanovr@gmail.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5324 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-07 04:02:39 +00:00
Bart Van Assche
8428129d93 scst_vdisk: Avoid that smatch complains about unreachable code
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5323 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-06 07:29:00 +00:00
Vladislav Bolkhovitin
917dad5fed scst_vdisk: Make vdisk_nullio size configurable
Keep the default size of vdisk_nullio devices at VDISK_NULLIO_SIZE. Add
a sysfs attribute 'size' which is the size of a vdisk device in
bytes. Make the size of vdisk_nullio devices configurable. Accept
"size" and "size_mb" as creation parameters for vdisk_nullio
devices. Generate a CAPACITY DATA HAS CHANGED unit attention after size
changes. Refuse any attempt to change the size into a number that is
not a multiple of the block size.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5322 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-05 03:27:21 +00:00
Bart Van Assche
95897d700e Documentation spelling fix: change INQUERY into INQUIRY
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5320 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-02 08:49:50 +00:00
Vladislav Bolkhovitin
312c7d85d6 scst_vdisk: Make vendor, product ID and related fields configurable via sysfs
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5316 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-26 02:49:38 +00:00
Vladislav Bolkhovitin
d59230f2fd Make internal memory layout more cache friendly
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5315 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-26 02:32:39 +00:00
Bart Van Assche
5bb79dd23e nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5312 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-25 10:59:54 +00:00
Bart Van Assche
77f366ba08 nightly build: Add support for kernels >= 3.10.30 and >= 3.12.11
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5311 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-25 10:58:08 +00:00
Bart Van Assche
cbb8071e73 put_page_callback-3.10.30.patch: Add
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5310 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-25 10:57:27 +00:00